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 <command-line>: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 <command-line>: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 <command-line>: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 <lrodriguez@atheros.com>
#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