From: Wolfgang Denk Date: Fri, 14 Oct 2011 23:32:58 +0200 Subject: [U-Boot] [Patch v4] powerpc/eeprom: cleanup mac command In-Reply-To: <1313076710-12662-1-git-send-email-yorksun@freescale.com> References: <1313076710-12662-1-git-send-email-yorksun@freescale.com> Message-ID: <20111014213258.1C5F714094B2@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear York Sun, In message <1313076710-12662-1-git-send-email-yorksun@freescale.com> you wrote: > Change the help message to be more helpful. Print argument format. > Fix MAX_NUM_PORTS to comply with v1 NXID format. Accept hexadecimal and > decimal for port count and index. ... > case 'p': /* MAC table size */ > - e.mac_count = simple_strtoul(argv[2], NULL, 16); > + e.mac_count = simple_strtoul(argv[2], NULL, 0); > update_crc(); > break; > - case '0' ... '9': /* "mac 0" through "mac 22" */ > - set_mac_address(simple_strtoul(argv[1], NULL, 10), argv[2]); > + case '0' ... '9': /* "mac 0" through "mac 31" */ > + set_mac_address(simple_strtoul(argv[1], NULL, 0), argv[2]); These changes silently change the behaviour of the command. So far, an argument line "24" would be parsed as hex number (i. e. result in decimal value 36); with this change it suddenly becomes devcimal 24, which is quite unexpected. There are very few exceptions wher eU-Boot uses and expects decimal numbers, and I strongly recommend not to add any new such inconsistencies. > +#ifdef CONFIG_SYS_I2C_EEPROM_NXID > + " - program the MAC address for port n [n=0...30]" 0...30 ? The code above says "mac 0" through "mac 31"? Or is it 0 ... 22 ? Best regards, Wolfgang Denk -- 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 Always try to do things in chronological order; it's less confusing that way.