Most code defines constants for bit positions by means of "(1 << n)". The Linux kernel defines the BIT macro for this purpose, providing a uniform and more readable way to define these constants. This patch adds the BIT macro to linux/bitops.h, and removes its local definitions from davinci and ixp code.
Signed-off-by: Matthias Kaehlcke <matth...@kaehlcke.net> --- cpu/arm926ejs/davinci/cpu.c | 2 -- cpu/ixp/npe/include/IxOsalOsIxp400.h | 2 -- include/asm-arm/arch-ixp/ixp425.h | 2 -- include/linux/bitops.h | 1 + 4 files changed, 1 insertions(+), 6 deletions(-) diff --git a/cpu/arm926ejs/davinci/cpu.c b/cpu/arm926ejs/davinci/cpu.c index fc3551c..c274ddd 100644 --- a/cpu/arm926ejs/davinci/cpu.c +++ b/cpu/arm926ejs/davinci/cpu.c @@ -40,8 +40,6 @@ #define PLLC_PLLDIV8 0x170 #define PLLC_PLLDIV9 0x174 -#define BIT(x) (1 << (x)) - /* SOC-specific pll info */ #ifdef CONFIG_SOC_DM355 #define ARM_PLLDIV PLLC_PLLDIV1 diff --git a/cpu/ixp/npe/include/IxOsalOsIxp400.h b/cpu/ixp/npe/include/IxOsalOsIxp400.h index 44a94fb..5e09651 100644 --- a/cpu/ixp/npe/include/IxOsalOsIxp400.h +++ b/cpu/ixp/npe/include/IxOsalOsIxp400.h @@ -47,8 +47,6 @@ #ifndef IxOsalOsIxp400_H #define IxOsalOsIxp400_H -#define BIT(x) (1<<(x)) - #define IXP425_EthA_BASE 0xc8009000 #define IXP425_EthB_BASE 0xc800a000 diff --git a/include/asm-arm/arch-ixp/ixp425.h b/include/asm-arm/arch-ixp/ixp425.h index 2114437..689e1ac 100644 --- a/include/asm-arm/arch-ixp/ixp425.h +++ b/include/asm-arm/arch-ixp/ixp425.h @@ -14,8 +14,6 @@ #ifndef _ASM_ARM_IXP425_H_ #define _ASM_ARM_IXP425_H_ -#define BIT(x) (1<<(x)) - /* FIXME: Only this does work for u-boot... find out why... [RS] */ #define UBOOT_REG_FIX 1 #ifdef UBOOT_REG_FIX diff --git a/include/linux/bitops.h b/include/linux/bitops.h index e724310..c098c9a 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -104,6 +104,7 @@ static inline unsigned int generic_hweight8(unsigned int w) return (res & 0x0F) + ((res >> 4) & 0x0F); } +#define BIT(nr) (1UL << (nr)) #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) -- 1.6.5 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot