From patchwork Wed Dec 5 19:50:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 152963 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9696798ljp; Wed, 5 Dec 2018 11:52:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/VSikWku+JBdg1AIbPwnR+lbySCXdpgDvp3ZRAP3xG1fHtzSLV59r66rv5RFlaZmraoTra1 X-Received: by 2002:a17:902:981:: with SMTP id 1mr24728177pln.142.1544039575845; Wed, 05 Dec 2018 11:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039575; cv=none; d=google.com; s=arc-20160816; b=RPtHGhgvbsSOJlERhxPTIO9FTjwcEpsS+RzbJx0C4m7wZgO9fuS0SBVayvAiuI+LJj iiuDCEt7otUEdWpKpo/RtftjpnRQTk7Wml1MvpuD20DLG3hey6jKQF+14iy2QYS3lkL7 lHVJQI3ORZYbKQ4Go6Thi8TPp8sgS4SUIwH0tnajH7lzfFPGha96Kjt7y3/EFV+WTsyZ EmQ9qy9HR9P+r3z7YCoEJR6CwJ4JvHuSyU9Tavbs3Q+E6p5zg3HgZr/BxTsI4DFgXqRf S8KqUWsSBo4ap0LFFqVJondVFhNMQ1wtOTJRYQVDRZwAzKcwhekMZ6+rMpXRFi9G3y7S 3O8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9ctNxvuyPF5iqgO7AZYmXgEh7unI6vGdlJZ+SjG9Pu4=; b=QAuPItg+9dXwIxrqLU+4PhFLD0o7EMC6aeyYtWtu0PkHoVbEjdACUVMTiPG78p6wL4 Uf0H/Q2jWjAyx5nDYYGypmaUSkFPluRFFBWOy+x6h63llyCT/flscFpf128nTNjfRyXI pRlRi2UQ1ek71IXn29CDL1lEqxR/to0AEWTYUSw/ptIpXkEYSISvFwD+VpOo+ts00ROn vuAIy/lQDFkQk2hhqtlFxg++ra/z+3YM3EH+mgjpFOv10Q1gIOu3Yj+poJ4EVi6InaO6 PLWSSuP5UluGQrAHRTCvxvXmSku4/Ge4se2x8wWj5aBjuMpDHigqM8GDq7TBdrTe4E7N vjSQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 30si17472728pgr.396.2018.12.05.11.52.55; Wed, 05 Dec 2018 11:52:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728994AbeLETwy (ORCPT + 31 others); Wed, 5 Dec 2018 14:52:54 -0500 Received: from mail-oi1-f195.google.com ([209.85.167.195]:45246 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728761AbeLETvM (ORCPT ); Wed, 5 Dec 2018 14:51:12 -0500 Received: by mail-oi1-f195.google.com with SMTP id b141so18619286oii.12; Wed, 05 Dec 2018 11:51:12 -0800 (PST) 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:mime-version :content-transfer-encoding; bh=9ctNxvuyPF5iqgO7AZYmXgEh7unI6vGdlJZ+SjG9Pu4=; b=claS0pWtT54BKqWE0l6k2GF7a3BFEF0AnjkHfp0F31r7txs+8qNQPP5ZG0UFGAEMe4 RB+y6Vzz/EEXUR/AjzxCr0ccE87zpHjmvQ1TRf1DXhNeyVse/YAOaomA0U9fsS4iwuZn aJCkVOxP0TtxOsNvshoyZ1ymts+X6M+0DLeuq8Cdn2zSe4C+DM7oKZj/9ynigAeP4ius Du+6Pmjvb4JJoRwHcT6zRhCRGWKiyfhWcRcBH0CuhI6W6v5QeAK/QyDApVlPcvCUUjyW UUM8jFkovwHaFu5MDug/rS1LxdL+qCi0A44ijBBMfyXGODeu7b9xbwePnw/tQXM1Dqnh 9PVA== X-Gm-Message-State: AA+aEWZl4J4VxQebaDAAVYrcnXfvs7MejfXoFOrNMx0as/KVM3VL6Ldx cRyKQS0ZBVV6Bujk8ReGtGkCK78= X-Received: by 2002:a54:4f1d:: with SMTP id e29mr15009889oiy.310.1544039471399; Wed, 05 Dec 2018 11:51:11 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id k13sm25759879otj.19.2018.12.05.11.51.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:51:10 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org Subject: [PATCH] PCI: Use of_node_name_eq for node name comparisons Date: Wed, 5 Dec 2018 13:50:34 -0600 Message-Id: <20181205195050.4759-18-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Bjorn Helgaas Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-pci@vger.kernel.org Signed-off-by: Rob Herring --- drivers/pci/hotplug/rpaphp_core.c | 2 +- drivers/pci/of.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.19.1 diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index bcd5d357ca23..7697d9c92b98 100644 --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c @@ -354,7 +354,7 @@ int rpaphp_add_slot(struct device_node *dn) const int *indexes, *names, *types, *power_domains; char *name, *type; - if (!dn->name || strcmp(dn->name, "pci")) + if (!of_node_name_eq(dn, "pci")) return 0; /* If this is not a hotplug slot, return without doing anything. */ diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 4c4217d0c3f1..3d32da15c215 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -113,7 +113,7 @@ struct device_node *of_pci_find_child_device(struct device_node *parent, * a fake root for all functions of a multi-function * device we go down them as well. */ - if (!strcmp(node->name, "multifunc-device")) { + if (of_node_name_eq(node, "multifunc-device")) { for_each_child_of_node(node, node2) { if (__of_pci_pci_compare(node2, devfn)) { of_node_put(node);