From patchwork Wed Jan 11 15:06:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 9510523 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 31E36601E7 for ; Wed, 11 Jan 2017 15:56:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17F8D285D0 for ; Wed, 11 Jan 2017 15:56:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CDAB28609; Wed, 11 Jan 2017 15:56:43 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7F789285D0 for ; Wed, 11 Jan 2017 15:56:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cRLG9-0003mf-3Z; Wed, 11 Jan 2017 15:56:21 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRLFB-0002AF-2h for linux-arm-kernel@bombadil.infradead.org; Wed, 11 Jan 2017 15:55:21 +0000 Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cRKVg-0006YX-Ch for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2017 15:08:20 +0000 Received: by mail-pg0-x22b.google.com with SMTP id 194so21630357pgd.2 for ; Wed, 11 Jan 2017 07:07:59 -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=EuQYiVBetgHahmxrlexdk7Et2XY5liWhcnm0dQvaN2Q=; b=dIiCKSwzZCooFVqtIK/t45ZP5MvZr9mLrzCYpGs7S0EEHNqnruLIaepA8VYu/O7Q0a R89w4L/COihrmvKdvVvjiXSwVCITQ0iBwxdo2hyME68QU3TbsG7pntWN+FpLfw34/UF5 /dQvMil+4T/mv0905bkU6Vi0v6qc24CjoUw44= 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=EuQYiVBetgHahmxrlexdk7Et2XY5liWhcnm0dQvaN2Q=; b=bgWGoql7chJQ/p0ja26U+Z2kXxaef1abX9GFR9nTrk5rlmclW9LtUu0qk/mTYP7PO2 x/1DG3SbvBOxQERqe8SwfsmrK1KnYHJv2s7CBYFSr3iY4qgpFktmL5ix5OqdnUaUX3zL c9c2jja5XtgY3ROEYlZM9WuxICUTBk4ht/0Eddj4rul6WfDpR15CwlBSbCKkz17nPoVa p1vn4DAzqGhNacwRVKUPf1LGaAZQYrAfoO8Z58QORbJQV4uvIC5e4Yg22fgyplTCna1S G9KUh+qdb4l/DVIrBadXSY/H7FmlBFRtKNkvrjWlbVDkUEPq/4t4wr+LBt59HFsXWrO8 4ofQ== X-Gm-Message-State: AIkVDXLyiwVfaqxJSZYsO+sZGqAolBu2XOpJ+4iLwVe2A05WfGHNZUIOIvqEhxqqgACWI0DY X-Received: by 10.98.74.84 with SMTP id x81mr3365216pfa.172.1484147278659; Wed, 11 Jan 2017 07:07:58 -0800 (PST) Received: from localhost ([104.237.91.103]) by smtp.googlemail.com with ESMTPSA id o126sm14672085pga.34.2017.01.11.07.07.57 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 11 Jan 2017 07:07:58 -0800 (PST) From: Hanjun Guo To: Marc Zyngier , "Rafael J. Wysocki" , Lorenzo Pieralisi Subject: [PATCH v7 03/15] ACPI: IORT: minor cleanup for iort_match_node_callback() Date: Wed, 11 Jan 2017 23:06:27 +0800 Message-Id: <1484147199-4267-4-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1484147199-4267-1-git-send-email-hanjun.guo@linaro.org> References: <1484147199-4267-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170111_100820_510741_7AA42692 X-CRM114-Status: GOOD ( 12.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huxinwei@huawei.com, Kefeng Wang , Matthias Brugger , Jon Masters , yimin@huawei.com, Greg KH , linux-kernel@vger.kernel.org, linuxarm@huawei.com, Sinan Kaya , linux-acpi@vger.kernel.org, Xinwei Kong , 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. Signed-off-by: Hanjun Guo Cc: Lorenzo Pieralisi Cc: Tomasz Nowicki --- drivers/acpi/arm64/iort.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index 15f32bf..208eac9 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -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;