From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Thu, 17 Sep 2009 14:00:44 +0200 Subject: [U-Boot] fls definition issue In-Reply-To: <73839B4A0818E747864426270AC332C30451381F@zmy16exm20.fsl.freescale.net> References: <73839B4A0818E747864426270AC332C30451381F@zmy16exm20.fsl.freescale.net> Message-ID: <200909171400.44848.sr@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 On Thursday 17 September 2009 13:47:58 Hu Mingkai-B21284 wrote: > I traced the code and found the variable law_sz_enc got an > error value when call __ilog2_u64 in the function set_ddr_laws. > > The inline function __ilog2_u64 will call fls inline function > finally, but the fls is defined as a variable by the commit > 52d61227b66d4099b39c8309ab37cb67ee09a405 in the platform specific > bitops.h file. > > include/asm-ppc/bitops.h: > static __inline__ int fls(unsigned int x) > { > return __ilog2(x) + 1; > } > #define fls > > So when called fls, which one will be used? > From the experiments, I got the latter called, but I don't find > the root reason, any clues? This problem is already known, and Simon (on Cc) is currently working on a patch to fix it. Should be ready this afternoon... Cheers, Stefan -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de