Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752251AbcL3I54 (ORCPT ); Fri, 30 Dec 2016 03:57:56 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:30024 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751885AbcL3I5x (ORCPT ); Fri, 30 Dec 2016 03:57:53 -0500 Subject: Re: [PATCH v5 01/14] ACPI: ARM64: IORT: minor cleanup for iort_match_node_callback() To: Hanjun Guo , Marc Zyngier , "Rafael J. Wysocki" , Lorenzo Pieralisi References: <1482384922-21507-1-git-send-email-guohanjun@huawei.com> <1482384922-21507-2-git-send-email-guohanjun@huawei.com> CC: Charles Garcia-Tobin , , , Tomasz Nowicki , , , Sinan Kaya , , Hanjun Guo , Greg KH , "Thomas Gleixner" , Agustin Vega-Frias , From: Xinwei Kong Message-ID: <5866213C.9010203@hisilicon.com> Date: Fri, 30 Dec 2016 16:56:28 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1482384922-21507-2-git-send-email-guohanjun@huawei.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.57.64.103] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090205.58662149.008F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 0f3e0a74866726016a8349475eae9acc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2023 Lines: 57 On 2016/12/22 13:35, Hanjun Guo wrote: > From: Hanjun Guo > > Cleanup iort_match_node_callback() a little bit to reduce > some lines of code, aslo fix the indentation in iort_scan_node(). > > Signed-off-by: Hanjun Guo > Cc: Lorenzo Pieralisi > Cc: Marc Zyngier > Cc: Tomasz Nowicki > --- > drivers/acpi/arm64/iort.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c > index e0d2e6e..46e2d82 100644 > --- a/drivers/acpi/arm64/iort.c > +++ b/drivers/acpi/arm64/iort.c > @@ -225,7 +225,7 @@ static struct acpi_iort_node *iort_scan_node(enum acpi_iort_node_type type, > > if (iort_node->type == type && > ACPI_SUCCESS(callback(iort_node, context))) > - return iort_node; > + return iort_node; > > iort_node = ACPI_ADD_PTR(struct acpi_iort_node, iort_node, > iort_node->length); > @@ -253,17 +253,15 @@ static acpi_status iort_match_node_callback(struct acpi_iort_node *node, > void *context) > { > struct device *dev = context; > - acpi_status status; > + acpi_status status = AE_NOT_FOUND; > > if (node->type == ACPI_IORT_NODE_NAMED_COMPONENT) { > struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; > struct acpi_device *adev = to_acpi_device_node(dev->fwnode); > struct acpi_iort_named_component *ncomp; > > - if (!adev) { > - status = AE_NOT_FOUND; > + if (!adev) > goto out; > - } > > status = acpi_get_name(adev->handle, ACPI_FULL_PATHNAME, &buf); > if (ACPI_FAILURE(status)) { > @@ -289,8 +287,6 @@ static acpi_status iort_match_node_callback(struct acpi_iort_node *node, > */ > status = pci_rc->pci_segment_number == pci_domain_nr(bus) ? > AE_OK : AE_NOT_FOUND; > - } else { > - status = AE_NOT_FOUND; > } > out: > return status; Tested-by: Xinwei Kong