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: 89493 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp7592566qgi; Mon, 2 Jan 2017 05:33:14 -0800 (PST) X-Received: by 10.99.172.9 with SMTP id v9mr78601991pge.12.1483363994169; Mon, 02 Jan 2017 05:33:14 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si65761802pfa.280.2017.01.02.05.33.13; Mon, 02 Jan 2017 05:33:14 -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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755985AbdABNcx (ORCPT + 25 others); Mon, 2 Jan 2017 08:32:53 -0500 Received: from mail-pg0-f43.google.com ([74.125.83.43]:36368 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755953AbdABNcu (ORCPT ); Mon, 2 Jan 2017 08:32:50 -0500 Received: by mail-pg0-f43.google.com with SMTP id f188so203993624pgc.3 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=KGgp6afn4TWwtNBjCOpIgxLALILDnUHQV3E7NNgvHiq1C8pIdx6wu27OMl5nUi0X9+ J2e3MLSLEwC5HDWG/zdVVRwpg75LDP2RkJ/2O0mWd+GWkOOZs/aKM/lZzl9yzV3t3bOR AfE4SlXcMBtkRN8O4ZsZj+j19orrg4tbLSL9JUwTATqLISO8OieXtpQD3xfmZBRHd2c0 DnU9gawMlnbXm7mlRsWN+9w78PFMShJoE+E/XTzEnyE5hlFq5IuzqTCeiJCWErrdGbht vkOQBj1cE3r6NspY1AC2Hu5rX5C2R1+jtvPw8uSWHw8EFECKNK646pca0CsJHKyS+KNp 7hGw== X-Gm-Message-State: AIkVDXKi/NUyb9lcIY1UhVaiDIo7yQgy7C0OW0ZoGHz30iIHZETFky3wH6mvD2VrQ3sAYG5k 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 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 , charles.garcia-tobin@arm.com, huxinwei@huawei.com, yimin@huawei.com, Jon Masters , Hanjun Guo 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> 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, 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(-) -- 1.9.1 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;