Skip to content

Commit 7536c7e

Browse files
Arch-Zhengrobherring
authored andcommitted
of/fdt: Remove redundant kbasename function call
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 <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent 67e35ad commit 7536c7e

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/of/fdt.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,8 +643,6 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
643643
offset = fdt_next_node(blob, offset, &depth)) {
644644

645645
pathp = fdt_get_name(blob, offset, NULL);
646-
if (*pathp == '/')
647-
pathp = kbasename(pathp);
648646
rc = it(offset, pathp, depth, data);
649647
}
650648
return rc;
@@ -671,8 +669,6 @@ int __init of_scan_flat_dt_subnodes(unsigned long parent,
671669
int rc;
672670

673671
pathp = fdt_get_name(blob, node, NULL);
674-
if (*pathp == '/')
675-
pathp = kbasename(pathp);
676672
rc = it(node, pathp, data);
677673
if (rc)
678674
return rc;

0 commit comments

Comments
 (0)