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: 90903 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1166086qgi; Wed, 11 Jan 2017 07:08:23 -0800 (PST) X-Received: by 10.84.129.111 with SMTP id 102mr14167397plb.103.1484147303201; Wed, 11 Jan 2017 07:08:23 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h24si6057826pfk.166.2017.01.11.07.08.22; Wed, 11 Jan 2017 07:08:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764403AbdAKPIF (ORCPT + 25 others); Wed, 11 Jan 2017 10:08:05 -0500 Received: from mail-pg0-f44.google.com ([74.125.83.44]:36574 "EHLO mail-pg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764343AbdAKPH7 (ORCPT ); Wed, 11 Jan 2017 10:07:59 -0500 Received: by mail-pg0-f44.google.com with SMTP id f188so282338612pgc.3 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=J68crl5C/43Vd0HEcEiYtkJuY4Ql8hBfyou3nx8DRuNOj6S4hMgo8s64LkGg9gLuXc jzn50P01YnfH9fawVYd0Vk2lA3IUuqsDppiFbYah/h3oS6D/o8gFTMO9+VN2oTxJo4ih 6MQ2cRxoobzUuuB/rL+b5s3VcDle7Ja4ezVeDgAb597WVBBIm3QK9pVZQw68zz7CDI1i D5Xx4oZtt/xJwsPNRceIS2uwJfkkTEWtHA5CYEGA1GPv1TfOiKKGmIBdHL138VmUqjWB ZZopTj+O6bdyTvopZl96xZOxrXjyDkuywRfzSmIwjUZjbTNY31cUZyrFbWR2xJ4kZztj A8cg== X-Gm-Message-State: AIkVDXK4hXHDWwgbqa/dz1GnEOlsXdpnWvURvJqiP0Sj4QS3GBSEc7s7buZbEe0WuwrbM0IS 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 Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, Thomas Gleixner , Greg KH , Tomasz Nowicki , Ma Jun , Kefeng Wang , Agustin Vega-Frias , Sinan Kaya , huxinwei@huawei.com, yimin@huawei.com, Jon Masters , Matthias Brugger , Xinwei Kong , Hanjun Guo 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 1.9.1 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;