From patchwork Mon Jan 2 13:31:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 9493613 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E69662AB4 for ; Mon, 2 Jan 2017 13:34:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F6012015F for ; Mon, 2 Jan 2017 13:34:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63CAB266F3; Mon, 2 Jan 2017 13:34:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EA7712015F for ; Mon, 2 Jan 2017 13:34:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cO2jm-0005UC-Vj; Mon, 02 Jan 2017 13:33:19 +0000 Received: from mail-pg0-x22d.google.com ([2607:f8b0:400e:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cO2jf-0005Pr-97 for linux-arm-kernel@lists.infradead.org; Mon, 02 Jan 2017 13:33:12 +0000 Received: by mail-pg0-x22d.google.com with SMTP id y62so152054197pgy.1 for ; Mon, 02 Jan 2017 05:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iHzFjhxcuQTmeDScGzp0ut+EYzbZLC8GneFN8uXcvIA=; b=Gzcp4LyDwEzmjl6FSESK1jca3asWmYX7poaeBZ7y/8D7ozobg67T077t6rljxdeSiO iOf7zQI4apWV3jbyBhW7gapo/qUanopsr8tvJtTc9KrDdpBTkKZTfLIA+OX547OXzS4E waE/4kdwMPotbAWZp294GzTMHOXzILpEFFMIg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iHzFjhxcuQTmeDScGzp0ut+EYzbZLC8GneFN8uXcvIA=; b=mb/8Piw08oZJYqX388ATqowYqXV+VKXSRlWDgnaSAfzVqEw7X1/l5Z44yv9PsaFLIL CigwhjJP9lzkH3nRhsr3wrg2btZFCoYyxzRw908dc8iJ/FER0WOTdhc/BqYnAHRKH3Ko XOCDv6o/3aDZDbnpxsP1IwhlviIID2jW2BdSxyzIy4FMx/vbFKm+JOF6RtxPvInSQNlj RErmzvcqXm7h749c+wX+BB8sfdNwVYX0D+qcZZpoXAdMMCXIqdGUDnFLcwg7BXtJYmrx THVKct4b2EEVCVPMIs2J1Q3utH+9ZyKJNt2pbghdX0UBbMfTA4AhDoYn0V5QO/p199Kf Y6PQ== X-Gm-Message-State: AIkVDXJSRLblHnFvzZ8TRIo/lS1KMfmSEsXemdAg7WNeqnRRjAN6GO0cpnvgSstg3jWKo5v/ X-Received: by 10.99.170.5 with SMTP id e5mr108928688pgf.46.1483363970196; Mon, 02 Jan 2017 05:32:50 -0800 (PST) Received: from localhost ([104.237.91.251]) by smtp.googlemail.com with ESMTPSA id u78sm132524811pfa.53.2017.01.02.05.32.48 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 02 Jan 2017 05:32:49 -0800 (PST) From: Hanjun Guo To: Marc Zyngier , "Rafael J. Wysocki" , Lorenzo Pieralisi Subject: [PATCH v6 01/14] ACPI: ARM64: IORT: minor cleanup for iort_match_node_callback() Date: Mon, 2 Jan 2017 21:31:32 +0800 Message-Id: <1483363905-2806-2-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483363905-2806-1-git-send-email-hanjun.guo@linaro.org> References: <1483363905-2806-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170102_053311_390022_4B80FF24 X-CRM114-Status: GOOD ( 11.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huxinwei@huawei.com, Kefeng Wang , charles.garcia-tobin@arm.com, Jon Masters , yimin@huawei.com, Greg KH , linux-kernel@vger.kernel.org, linuxarm@huawei.com, Sinan Kaya , linux-acpi@vger.kernel.org, Hanjun Guo , Tomasz Nowicki , Thomas Gleixner , Agustin Vega-Frias , linux-arm-kernel@lists.infradead.org, Ma Jun MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Majun Tested-by: Xinwei Kong 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;