From patchwork Thu Jun 2 06:03:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kefeng Wang X-Patchwork-Id: 69125 Delivered-To: patch@linaro.org Received: by 10.140.23.41 with SMTP id 38csp162301qgo; Wed, 1 Jun 2016 23:05:13 -0700 (PDT) X-Received: by 10.66.43.172 with SMTP id x12mr1941755pal.111.1464847513811; Wed, 01 Jun 2016 23:05:13 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s20si22799746paf.70.2016.06.01.23.05.13; Wed, 01 Jun 2016 23:05:13 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751336AbcFBGFJ (ORCPT + 30 others); Thu, 2 Jun 2016 02:05:09 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:18676 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750731AbcFBGFI (ORCPT ); Thu, 2 Jun 2016 02:05:08 -0400 Received: from 172.24.1.136 (EHLO szxeml422-hub.china.huawei.com) ([172.24.1.136]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DLQ87589; Thu, 02 Jun 2016 14:04:41 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by szxeml422-hub.china.huawei.com (10.82.67.152) with Microsoft SMTP Server id 14.3.235.1; Thu, 2 Jun 2016 14:04:32 +0800 From: Kefeng Wang To: Catalin Marinas CC: Will Deacon , linux-arm-kernel , Ganapatrao Kulkarni , Robert Richter , "David Daney" , Rob Herring , linux-kernel , , , Subject: [PATCH 1/3] of_numa: Use of_get_next_parent to simplify code Date: Thu, 2 Jun 2016 14:03:07 +0800 Message-ID: <1464847389-11652-2-git-send-email-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1464847389-11652-1-git-send-email-wangkefeng.wang@huawei.com> References: <1464834491-12024-1-git-send-email-thunder.leizhen@huawei.com> <1464847389-11652-1-git-send-email-wangkefeng.wang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.574FCC7B.00AC, 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: f7cd2a54282bac896395ffb0e57fc079 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use of_get_next_parent() instead of open-code. Signed-off-by: Kefeng Wang --- drivers/of/of_numa.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 1.7.12.4 diff --git a/drivers/of/of_numa.c b/drivers/of/of_numa.c index 3157130..ed7bd22 100644 --- a/drivers/of/of_numa.c +++ b/drivers/of/of_numa.c @@ -153,8 +153,6 @@ int of_node_to_nid(struct device_node *device) np = of_node_get(device); while (np) { - struct device_node *parent; - r = of_property_read_u32(np, "numa-node-id", &nid); /* * -EINVAL indicates the property was not found, and @@ -165,9 +163,7 @@ int of_node_to_nid(struct device_node *device) if (r != -EINVAL) break; - parent = of_get_parent(np); - of_node_put(np); - np = parent; + np = of_get_next_parent(np); } if (np && r) pr_warn("NUMA: Invalid \"numa-node-id\" property in node %s\n",