From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752539AbcGAVgs (ORCPT ); Fri, 1 Jul 2016 17:36:48 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:36853 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751948AbcGAVgq (ORCPT ); Fri, 1 Jul 2016 17:36:46 -0400 Reply-To: ahs3@redhat.com Subject: Re: [PATCH 1/3] ACPI: fix incorrect counts returned by acpi_parse_entries_array() References: <1467408081-7418-1-git-send-email-ahs3@redhat.com> <1467408081-7418-2-git-send-email-ahs3@redhat.com> To: "Rafael J. Wysocki" Cc: ACPI Devel Maling List , Linux Kernel Mailing List , "Rafael J . Wysocki" , Len Brown From: Al Stone Organization: Red Hat, Inc. Message-ID: <719ba3ec-4a05-6ddc-3fbc-8b6d8eab9807@redhat.com> Date: Fri, 1 Jul 2016 15:36:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/01/2016 03:25 PM, Rafael J. Wysocki wrote: > On Fri, Jul 1, 2016 at 11:21 PM, Al Stone wrote: >> The static function acpi_parse_entries_array() is provided an array of >> type struct acpi_subtable_proc that has a callback function and a count. >> The count should reflect how many times the callback has been successfully >> called. However, the current code only increments the 0th element of the >> array, regardless of the number of entries in the array, or which callback >> has been invoked. The fix is to use the index into the array, instead of >> a pointer to the beginning of the array. > > OK, so it would be good to say what the consequences of the problem are too. > Hrm. So replace the last sentence with something like: The fix is to use the index into the array, instead of a pointer to the beginning of the array, so that the count for each element in the array in incremented by the corresponding callback. That feels a little clunky but is it closer to what you were thinking? Thanks for the review! -- ciao, al ----------------------------------- Al Stone Software Engineer Red Hat, Inc. ahs3@redhat.com -----------------------------------