From: Jiri Slaby Date: Fri, 19 Oct 2007 06:40:35 +0000 (-0700) Subject: define global BIT macro X-Git-Tag: v2.6.24-rc1~186 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93043ece030af58529e3e1367502461d265ab4e2;p=linux-2.6 define global BIT macro define global BIT macro move all local BIT defines to the new globally define macro. Signed-off-by: Jiri Slaby Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Kumar Gala Cc: Dmitry Torokhov Cc: Jeff Garzik Cc: James Bottomley Cc: "Antonino A. Daplas" Cc: Russell King Acked-by: Ralf Baechle Cc: "John W. Linville" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/ppc/platforms/chestnut.c b/arch/ppc/platforms/chestnut.c index 248684f50d..dcd6070b85 100644 --- a/arch/ppc/platforms/chestnut.c +++ b/arch/ppc/platforms/chestnut.c @@ -49,7 +49,6 @@ extern void gen550_progress(char *, unsigned short); extern void gen550_init(int, struct uart_port *); extern void mv64360_pcibios_fixup(mv64x60_handle_t *bh); -#define BIT(x) (1< #include -#define BIT(x) (1UL << x) - #define MAX_SMI_DATA_BUF_SIZE (256 * 1024) #define HC_ACTION_NONE (0) diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c index 5a41b8f7f8..558200e96d 100644 --- a/drivers/input/serio/maceps2.c +++ b/drivers/input/serio/maceps2.c @@ -31,8 +31,6 @@ MODULE_LICENSE("GPL"); #define MACE_PS2_TIMEOUT 10000 /* in 50us unit */ -#define BIT(x) (1UL << (x)) - #define PS2_STATUS_CLOCK_SIGNAL BIT(0) /* external clock signal */ #define PS2_STATUS_CLOCK_INHIBIT BIT(1) /* clken output signal */ #define PS2_STATUS_TX_INPROGRESS BIT(2) /* transmission in progress */ diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c index 243fc6b354..e3dd8b1369 100644 --- a/drivers/net/eth16i.c +++ b/drivers/net/eth16i.c @@ -170,7 +170,6 @@ static char *version = /* Few macros */ -#define BIT(a) ( (1 << (a)) ) #define BITSET(ioaddr, bnum) ((outb(((inb(ioaddr)) | (bnum)), ioaddr))) #define BITCLR(ioaddr, bnum) ((outb(((inb(ioaddr)) & (~(bnum))), ioaddr))) diff --git a/drivers/net/meth.h b/drivers/net/meth.h index ea3b8fc86d..a78dc1ca8c 100644 --- a/drivers/net/meth.h +++ b/drivers/net/meth.h @@ -28,9 +28,6 @@ #define RX_BUFFER_OFFSET (sizeof(rx_status_vector)+2) /* staus vector + 2 bytes of padding */ #define RX_BUCKET_SIZE 256 -#undef BIT -#define BIT(x) (1UL << (x)) - /* For more detailed explanations of what each field menas, see Nick's great comments to #defines below (or docs, if you are lucky enough toget hold of them :)*/ diff --git a/drivers/net/wireless/hostap/hostap_common.h b/drivers/net/wireless/hostap/hostap_common.h index ceb7f1e5e9..517f898451 100644 --- a/drivers/net/wireless/hostap/hostap_common.h +++ b/drivers/net/wireless/hostap/hostap_common.h @@ -4,9 +4,6 @@ #include #include -#define BIT(x) (1 << (x)) - - /* IEEE 802.11 defines */ /* Information Element IDs */ diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c index a7f916c0c9..cf549ffe4b 100644 --- a/drivers/scsi/FlashPoint.c +++ b/drivers/scsi/FlashPoint.c @@ -25,7 +25,6 @@ #define FAILURE 0xFFFFFFFFL -#define BIT(x) ((unsigned char)(1<<(x))) /* single-bit mask in bit position x */ #define BITW(x) ((unsigned short)(1<<(x))) /* single-bit mask in bit position x */ struct sccb; diff --git a/drivers/scsi/nsp32.h b/drivers/scsi/nsp32.h index a976e8193d..6715ecb3bf 100644 --- a/drivers/scsi/nsp32.h +++ b/drivers/scsi/nsp32.h @@ -68,11 +68,6 @@ static char * nsp32_model[] = { typedef u32 u32_le; typedef u16 u16_le; -/* - * MACRO - */ -#define BIT(x) (1UL << (x)) - /* * BASIC Definitions */ diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index b7f0fa2464..98397559c5 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h @@ -24,7 +24,6 @@ /************************************ * Some useful macros... */ -#define BIT(x) (1L << (x)) /* SCSI initiator must be ID 7 */ #define NSP_INITIATOR_ID 7 diff --git a/drivers/video/pnx4008/sdum.h b/drivers/video/pnx4008/sdum.h index e8c5dcdd88..189c3d6413 100644 --- a/drivers/video/pnx4008/sdum.h +++ b/drivers/video/pnx4008/sdum.h @@ -77,9 +77,6 @@ #define CONF_DIRTYDETECTION_OFF (0x600) #define CONF_DIRTYDETECTION_ON (0x601) -/* Set the corresponding bit. */ -#define BIT(n) (0x1U << (n)) - struct dumchannel_uf { int channelnr; u32 *dirty; diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index c72f9d7941..eeeea90cd5 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h @@ -17,9 +17,6 @@ #define IO_SPACE_LIMIT 0xffff0000 -#define BIT(x) ((1)<<(x)) - - extern int (*ixp4xx_pci_read)(u32 addr, u32 cmd, u32* data); extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data); diff --git a/include/asm-mips/ip32/crime.h b/include/asm-mips/ip32/crime.h index a13702fafa..7c36b0e5b1 100644 --- a/include/asm-mips/ip32/crime.h +++ b/include/asm-mips/ip32/crime.h @@ -17,9 +17,6 @@ */ #define CRIME_BASE 0x14000000 /* physical */ -#undef BIT -#define BIT(x) (1UL << (x)) - struct sgi_crime { volatile unsigned long id; #define CRIME_ID_MASK 0xff diff --git a/include/asm-mips/ip32/mace.h b/include/asm-mips/ip32/mace.h index 990082c81f..d08d7c6721 100644 --- a/include/asm-mips/ip32/mace.h +++ b/include/asm-mips/ip32/mace.h @@ -17,9 +17,6 @@ */ #define MACE_BASE 0x1f000000 /* physical */ -#undef BIT -#define BIT(x) (1UL << (x)) - /* * PCI interface */ diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 939e80bdbe..7fc90d7cd0 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -3,6 +3,7 @@ #include #ifdef __KERNEL__ +#define BIT(nr) (1UL << (nr)) #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define BITS_TO_TYPE(nr, t) (((nr)+(t)-1)/(t)) diff --git a/include/video/sstfb.h b/include/video/sstfb.h index baa163f770..b52f073812 100644 --- a/include/video/sstfb.h +++ b/include/video/sstfb.h @@ -68,7 +68,6 @@ # define print_var(X,Y...) #endif -#define BIT(x) (1ul<<(x)) #define POW2(x) (1ul<<(x)) /* diff --git a/include/video/tdfx.h b/include/video/tdfx.h index 05b63c2a5a..7431d9681e 100644 --- a/include/video/tdfx.h +++ b/include/video/tdfx.h @@ -79,8 +79,6 @@ /* register bitfields (not all, only as needed) */ -#define BIT(x) (1UL << (x)) - /* COMMAND_2D reg. values */ #define TDFX_ROP_COPY 0xcc /* src */ #define TDFX_ROP_INVERT 0x55 /* NOT dst */ diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index d34a9deca6..4b4ed2a580 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -37,8 +37,6 @@ struct ieee80211_local; -#define BIT(x) (1 << (x)) - #define IEEE80211_ALIGN32_PAD(a) ((4 - ((a) & 3)) & 3) /* Maximum number of broadcast/multicast frames to buffer when some of the