From patchwork Tue Jul 25 21:44:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 108714 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp91479obm; Tue, 25 Jul 2017 14:44:59 -0700 (PDT) X-Received: by 10.99.3.198 with SMTP id 189mr19268842pgd.49.1501019099899; Tue, 25 Jul 2017 14:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501019099; cv=none; d=google.com; s=arc-20160816; b=0Cb6FJnf3dm3j9nMpSL2cy2kHlESuTPIw/A1T67JHLXMGKbMdATsh3nr+rRAui9eO4 1WnDvFXbZxAJOuGtbWG+y25knptExaUz5Oz5f+DxDm6CsXpveHA0kyheJeiBatVYMt9x VtWviTpPR0IdMxFiLGlUzcGhMp2d8DODZPqgVk3WL1+3LgdfbSYq7z75XCOk87T/xIe5 lcTwTyK0etnjZvh/FmeigiM5dKGAt2rPh7oVw+L592k60+TJMd3KOwX4X6xKQKmS/P/U 7EpS0+YLE18dA4eIEeiUMdEl2iPtkVbOuFGyfcGK/gxfmgy0ulxIFBqHGIA5Su3kebU/ +MAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=BqhfycaKF9SPab3bheBzng4f7afjpmRuZgcFkBpJ/Zg=; b=hcE3irQm45rftj5H3v4QcYVelnlB4zYa72mgt+oVWqpmm5RJ4BKbBvXhYEy7UHLhTn DtrwrHKpuDBiA8cnNxYIxLnPrB+ya3J/XeR+cWqVHm+GGlapn+hudS3XcQ167byhZLPJ Vo9Xtk/jFzXgz54cvhj9rcsyPickg7oMu+4Gr6Ki9qZ2wCucW3lYq+qlDx9tHfOcQzx4 Cf1Wz3e7reiAmsRn0e8KNAUZeVKS6ofIsdtlvqRg3wAmJOuj0EvjAnu/B0v5F6nC/qZO tdA8Sjs4XCV0sxZ12g1ADNwezjz4X4A6gXgzgWu+YkoO7T1IEU6cffF9Lnac7BJlh0HH B7NQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si8453132pgu.76.2017.07.25.14.44.59; Tue, 25 Jul 2017 14:44:59 -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 S1751626AbdGYVon (ORCPT + 26 others); Tue, 25 Jul 2017 17:44:43 -0400 Received: from mail-yw0-f196.google.com ([209.85.161.196]:35369 "EHLO mail-yw0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974AbdGYVok (ORCPT ); Tue, 25 Jul 2017 17:44:40 -0400 Received: by mail-yw0-f196.google.com with SMTP id l82so4120227ywc.2; Tue, 25 Jul 2017 14:44:39 -0700 (PDT) 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=BqhfycaKF9SPab3bheBzng4f7afjpmRuZgcFkBpJ/Zg=; b=ba/iOwdZ63b5naNK4MLGHW5jFWnj9XN0dV0id4DQ2+FcFvNuZhA1sPzSbBVPgCLlDI IhdMkTM0iGeRMqW0Wg8W7zFm1u9r748DFlXG9pG+jo7ZvxQ4+E1KVtJgUD/RxAhOJw2Z QEWmg2DslCIThFmkjwi6kwBcH6E+GAC56NqCVYDgGZZwW/7sRi+sXNgdDgrioTgyweqU Pu1c1fFH/+99WRpIq23XorqrKYzytscLbwSHPSQOLi6IgEKjQghr1u3tAH1xk4c4YR83 tM2Tskkd/TgIQBYrmhjEkvvUPqlYyKuis2azvKiOIarViOxuxtzElH/BpuRf9dwG52gO P8Bw== X-Gm-Message-State: AIVw111ABJKndXK7XhyQOKdmd26yi9FLoI5zwIARuNfWM/4yuyUMqkSw CpbvgBuSWJCJbpd3VvY= X-Received: by 10.129.78.137 with SMTP id c131mr17304362ywb.464.1501019079433; Tue, 25 Jul 2017 14:44:39 -0700 (PDT) Received: from localhost.localdomain (24-223-123-72.static.usa-companies.net. [24.223.123.72]) by smtp.googlemail.com with ESMTPSA id 204sm2386383ywx.35.2017.07.25.14.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jul 2017 14:44:38 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Frank Rowand , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Subject: [PATCH 3/4] powerpc: pseries: only store the device node basename in full_name Date: Tue, 25 Jul 2017 16:44:26 -0500 Message-Id: <20170725214427.25768-4-robh@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170725214427.25768-1-robh@kernel.org> References: <20170725214427.25768-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With dependencies on full_name containing the entire device node path removed, stop storing the full_name in nodes created by dlpar_configure_connector() and pSeries_reconfig_add_node(). Signed-off-by: Rob Herring Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/platforms/pseries/dlpar.c | 20 ++++---------------- arch/powerpc/platforms/pseries/reconfig.c | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) -- 2.11.0 diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 783f36364690..8ab0be0706fd 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c @@ -75,24 +75,17 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa) return prop; } -static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa, - const char *path) +static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa) { struct device_node *dn; char *name; - /* If parent node path is "/" advance path to NULL terminator to - * prevent double leading slashs in full_name. - */ - if (!path[1]) - path++; - dn = kzalloc(sizeof(*dn), GFP_KERNEL); if (!dn) return NULL; name = (char *)ccwa + be32_to_cpu(ccwa->name_offset); - dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name); + dn->full_name = kasprintf(GFP_KERNEL, "%s", name); if (!dn->full_name) { kfree(dn); return NULL; @@ -148,7 +141,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, struct property *last_property = NULL; struct cc_workarea *ccwa; char *data_buf; - const char *parent_path = parent->full_name; int cc_token; int rc = -1; @@ -182,7 +174,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, break; case NEXT_SIBLING: - dn = dlpar_parse_cc_node(ccwa, parent_path); + dn = dlpar_parse_cc_node(ccwa); if (!dn) goto cc_error; @@ -192,10 +184,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, break; case NEXT_CHILD: - if (first_dn) - parent_path = last_dn->full_name; - - dn = dlpar_parse_cc_node(ccwa, parent_path); + dn = dlpar_parse_cc_node(ccwa); if (!dn) goto cc_error; @@ -226,7 +215,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, case PREV_PARENT: last_dn = last_dn->parent; - parent_path = last_dn->parent->full_name; break; case CALL_AGAIN: diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index e5bf1e84047f..73e4063ad997 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c @@ -33,7 +33,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist if (!np) goto out_err; - np->full_name = kstrdup(path, GFP_KERNEL); + np->full_name = kstrdup(kbasename(path), GFP_KERNEL); if (!np->full_name) goto out_err;