From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932099AbcGAVr7 (ORCPT ); Fri, 1 Jul 2016 17:47:59 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:35336 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751966AbcGAVr6 (ORCPT ); Fri, 1 Jul 2016 17:47:58 -0400 Reply-To: ahs3@redhat.com Subject: Re: [PATCH 2/3] ACPI: fix acpi_parse_entries_array() so it traverses all subtables References: <1467408081-7418-1-git-send-email-ahs3@redhat.com> <1467408081-7418-3-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: <3b06c1f7-d1d1-f86a-ba3c-ef566af2f6db@redhat.com> Date: Fri, 1 Jul 2016 15:41:00 -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:32 PM, Rafael J. Wysocki wrote: > On Fri, Jul 1, 2016 at 11:21 PM, Al Stone wrote: >> Without this patch, the acpi_parse_entries_array() function will return >> the very first time there is any error found in either the array of >> callback functions or if one of the callbacks returns an non-zero value. >> However, the array of callbacks could still have valid entries further >> on in the array, or the callbacks may be able to process subsequent >> subtables without error. The change here makes the function consistent >> with its description so that it will properly return the sum of all >> matching entries for all proc handlers, instead of stopping abruptly >> as it does today. > > I'm not sure I follow. > > You seem to be saying that the function should process all of the > subtables etc even though errors have been found for some of them, but > it still will return an error in the end if there are any errors. How > exactly does it help to continue processing in case of an error, then? The use case I have in mind is to simply count all of the subtables of a certain type. If for some reason, the callback -- or any other callback -- fails, the traversal of all the subtables stops immediately. So, I could have two callbacks, and if the first one fails on the first subtable of its type, traversal stops. The count for the second callback will be zero which may or may not be correct. -- ciao, al ----------------------------------- Al Stone Software Engineer Red Hat, Inc. ahs3@redhat.com -----------------------------------