diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-10-18 23:40:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 11:53:42 -0700 |
commit | 7b19ada2ed3c1eccb9fe94d74b05e1428224663d (patch) | |
tree | a0c5975ce5236ff4023b92d431bd0a8fa321c6ce /drivers | |
parent | d05be13bcc6ec615fb2e9556a9b85d52800669b6 (diff) |
get rid of input BIT* duplicate defines
get rid of input BIT* duplicate defines
use newly global defined macros for input layer. Also remove includes of
input.h from non-input sources only for BIT macro definiton. Define the
macro temporarily in local manner, all those local definitons will be
removed further in this patchset (to not break bisecting).
BIT macro will be globally defined (1<<x)
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: <dtor@mail.ru>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Cc: <lenb@kernel.org>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Cc: <perex@suse.cz>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: <vernux@us.ibm.com>
Cc: <malattia@linux.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
102 files changed, 356 insertions, 278 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 2e79a3395ec..301e832e696 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -434,18 +434,18 @@ static int acpi_button_add(struct acpi_device *device) switch (button->type) { case ACPI_BUTTON_TYPE_POWER: case ACPI_BUTTON_TYPE_POWERF: - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_POWER, input->keybit); break; case ACPI_BUTTON_TYPE_SLEEP: case ACPI_BUTTON_TYPE_SLEEPF: - input->evbit[0] = BIT(EV_KEY); + input->evbit[0] = BIT_MASK(EV_KEY); set_bit(KEY_SLEEP, input->keybit); break; case ACPI_BUTTON_TYPE_LID: - input->evbit[0] = BIT(EV_SW); + input->evbit[0] = BIT_MASK(EV_SW); set_bit(SW_LID, input->swbit); break; } diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index d54f4a3ae34..fc54d234507 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -129,7 +129,7 @@ int shift_state = 0; */ static struct input_handler kbd_handler; -static unsigned long key_down[NBITS(KEY_MAX)]; /* keyboard key bitmap */ +static unsigned long key_down[BITS_TO_LONGS(KEY_CNT)]; /* keyboard key bitmap */ static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */ static int dead_key_next; static int npadch = -1; /* -1 or number assembled on pad */ @@ -1377,12 +1377,12 @@ static void kbd_start(struct input_handle *handle) static const struct input_device_id kbd_ids[] = { { .flags = INPUT_DEVICE_ID_MATCH_EVBIT, - .evbit = { BIT(EV_KEY) }, + .evbit = { BIT_MASK(EV_KEY) }, }, { .flags = INPUT_DEVICE_ID_MATCH_EVBIT, - .evbit = { BIT(EV_SND) }, + .evbit = { BIT_MASK(EV_SND) }, }, { }, /* Terminating entry */ diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 859858561ab..9782cb4d30d 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -1178,9 +1178,9 @@ static int __devinit sonypi_create_input_devices(void) jog_dev->id.bustype = BUS_ISA; jog_dev->id.vendor = PCI_VENDOR_ID_SONY; - jog_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - jog_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_MIDDLE); - jog_dev->relbit[0] = BIT(REL_WHEEL); + jog_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + jog_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_MIDDLE); + jog_dev->relbit[0] = BIT_MASK(REL_WHEEL); sonypi_device.input_key_dev = key_dev = input_allocate_device(); if (!key_dev) { @@ -1193,7 +1193,7 @@ static int __devinit sonypi_create_input_devices(void) key_dev->id.vendor = PCI_VENDOR_ID_SONY; /* Initialize the Input Drivers: special keys */ - key_dev->evbit[0] = BIT(EV_KEY); + key_dev->evbit[0] = BIT_MASK(EV_KEY); for (i = 0; sonypi_inputkeys[i].sonypiev; i++) if (sonypi_inputkeys[i].inputev) set_bit(sonypi_inputkeys[i].inputev, key_dev->keybit); diff --git a/drivers/firmware/dcdbas.h b/drivers/firmware/dcdbas.h index dcdba0f1b32..8960cad3d02 100644 --- a/drivers/firmware/dcdbas.h +++ b/drivers/firmware/dcdbas.h @@ -17,10 +17,11 @@ #define _DCDBAS_H_ #include <linux/device.h> -#include <linux/input.h> #include <linux/sysfs.h> #include <linux/types.h> +#define BIT(x) (1UL << x) + #define MAX_SMI_DATA_BUF_SIZE (256 * 1024) #define HC_ACTION_NONE (0) diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index b76b02f7b52..775a1ef28a2 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -274,8 +274,11 @@ static int usb_kbd_probe(struct usb_interface *iface, input_set_drvdata(input_dev, kbd); - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); - input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL) | BIT(LED_COMPOSE) | BIT(LED_KANA); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) | + BIT_MASK(EV_REP); + input_dev->ledbit[0] = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) | + BIT_MASK(LED_SCROLLL) | BIT_MASK(LED_COMPOSE) | + BIT_MASK(LED_KANA); for (i = 0; i < 255; i++) set_bit(usb_kbd_keycode[i], input_dev->keybit); diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 5345c73bcf6..f8ad6910d3d 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c @@ -173,11 +173,13 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i usb_to_input_id(dev, &input_dev->id); input_dev->dev.parent = &intf->dev; - input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); - input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); - input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y); - input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA); - input_dev->relbit[0] |= BIT(REL_WHEEL); + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) | + BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE); + input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y); + input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_SIDE) | + BIT_MASK(BTN_EXTRA); + input_dev->relbit[0] |= BIT_MASK(REL_WHEEL); input_set_drvdata(input_dev, mouse); diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index 4879125b4cd..1001d2e122a 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c @@ -1099,7 +1099,7 @@ static int applesmc_create_accelerometer(void) idev->name = "applesmc"; idev->id.bustype = BUS_HOST; idev->dev.parent = &pdev->dev; - idev->evbit[0] = BIT(EV_ABS); + idev->evbit[0] = BIT_MASK(EV_ABS); input_set_abs_params(idev, ABS_X, -256, 256, APPLESMC_INPUT_FUZZ, APPLESMC_INPUT_FLAT); input_set_abs_params(idev, ABS_Y, diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index 8a7ae03aeee..bab5fd2e4df 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c @@ -574,7 +574,7 @@ static int __init hdaps_init(void) idev = hdaps_idev->input; idev->name = "hdaps"; idev->dev.parent = &pdev->dev; - idev->evbit[0] = BIT(EV_ABS); + idev->evbit[0] = BIT_MASK(EV_ABS); input_set_abs_params(idev, ABS_X, -256, 256, HDAPS_INPUT_FUZZ, HDAPS_INPUT_FLAT); input_set_abs_params(idev, ABS_Y, diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 1d62c8b88e1..e5b4e9bfbdc 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -495,7 +495,7 @@ static unsigned int evdev_poll(struct file *file, poll_table *wait) #ifdef CONFIG_COMPAT #define BITS_PER_LONG_COMPAT (sizeof(compat_long_t) * 8) -#define NBITS_COMPAT(x) ((((x) - 1) / BITS_PER_LONG_COMPAT) + 1) +#define BITS_TO_LONGS_COMPAT(x) ((((x) - 1) / BITS_PER_LONG_COMPAT) + 1) #ifdef __BIG_ENDIAN static int bits_to_user(unsigned long *bits, unsigned int maxbit, @@ -504,7 +504,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, int len, i; if (compat) { - len = NBITS_COMPAT(maxbit) * sizeof(compat_long_t); + len = BITS_TO_LONGS_COMPAT(maxbit) * sizeof(compat_long_t); if (len > maxlen) len = maxlen; @@ -515,7 +515,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, sizeof(compat_long_t))) return -EFAULT; } else { - len = NBITS(maxbit) * sizeof(long); + len = BITS_TO_LONGS(maxbit) * sizeof(long); if (len > maxlen) len = maxlen; @@ -530,8 +530,8 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, unsigned int maxlen, void __user *p, int compat) { int len = compat ? - NBITS_COMPAT(maxbit) * sizeof(compat_long_t) : - NBITS(maxbit) * sizeof(long); + BITS_TO_LONGS_COMPAT(maxbit) * sizeof(compat_long_t) : + BITS_TO_LONGS(maxbit) * sizeof(long); if (len > maxlen) len = maxlen; @@ -545,7 +545,7 @@ static int bits_to_user(unsigned long *bits, unsigned int maxbit, static int bits_to_user(unsigned long *bits, unsigned int maxbit, unsigned int maxlen, void __user *p, int compat) { - int len = NBITS(maxbit) * sizeof(long); + int len = BITS_TO_LONGS(maxbit) * sizeof(long); if (len > maxlen) len = |