All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Paul Mackerras <paulus@samba.org>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org,
	Michael Bringmann <mwb@linux.vnet.ibm.com>
Subject: Re: [PATCH] PCI: Use of_node_name_eq for node name comparisons
Date: Tue, 22 Jan 2019 14:20:35 -0600	[thread overview]
Message-ID: <20190122202035.GD14636@google.com> (raw)
In-Reply-To: <20181205195050.4759-18-robh@kernel.org>

[+cc Michael B]

On Wed, Dec 05, 2018 at 01:50:34PM -0600, Rob Herring wrote:
> 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 <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-pci@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

I applied the pci/of.c change to pci/misc for v5.1, thanks!

I dropped the rpaphp_core.c part because there's another patch
in-flight [1] that touches the same code, and it would be easier if
Michael picked up this change and added it to his series.

Bjorn

[1] https://lore.kernel.org/lkml/20181214205120.16435.46952.stgit@powerkvm6.aus.stglabs.ibm.com/

> ---
>  drivers/pci/hotplug/rpaphp_core.c | 2 +-
>  drivers/pci/of.c                  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> 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);
> -- 
> 2.19.1
> 

WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Helgaas <helgaas@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Michael Bringmann <mwb@linux.vnet.ibm.com>,
	Paul Mackerras <paulus@samba.org>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] PCI: Use of_node_name_eq for node name comparisons
Date: Tue, 22 Jan 2019 14:20:35 -0600	[thread overview]
Message-ID: <20190122202035.GD14636@google.com> (raw)
In-Reply-To: <20181205195050.4759-18-robh@kernel.org>

[+cc Michael B]

On Wed, Dec 05, 2018 at 01:50:34PM -0600, Rob Herring wrote:
> 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 <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-pci@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>

I applied the pci/of.c change to pci/misc for v5.1, thanks!

I dropped the rpaphp_core.c part because there's another patch
in-flight [1] that touches the same code, and it would be easier if
Michael picked up this change and added it to his series.

Bjorn

[1] https://lore.kernel.org/lkml/20181214205120.16435.46952.stgit@powerkvm6.aus.stglabs.ibm.com/

> ---
>  drivers/pci/hotplug/rpaphp_core.c | 2 +-
>  drivers/pci/of.c                  | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> 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);
> -- 
> 2.19.1
> 

  reply	other threads:[~2019-01-22 20:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 19:50 [PATCH] PCI: Use of_node_name_eq for node name comparisons Rob Herring
2018-12-05 19:50 ` Rob Herring
2019-01-22 20:20 ` Bjorn Helgaas [this message]
2019-01-22 20:20   ` Bjorn Helgaas
2020-04-16 21:51 Rob Herring
2020-04-16 21:51 ` Rob Herring
2020-04-24 23:03 ` Bjorn Helgaas
2020-04-24 23:03   ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190122202035.GD14636@google.com \
    --to=helgaas@kernel.org \
    --cc=benh@kernel.crashing.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=mwb@linux.vnet.ibm.com \
    --cc=paulus@samba.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.