From: Wolfgang Denk Date: Tue, 04 Nov 2014 22:20:46 +0100 Subject: [U-Boot] Inconsistency between $filesize and commands which accept numeric params In-Reply-To: <20141104205800.GM15133@bill-the-cat> References: <1414677435.2064.34.camel@hellion.org.uk> <20141030152146.356D83809B0@gemini.denx.de> <1414683178.2064.51.camel@hellion.org.uk> <20141104154412.GI15133@bill-the-cat> <1415116135.11486.51.camel@hellion.org.uk> <20141104205302.495EE38334F@gemini.denx.de> <20141104205800.GM15133@bill-the-cat> Message-ID: <20141104212046.4989038334F@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 Tom, In message <20141104205800.GM15133@bill-the-cat> you wrote: > > > Well, we probably should not use this FDT centric decoding function > > directly on arguments passed from the U-Boot command line. > > No, look again at what we're doing. We're not calling a U-Boot function > to do U-Boot things. We're calling a U-Boot function to set a DT > property. U-Boot needs to obey DT conventions here. Well, we are running an U-Boot command. And U-Boot documentation says that we use hex inpout base (with the only unlucky exception of the sleep command). So this _command_ should also assume hex input. > I can see an argument that we could try and make the heuristics smarter > to add '0x' to obvious hex strings, but that'll just cause crazier > errors when 0x1000 is passed in and seen as 1000 decimal. Right. So before calling the fdt code, the U-Boot command should normalize the number. Hm.... is there a way to determine in advance where we are passing a number as argument [see "common/cmd_fdt.c" lines 260ff] ? 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 "What if" is a trademark of Hewlett Packard, so stop using it in your sentences without permission, or risk being sued.