All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of/fdt: Remove redundant kbasename function call
@ 2020-05-12 15:49 Qi Zheng
  2020-05-13 13:44 ` Qi Zheng
  2020-05-27 18:27 ` Rob Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Qi Zheng @ 2020-05-12 15:49 UTC (permalink / raw)
  To: robh+dt, frowand.list; +Cc: devicetree, linux-kernel, Qi Zheng

For version 1 to 3 of the device tree, this is the node full
path as a zero terminated string, starting with "/". The
following equation will not hold, since the node name has
been processed in the fdt_get_name().

	*pathp == '/'

For version 16 and later, this is the node unit name only
(or an empty string for the root node). So the above
equation will still not hold.

So the kbasename() is redundant, just remove it.

Signed-off-by: Qi Zheng <arch0.zheng@gmail.com>
---
 drivers/of/fdt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 8a8e07a8f03d..ea31b2ae8474 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -643,8 +643,6 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
 	     offset = fdt_next_node(blob, offset, &depth)) {
 
 		pathp = fdt_get_name(blob, offset, NULL);
-		if (*pathp == '/')
-			pathp = kbasename(pathp);
 		rc = it(offset, pathp, depth, data);
 	}
 	return rc;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] of/fdt: Remove redundant kbasename function call
  2020-05-12 15:49 [PATCH] of/fdt: Remove redundant kbasename function call Qi Zheng
@ 2020-05-13 13:44 ` Qi Zheng
  2020-05-27 18:27 ` Rob Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Qi Zheng @ 2020-05-13 13:44 UTC (permalink / raw)
  To: robh+dt, frowand.list, robh; +Cc: devicetree, linux-kernel

On 2020/5/12 下午11:49, Qi Zheng wrote:
> For version 1 to 3 of the device tree, this is the node full
> path as a zero terminated string, starting with "/". The
> following equation will not hold, since the node name has
> been processed in the fdt_get_name().
> 
> 	*pathp == '/'
> 
> For version 16 and later, this is the node unit name only
> (or an empty string for the root node). So the above
> equation will still not hold.
> 
> So the kbasename() is redundant, just remove it.
> 
> Signed-off-by: Qi Zheng <arch0.zheng@gmail.com>
> ---
>   drivers/of/fdt.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index 8a8e07a8f03d..ea31b2ae8474 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -643,8 +643,6 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
>   	     offset = fdt_next_node(blob, offset, &depth)) {
>   
>   		pathp = fdt_get_name(blob, offset, NULL);
> -		if (*pathp == '/')
> -			pathp = kbasename(pathp);
>   		rc = it(offset, pathp, depth, data);
>   	}
>   	return rc;
> 

add Rob Herring <robh@kernel.org>.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] of/fdt: Remove redundant kbasename function call
  2020-05-12 15:49 [PATCH] of/fdt: Remove redundant kbasename function call Qi Zheng
  2020-05-13 13:44 ` Qi Zheng
@ 2020-05-27 18:27 ` Rob Herring
  2020-05-28 12:37   ` Qi Zheng
  1 sibling, 1 reply; 4+ messages in thread
From: Rob Herring @ 2020-05-27 18:27 UTC (permalink / raw)
  To: Qi Zheng; +Cc: frowand.list, devicetree, linux-kernel

On Tue, May 12, 2020 at 11:49:09PM +0800, Qi Zheng wrote:
> For version 1 to 3 of the device tree, this is the node full
> path as a zero terminated string, starting with "/". The
> following equation will not hold, since the node name has
> been processed in the fdt_get_name().
> 
> 	*pathp == '/'
> 
> For version 16 and later, this is the node unit name only
> (or an empty string for the root node). So the above
> equation will still not hold.
> 
> So the kbasename() is redundant, just remove it.

There's 2 occurrences of this. Can you remove the other one too.

Rob

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] of/fdt: Remove redundant kbasename function call
  2020-05-27 18:27 ` Rob Herring
@ 2020-05-28 12:37   ` Qi Zheng
  0 siblings, 0 replies; 4+ messages in thread
From: Qi Zheng @ 2020-05-28 12:37 UTC (permalink / raw)
  To: Rob Herring; +Cc: frowand.list, devicetree, linux-kernel

Hi Rob,

Thanks for your review.
I will send you a patch of v2 later.

Yours,
Qi Zheng

On 2020/5/28 上午2:27, Rob Herring wrote:
> On Tue, May 12, 2020 at 11:49:09PM +0800, Qi Zheng wrote:
>> For version 1 to 3 of the device tree, this is the node full
>> path as a zero terminated string, starting with "/". The
>> following equation will not hold, since the node name has
>> been processed in the fdt_get_name().
>>
>> 	*pathp == '/'
>>
>> For version 16 and later, this is the node unit name only
>> (or an empty string for the root node). So the above
>> equation will still not hold.
>>
>> So the kbasename() is redundant, just remove it.
> 
> There's 2 occurrences of this. Can you remove the other one too.
> 
> Rob
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-28 12:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 15:49 [PATCH] of/fdt: Remove redundant kbasename function call Qi Zheng
2020-05-13 13:44 ` Qi Zheng
2020-05-27 18:27 ` Rob Herring
2020-05-28 12:37   ` Qi Zheng

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.