Skip to content

Commit 84e215d

Browse files
committed
u-boot: v2026.04: fdt_fixup_ethernet: avoid nodeoff shadowing
When FDT_SEQ_MACADDR_FROM_ENV is defined, nodeoff is already declared and assigned earlier in the function. The later 'int nodeoff = ...' shadowed that variable and performed a redundant fdt_path_offset() lookup. Guard the inner declaration with #ifndef so it only exists when the outer one does not. No behavior change — the same nodeoff value is checked either way. Addresses a CodeRabbit review comment on PR armbian#9675.
1 parent cf1aeca commit 84e215d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

patch/u-boot/v2026.04/board_helios64/1001-fdt_fixup_ethernet-add-logs.patch

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ index 111111111111..222222222222 100644
8989
continue;
9090
-
9191
+ }
92+
+#ifndef FDT_SEQ_MACADDR_FROM_ENV
9293
+ int nodeoff = fdt_path_offset(fdt, path);
94+
+#endif
9395
+ if (nodeoff < 0) {
9496
+ log_info("[fdt_fixup_ethernet] Node path '%s' not found, skipping\n", path);
9597
+ total_skipped++;

0 commit comments

Comments
 (0)