From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Kagstrom Date: Thu, 17 Sep 2009 08:45:21 +0200 Subject: [U-Boot] [PATCH v4 3/4]: Define ffs/fls for all architectures In-Reply-To: <200909162119.03918.sr@denx.de> References: <20090824090605.37715546@marrow.netinsight.se> <20090824091012.0df5bbff@marrow.netinsight.se> <20090915203443.70008832E864@gemini.denx.de> <200909162119.03918.sr@denx.de> Message-ID: <20090917084521.4bfbb4e7@marrow.netinsight.se> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 16 Sep 2009 21:19:03 +0200 Stefan Roese wrote: > include/asm-ppc/bitops.h: > @@ -230,6 +231,7 @@ extern __inline__ int ffs(int x) > { > return __ilog2(x & -x) + 1; > } > +#define ffs > > So after "ffs()" is define as an inline function, you define it to nothing. I > understand that you need a flag for include/linux/bitops.h, to decide if the > platform version of this function should be used or the generic version: > > include/linux/bitops.h: > +#ifndef ffs > +# define ffs generic_ffs > +#endif > > But this only works for platforms which don't supply a platform specific ffs > function. Ah, of course... What did I think of? Time to wear a funny hat I guess... > One way to solve this would be something like this: > > include/asm-ppc/bitops.h: > @@ -230,6 +231,7 @@ extern __inline__ int ffs(int x) > { > return __ilog2(x & -x) + 1; > } > +#define PLATFORM_FFS > > include/linux/bitops.h: > +#ifndef PLATFORM_FFS > +# define ffs generic_ffs > +#endif Yes, the patch should have contained something like that. Well, we'll have to cook up a fix for this then. Sorry about that again. // Simon