From: Luis R. Rodriguez Date: Tue, 12 Jan 2010 00:24:09 +0000 (-0800) Subject: Only define BITS_TO_LONGS if not defined X-Git-Tag: next-20100113~16 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=cd96ca22f449eaea5c5d5ab11433b4ae98906d38;p=~emulex%2Ftmp%2Fcompat%2F.git Only define BITS_TO_LONGS if not defined This removes this nagging complaint on older kernels: CC [M] /home/mcgrof/compat/compat/compat-2.6.32.o In file included from include/asm-i386/cpufeature.h:11, from include/asm/cpufeature.h:10, from include/asm/alternative.h:43, from include/asm/atomic.h:4, from /home/mcgrof/compat/include/linux/compat-2.6.24.h:10, from /home/mcgrof/compat/include/linux/compat-2.6.h:15, from :0: /home/mcgrof/compat/include/linux/bitops.h:10:1: warning: "BITS_TO_LONGS" redefined In file included from include/asm/alternative.h:6, from include/asm/atomic.h:4, from /home/mcgrof/compat/include/linux/compat-2.6.24.h:10, from /home/mcgrof/compat/include/linux/compat-2.6.h:15, from :0: include/linux/types.h:6:1: warning: this is the location of the previous definition In file included from include/asm-i386/cpufeature.h:11, from include/asm/cpufeature.h:10, from include/asm/alternative.h:43, from include/asm/atomic.h:4, from /home/mcgrof/compat/include/linux/compat-2.6.24.h:10, from /home/mcgrof/compat/include/linux/compat-2.6.h:15, from :0: Note that this means we'll have to keep include/linux/bitops.h up to date on our tree now. Shouldn't be an issue but just worth noting. Signed-off-by: Luis R. Rodriguez --- diff --git a/include/linux/bitops.h b/include/linux/bitops.h index c05a29c..8469d35 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -7,8 +7,10 @@ #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define BITS_PER_BYTE 8 +#ifndef BITS_TO_LONGS /* Older kernels define this already */ #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) #endif +#endif /* * Include this here because some architectures need generic_ffs/fls in