bdinfo: Don't print IP or MAC addresses on boards without network support
PATCH 1/1 bdinfo: Don't print IP or MAC addresses on boards without network support
--- common/cmd_bdinfo.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
common/cmd_bdinfo.c +8 -0
@@ -93,6 +93,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])print_str ("pevfreq" ,strmhz (buf, bd->bi_pevfreq));#endif +#ifdef CONFIG_CMD_NET print_eth (0 );#if defined(CONFIG_HAS_ETH1 )print_eth (1 );
@@ -114,6 +115,7 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])print_str ("ethspeed" ,strmhz (buf, bd->bi_ethspeed));#endif printf ("IP addr = %pI4\n" , &bd->bi_ip_addr); +#endif /* CONFIG_CMD_NET */ printf ("baudrate = %6ld bps\n" , bd->bi_baudrate );return 0 ; }
@@ -130,8 +132,10 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])print_num ("flashsize" , (ulong )bd->bi_flashsize);print_num ("flashoffset" , (ulong )bd->bi_flashoffset); +#ifdef CONFIG_CMD_NET print_eth (0 );printf ("ip_addr = %pI4\n" , &bd->bi_ip_addr); +#endif printf ("baudrate = %ld bps\n" , bd->bi_baudrate);return 0 ;
@@ -288,8 +292,10 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])print_num ("flashsize" , (ulong )bd->bi_flashsize);print_num ("flashoffset" , (ulong )bd->bi_flashoffset); +#ifdef CONFIG_CMD_NET print_eth (0 );printf ("ip_addr = %pI4\n" , &bd->bi_ip_addr); +#endif printf ("baudrate = %d bps\n" , bd->bi_baudrate);return 0 ;
@@ -308,8 +314,10 @@ int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])print_num ("flashsize" , (ulong )bd->bi_flashsize);print_num ("flashoffset" , (ulong )bd->bi_flashoffset); +#ifdef CONFIG_CMD_NET print_eth (0 );printf ("ip_addr = %pI4\n" , &bd->bi_ip_addr); +#endif printf ("baudrate = %d bps\n" , bd->bi_baudrate);return 0 ;
Signature · 1 line
1.6.6.rc4
PATCH 1/1 bdinfo: Don't print IP or MAC addresses on boards without network support
Dear Stefan Roese,
Quoted 4 lines · In message <[email protected]> you wrote:
Signed-off-by Stefan Roese <[email protected]>--- common/cmd_bdinfo.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
I don't consider this a good idea.
Please keep in mind that the "bdinfo" command is (or rather was) mainly intended for (old) PPC boards that pass hardware information to the Linux kernel by means of struct bd_info.
Even if you comment out printing of network related fields, these are still being passed to the kernel on such systems, so we should rather
1) make sure they are properly initialized in all cases (with well-defined dummy-values if no other values are present),
2) keep printing all fields actually passed to the Linux kernel, and in the right order, as was the intention of this command.
Also, I disagree with this change as you are exporting U-Boot settings to Linux, which is IMHO not always correct. There might be cases where you don't have network support in U-Boot, but the Linux kernel might have it, and you want to pass network configuration parameters even if they are unused in U-Boot (consider for example the case where U-Boot has no network driver yet).
Thinking about this again, I tend to reject _both_ your patches.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Anyone can count the seeds in an apple. No one can count the apples in a seed.