]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: bdinfo: fix incorrect Kconfig options check for print_eth()
authorQuentin Schulz <quentin.schulz@cherry.de>
Thu, 18 Dec 2025 10:59:58 +0000 (11:59 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 2 Jan 2026 21:51:54 +0000 (15:51 -0600)
CMD_NET_LWIP has never existed so it cannot be right. I'm guessing the
intent was to allow print_eth() to be called when NET_LWIP is defined
(NET means "legacy networking stack" as opposed to NET_LWIP which is the
 newest (and incompatible) stack). There probably was some mix-up
between CMD_NET and NET options.

The dependency on CMD_NET seems unnecessary as it seems perfectly fine
to run bdinfo without CMD_NET (build and run tested). So let's instead
make the dependency on NET || NET_LWIP.

Let's sync the unit test as well.

Fixes: 95744d2527cb ("cmd: bdinfo: enable -e when CONFIG_CMD_NET_LWIP=y")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
cmd/bdinfo.c
test/cmd/bdinfo.c

index 43f425c7609b64cbca54206c2af3088ab4a19a63..dc7c2c3c853c3f247427b4737c2702b4a57518bb 100644 (file)
@@ -152,7 +152,7 @@ static int bdinfo_print_all(struct bd_info *bd)
        bdinfo_print_num_l("relocaddr", gd->relocaddr);
        bdinfo_print_num_l("reloc off", gd->reloc_off);
        printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8);
-       if (IS_ENABLED(CONFIG_CMD_NET) || IS_ENABLED(CONFIG_CMD_NET_LWIP))
+       if (IS_ENABLED(CONFIG_NET) || IS_ENABLED(CONFIG_NET_LWIP))
                print_eth();
        bdinfo_print_num_l("fdt_blob", (ulong)map_to_sysmem(gd->fdt_blob));
        if (IS_ENABLED(CONFIG_VIDEO))
@@ -194,8 +194,8 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
                case 'a':
                        return bdinfo_print_all(bd);
                case 'e':
-                       if (!IS_ENABLED(CONFIG_CMD_NET) &&
-                           !IS_ENABLED(CONFIG_CMD_NET_LWIP))
+                       if (!IS_ENABLED(CONFIG_NET) &&
+                           !IS_ENABLED(CONFIG_NET_LWIP))
                                return CMD_RET_USAGE;
                        print_eth();
                        return CMD_RET_SUCCESS;
index 892f2e34d89f95f223872056a3c0e351af6bf2f6..c3a3519d16d4197a15984778329bad7b33252335 100644 (file)
@@ -172,7 +172,7 @@ static int bdinfo_test_all(struct unit_test_state *uts)
        ut_assertok(test_num_l(uts, "reloc off", gd->reloc_off));
        ut_assert_nextline("%-12s= %u-bit", "Build", (uint)sizeof(void *) * 8);
 
-       if (IS_ENABLED(CONFIG_CMD_NET))
+       if (IS_ENABLED(CONFIG_NET) || IS_ENABLED(CONFIG_NET_LWIP))
                ut_assertok(test_eth(uts));
 
        /*
@@ -348,7 +348,7 @@ static int bdinfo_test_eth(struct unit_test_state *uts)
        ut_assertok(run_commandf("bdinfo -e"));
        if (!CONFIG_IS_ENABLED(GETOPT))
                ut_assertok(bdinfo_test_all(uts));
-       else if (IS_ENABLED(CONFIG_CMD_NET))
+       else if (IS_ENABLED(CONFIG_NET) || IS_ENABLED(CONFIG_NET_LWIP))
                ut_assertok(test_eth(uts));
        ut_assert_console_end();