]> err.no Git - linux-2.6/commitdiff
get rid of input BIT* duplicate defines
authorJiri Slaby <jirislaby@gmail.com>
Fri, 19 Oct 2007 06:40:32 +0000 (23:40 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 19 Oct 2007 18:53:42 +0000 (11:53 -0700)
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>
110 files changed:
Documentation/input/input-programming.txt
drivers/acpi/button.c
drivers/char/keyboard.c
drivers/char/sonypi.c
drivers/firmware/dcdbas.h
drivers/hid/usbhid/usbkbd.c
drivers/hid/usbhid/usbmouse.c
drivers/hwmon/applesmc.c
drivers/hwmon/hdaps.c
drivers/input/evdev.c
drivers/input/input.c
drivers/input/joydev.c
drivers/input/joystick/a3d.c
drivers/input/joystick/adi.c
drivers/input/joystick/amijoy.c
drivers/input/joystick/analog.c
drivers/input/joystick/cobra.c
drivers/input/joystick/db9.c
drivers/input/joystick/gamecon.c
drivers/input/joystick/gf2k.c
drivers/input/joystick/grip.c
drivers/input/joystick/grip_mp.c
drivers/input/joystick/guillemot.c
drivers/input/joystick/iforce/iforce-main.c
drivers/input/joystick/iforce/iforce.h
drivers/input/joystick/interact.c
drivers/input/joystick/magellan.c
drivers/input/joystick/sidewinder.c
drivers/input/joystick/spaceball.c
drivers/input/joystick/spaceorb.c
drivers/input/joystick/stinger.c
drivers/input/joystick/tmdc.c
drivers/input/joystick/turbografx.c
drivers/input/joystick/twidjoy.c
drivers/input/joystick/warrior.c
drivers/input/joystick/xpad.c
drivers/input/keyboard/aaed2000_kbd.c
drivers/input/keyboard/amikbd.c
drivers/input/keyboard/atakbd.c
drivers/input/keyboard/atkbd.c
drivers/input/keyboard/corgikbd.c
drivers/input/keyboard/gpio_keys.c
drivers/input/keyboard/hil_kbd.c
drivers/input/keyboard/hilkbd.c
drivers/input/keyboard/locomokbd.c
drivers/input/keyboard/newtonkbd.c
drivers/input/keyboard/pxa27x_keyboard.c
drivers/input/keyboard/spitzkbd.c
drivers/input/keyboard/stowaway.c
drivers/input/keyboard/sunkbd.c
drivers/input/keyboard/xtkbd.c
drivers/input/misc/ati_remote.c
drivers/input/misc/ati_remote2.c
drivers/input/misc/atlas_btns.c
drivers/input/misc/cobalt_btns.c
drivers/input/misc/ixp4xx-beeper.c
drivers/input/misc/keyspan_remote.c
drivers/input/misc/m68kspkr.c
drivers/input/misc/pcspkr.c
drivers/input/misc/powermate.c
drivers/input/misc/sparcspkr.c
drivers/input/misc/yealink.c
drivers/input/mouse/alps.c
drivers/input/mouse/amimouse.c
drivers/input/mouse/atarimouse.c
drivers/input/mouse/hil_ptr.c
drivers/input/mouse/inport.c
drivers/input/mouse/lifebook.c
drivers/input/mouse/logibm.c
drivers/input/mouse/pc110pad.c
drivers/input/mouse/psmouse-base.c
drivers/input/mouse/rpcmouse.c
drivers/input/mouse/sermouse.c
drivers/input/mouse/touchkit_ps2.c
drivers/input/mousedev.c
drivers/input/serio/maceps2.c
drivers/input/tablet/acecad.c
drivers/input/tablet/gtco.c
drivers/input/tablet/kbtab.c
drivers/input/tablet/wacom_sys.c
drivers/input/touchscreen/ads7846.c
drivers/input/touchscreen/corgi_ts.c
drivers/input/touchscreen/elo.c
drivers/input/touchscreen/fujitsu_ts.c
drivers/input/touchscreen/gunze.c
drivers/input/touchscreen/h3600_ts_input.c
drivers/input/touchscreen/hp680_ts_input.c
drivers/input/touchscreen/mk712.c
drivers/input/touchscreen/mtouch.c
drivers/input/touchscreen/penmount.c
drivers/input/touchscreen/touchright.c
drivers/input/touchscreen/touchwin.c
drivers/input/touchscreen/ucb1400_ts.c
drivers/input/touchscreen/usbtouchscreen.c
drivers/macintosh/adbhid.c
drivers/macintosh/mac_hid.c
drivers/media/dvb/cinergyT2/cinergyT2.c
drivers/media/dvb/dvb-usb/dvb-usb-remote.c
drivers/media/dvb/ttusb-dec/ttusb_dec.c
drivers/media/video/usbvideo/konicawc.c
drivers/media/video/usbvideo/quickcam_messenger.c
drivers/misc/ibmasm/remote.c
drivers/misc/sony-laptop.c
include/linux/hid.h
include/linux/input.h
include/linux/uinput.h
net/bluetooth/hidp/core.c
net/rfkill/rfkill-input.c
sound/ppc/beep.c
sound/usb/caiaq/caiaq-input.c

index d9d523099bb7d69d3dd3e4124167e5dd9bad1fc4..4d932dc660982d34fe488a2e9d8f10957a4d030b 100644 (file)
@@ -42,8 +42,8 @@ static int __init button_init(void)
                goto err_free_irq;
        }
 
-       button_dev->evbit[0] = BIT(EV_KEY);
-       button_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
+       button_dev->evbit[0] = BIT_MASK(EV_KEY);
+       button_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
 
        error = input_register_device(button_dev);
        if (error) {
@@ -217,14 +217,15 @@ If you don't need absfuzz and absflat, you can set them to zero, which mean
 that the thing is precise and always returns to exactly the center position
 (if it has any).
 
-1.4 NBITS(), LONG(), BIT()
+1.4 BITS_TO_LONGS(), BIT_WORD(), BIT_MASK()
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-These three macros from input.h help some bitfield computations:
+These three macros from bitops.h help some bitfield computations:
 
-       NBITS(x) - returns the length of a bitfield array in longs for x bits
-       LONG(x)  - returns the index in the array in longs for bit x
-       BIT(x)   - returns the index in a long for bit x
+       BITS_TO_LONGS(x) - returns the length of a bitfield array in longs for
+                          x bits
+       BIT_WORD(x)      - returns the index in the array in longs for bit x
+       BIT_MASK(x)      - returns the index in a long for bit x
 
 1.5 The id* and name fields
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
index 2e79a3395ecffca8641cc02e64b616ef88be5ba6..301e832e6961290912396f92fd54244f30b5ba7f 100644 (file)
@@ -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;
        }
index d54f4a3ae340ddb93e82b6aa98828eb1d6f7cc58..fc54d234507ace68d0470122f8c3dba967b977e5 100644 (file)
@@ -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 */
index 859858561ab6705e5f398117dc5e83e8866df77c..9782cb4d30dcaedbd0e5405dfc657c111b33c49b 100644 (file)
@@ -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);
index dcdba0f1b32c835cdcd37d0d2cb975442ab31348..8960cad3d022e5c39731bc523e7e0f43cf250b9f 100644 (file)
 #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)
index b76b02f7b52de04a11e17d2a17e0e80b850d9922..775a1ef28a297fc3035f484845917b55ba6c5b29 100644 (file)
@@ -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);
index 5345c73bcf622a2918df1982ba24749e2dfd0c68..f8ad6910d3d920ccec4f8cf66dcd6b737cbf958f 100644 (file)
@@ -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);
 
index 4879125b4cdc1963534928181aed8088a30f3900..1001d2e122a262eafa72bb80857260bcc1659472 100644 (file)
@@ -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,
index 8a7ae03aeee4e5aa1adb629ce77055b10c2a1f77..bab5fd2e4dfdafd4442fa13bdd90f3a3f2022d39 100644 (file)
@@ -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,
index 1d62c8b88e121307427a491a204a023c9510c3d5..e5b4e9bfbdc5b044b968a70579f13eea513a12c6 100644 (file)
@@ -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 = maxlen;
index 2f2b020cd6294109da6e757e2968c12bca97aaef..307c7b5c2b33a59fa33825523cca639af4f4ccd2 100644 (file)
@@ -584,10 +584,10 @@ static int input_default_setkeycode(struct input_dev *dev,
 
 
 #define MATCH_BIT(bit, max) \
-               for (i = 0; i < NBITS(max); i++) \
+               for (i = 0; i < BITS_TO_LONGS(max); i++) \
                        if ((id->bit[i] & dev->bit[i]) != id->bit[i]) \
                                break; \
-               if (i != NBITS(max)) \
+               if (i != BITS_TO_LONGS(max)) \
                        continue;
 
 static const struct input_device_id *input_match_device(const struct input_device_id *id,
@@ -698,7 +698,7 @@ static void input_seq_print_bitmap(struct seq_file *seq, const char *name,
 {
        int i;
 
-       for (i = NBITS(max) - 1; i > 0; i--)
+       for (i = BITS_TO_LONGS(max) - 1; i > 0; i--)
                if (bitmap[i])
                        break;
 
@@ -892,7 +892,7 @@ static int input_print_modalias_bits(char *buf, int size,
 
        len += snprintf(buf, max(size, 0), "%c", name);
        for (i = min_bit; i < max_bit; i++)
-               if (bm[LONG(i)] & BIT(i))
+               if (bm[BIT_WORD(i)] & BIT_MASK(i))
                        len += snprintf(buf + len, max(size - len, 0), "%X,", i);
        return len;
 }
@@ -991,7 +991,7 @@ static int input_print_bitmap(char *buf, int buf_size, unsigned long *bitmap,
        int i;
        int len = 0;
 
-       for (i = NBITS(max) - 1; i > 0; i--)
+       for (i = BITS_TO_LONGS(max) - 1; i > 0; i--)
                if (bitmap[i])
                        break;
 
index 2b201f9aa02405fce891b9aee53c757307609a28..22b2789ef58ad17e30299f5fcbc7f5587d11dba9 100644 (file)
@@ -844,8 +844,8 @@ static const struct input_device_id joydev_blacklist[] = {
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_KEYBIT,
-               .evbit = { BIT(EV_KEY) },
-               .keybit = { [LONG(BTN_TOUCH)] = BIT(BTN_TOUCH) },
+               .evbit = { BIT_MASK(EV_KEY) },
+               .keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) },
        },      /* Avoid itouchpads, touchscreens and tablets */
        { }     /* Terminating entry */
 };
@@ -854,20 +854,20 @@ static const struct input_device_id joydev_ids[] = {
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_ABSBIT,
-               .evbit = { BIT(EV_ABS) },
-               .absbit = { BIT(ABS_X) },
+               .evbit = { BIT_MASK(EV_ABS) },
+               .absbit = { BIT_MASK(ABS_X) },
        },
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_ABSBIT,
-               .evbit = { BIT(EV_ABS) },
-               .absbit = { BIT(ABS_WHEEL) },
+               .evbit = { BIT_MASK(EV_ABS) },
+               .absbit = { BIT_MASK(ABS_WHEEL) },
        },
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_ABSBIT,
-               .evbit = { BIT(EV_ABS) },
-               .absbit = { BIT(ABS_THROTTLE) },
+               .evbit = { BIT_MASK(EV_ABS) },
+               .absbit = { BIT_MASK(ABS_THROTTLE) },
        },
        { }     /* Terminating entry */
 };
index ff701ab10d74f71e0ffcee5f953fc2428d3ef817..52ba16f487c793a36acc464dc4c0e3cc80e77fbc 100644 (file)
@@ -326,14 +326,19 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)
 
                a3d->length = 33;
 
-               input_dev->evbit[0] |= BIT(EV_ABS) | BIT(EV_KEY) | BIT(EV_REL);
-               input_dev->relbit[0] |= BIT(REL_X) | BIT(REL_Y);
-               input_dev->absbit[0] |= BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_THROTTLE) | BIT(ABS_RUDDER)
-                                       | BIT(ABS_HAT0X) | BIT(ABS_HAT0Y) | BIT(ABS_HAT1X) | BIT(ABS_HAT1Y);
-               input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE)
-                                                       | BIT(BTN_SIDE) | BIT(BTN_EXTRA);
-               input_dev->keybit[LONG(BTN_JOYSTICK)] |= BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP)
-                                                       | BIT(BTN_PINKIE);
+               input_dev->evbit[0] |= BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY) |
+                       BIT_MASK(EV_REL);
+               input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
+               input_dev->absbit[0] |= BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) |
+                       BIT_MASK(ABS_THROTTLE) | BIT_MASK(ABS_RUDDER) |
+                       BIT_MASK(ABS_HAT0X) | BIT_MASK(ABS_HAT0Y) |
+                       BIT_MASK(ABS_HAT1X) | BIT_MASK(ABS_HAT1Y);
+               input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) |
+                       BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) |
+                       BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA);
+               input_dev->keybit[BIT_WORD(BTN_JOYSTICK)] |=
+                       BIT_MASK(BTN_TRIGGER) | BIT_MASK(BTN_THUMB) |
+                       BIT_MASK(BTN_TOP) | BIT_MASK(BTN_PINKIE);
 
                a3d_read(a3d, data);
 
@@ -348,9 +353,10 @@ static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)
        } else {
                a3d->length = 29;
 
-               input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_REL);
-               input_dev->relbit[0] |= BIT(REL_X) | BIT(REL_Y);
-               input_dev->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_RIGHT) | BIT(BTN_LEFT) | BIT(BTN_MIDDLE);
+               input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+               input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
+               input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) |
+                       BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE);
 
                a3d_read(a3d, data);
 
index 28140c4a110df399c713d7ad337dfd177885455e..d1ca8a14950f62f914e9d4f9f81ae34a7eabadfe 100644 (file)
@@ -431,7 +431,7 @@ static int adi_init_input(struct adi *adi, struct adi_port *port, int half)
        input_dev->open = adi_open;
        input_dev->close = adi_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad != -1)) * 2; i++)
                set_bit(adi->abs[i], input_dev->absbit);
index b0f5541ec3e6849725955c655cbb4c5ea1f6559c..5cf9f3610e67f3924b4a8eb71fcc9d9156b93bb3 100644 (file)
@@ -137,9 +137,10 @@ static int __init amijoy_init(void)
                amijoy_dev[i]->open = amijoy_open;
                amijoy_dev[i]->close = amijoy_close;
 
-               amijoy_dev[i]->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-               amijoy_dev[i]->absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
-               amijoy_dev[i]->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
+               amijoy_dev[i]->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+               amijoy_dev[i]->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
+               amijoy_dev[i]->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+                       BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
                for (j = 0; j < 2; j++) {
                        amijoy_dev[i]->absmin[ABS_X + j] = -1;
                        amijoy_dev[i]->absmax[ABS_X + j] = 1;
index bdd157c1ebf8929b763a9d56815ce209c5d906f2..15739880afc6af31829f8a3058c701efa0976207 100644 (file)
@@ -456,7 +456,7 @@ static int analog_init_device(struct analog_port *port, struct analog *analog, i
        input_dev->open = analog_open;
        input_dev->close = analog_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = j = 0; i < 4; i++)
                if (analog->mask & (1 << i)) {
index d3352a849b85f592b08df3140af53c0b594c0366..55646a6d89f586de8f35616a947b41c84bd854c2 100644 (file)
@@ -218,7 +218,7 @@ static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)
                input_dev->open = cobra_open;
                input_dev->close = cobra_close;
 
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
                input_set_abs_params(input_dev, ABS_X, -1, 1, 0, 0);
                input_set_abs_params(input_dev, ABS_Y, -1, 1, 0, 0);
                for (j = 0; cobra_btn[j]; j++)
index b069ee18e35312078ec3cff1d6910d102dd851a7..27fc475bd3a19166eb42bcef23d09a0faa24b6f9 100644 (file)
@@ -631,7 +631,7 @@ static struct db9 __init *db9_probe(int parport, int mode)
                input_dev->open = db9_open;
                input_dev->close = db9_close;
 
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
                for (j = 0; j < db9_mode->n_buttons; j++)
                        set_bit(db9_mode->buttons[j], input_dev->keybit);
                for (j = 0; j < db9_mode->n_axis; j++) {
index 1a452e0e5f25788e37c972998912245747ec1657..df2a9d02ca6c1f32d8bf31fc24270883f912aa17 100644 (file)
@@ -653,12 +653,12 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
        input_dev->close = gc_close;
 
        if (pad_type != GC_SNESMOUSE) {
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
                for (i = 0; i < 2; i++)
                        input_set_abs_params(input_dev, ABS_X + i, -1, 1, 0, 0);
        } else
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
 
        gc->pads[0] |= gc_status_bit[idx];
        gc->pads[pad_type] |= gc_status_bit[idx];
index d514aebf75541fc871b56b510f1c4410bef2990c..1f6302c0eb3fd8e47c5f8e5a5edfdd95836d5fe8 100644 (file)
@@ -315,7 +315,7 @@ static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv)
        input_dev->open = gf2k_open;
        input_dev->close = gf2k_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = 0; i < gf2k_axes[gf2k->id]; i++)
                set_bit(gf2k_abs[i], input_dev->absbit);
index 73eb5ab6f140caa4bc8b9dd5eb34346335f1b1c2..fd3853ab1aad4db5499cea82c62872d720c16edc 100644 (file)
@@ -370,7 +370,7 @@ static int grip_connect(struct gameport *gameport, struct gameport_driver *drv)
                input_dev->open = grip_open;
                input_dev->close = grip_close;
 
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
                for (j = 0; (t = grip_abs[grip->mode[i]][j]) >= 0; j++) {
 
index 4ed3a3eadf1964eaad388e4f603720910e675811..c57e21d68c003e2970949744120b3384b8fe98e6 100644 (file)
@@ -606,7 +606,7 @@ static int register_slot(int slot, struct grip_mp *grip)
        input_dev->open = grip_open;
        input_dev->close = grip_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (j = 0; (t = grip_abs[port->mode][j]) >= 0; j++)
                input_set_abs_params(input_dev, t, -1, 1, 0, 0);
index d4e8073caf27a98a603a33a9eb0323f7e300701d..aa6bfb3fb8cd2b135201e97b7ee7dc99d6263660 100644 (file)
@@ -238,7 +238,7 @@ static int guillemot_connect(struct gameport *gameport, struct gameport_driver *
        input_dev->open = guillemot_open;
        input_dev->close = guillemot_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = 0; (t = guillemot->type->abs[i]) >= 0; i++)
                input_set_abs_params(input_dev, t, 0, 255, 0, 0);
index 682244b1c0422610e9475020d83f67cb7fff51e4..6f826b37d9aa6274e470ed07493e42c2f95bcf8a 100644 (file)
@@ -389,7 +389,8 @@ int iforce_init_device(struct iforce *iforce)
  * Set input device bitfields and ranges.
  */
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_FF_STATUS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) |
+               BIT_MASK(EV_FF_STATUS);
 
        for (i = 0; iforce->type->btn[i] >= 0; i++)
                set_bit(iforce->type->btn[i], input_dev->keybit);
index 40a853ac21c795c2e3db467be967f203a91f1d0b..a964a7cfd210cdc29b4fac6fcd9ee4c2c230d60b 100644 (file)
 #define FF_CORE_IS_PLAYED      3       /* Effect is currently being played */
 #define FF_CORE_SHOULD_PLAY    4       /* User wants the effect to be played */
 #define FF_CORE_UPDATE         5       /* Effect is being updated */
-#define FF_MODCORE_MAX         5
+#define FF_MODCORE_CNT         6
 
 struct iforce_core_effect {
        /* Information about where modifiers are stored in the device's memory */
        struct resource mod1_chunk;
        struct resource mod2_chunk;
-       unsigned long flags[NBITS(FF_MODCORE_MAX)];
+       unsigned long flags[BITS_TO_LONGS(FF_MODCORE_CNT)];
 };
 
 #define FF_CMD_EFFECT          0x010e
index 1aec1e9d7c5942f2b58d090778a08516ccee79b4..bc8ea95dfd0e8328736097ec4b1b132256d978ca 100644 (file)
@@ -269,7 +269,7 @@ static int interact_connect(struct gameport *gameport, struct gameport_driver *d
        input_dev->open = interact_open;
        input_dev->close = interact_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = 0; (t = interact_type[interact->type].abs[i]) >= 0; i++) {
                set_bit(t, input_dev->absbit);
index b35604ee43aecd4318a4fb126a4c0d40a9db7279..54e676948ebb1caa777dee0195f942fb876478e3 100644 (file)
@@ -170,7 +170,7 @@ static int magellan_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = 0; i < 9; i++)
                set_bit(magellan_buttons[i], input_dev->keybit);
index 2adf73f63c94dd7898d7ef1091a4c5842bb832c4..7b4865fdee54cdcf48998cff18dc7bdd4316a9c0 100644 (file)
@@ -758,7 +758,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
                input_dev->open = sw_open;
                input_dev->close = sw_close;
 
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
                for (j = 0; (bits = sw_bit[sw->type][j]); j++) {
                        code = sw_abs[sw->type][j];
index abb7c4cf54ad50d07fe3bcff57d7eceea86f18d4..d4087fd496563367bea2c7894c1e4a71c8477853 100644 (file)
@@ -228,18 +228,23 @@ static int spaceball_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        switch (id) {
                case SPACEBALL_4000FLX:
                case SPACEBALL_4000FLX_L:
-                       input_dev->keybit[LONG(BTN_0)] |= BIT(BTN_9);
-                       input_dev->keybit[LONG(BTN_A)] |= BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_MODE);
+                       input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_9);
+                       input_dev->keybit[BIT_WORD(BTN_A)] |= BIT_MASK(BTN_A) |
+                               BIT_MASK(BTN_B) | BIT_MASK(BTN_C) |
+                               BIT_MASK(BTN_MODE);
                default:
-                       input_dev->keybit[LONG(BTN_0)] |= BIT(BTN_2) | BIT(BTN_3) | BIT(BTN_4)
-                               | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7) | BIT(BTN_8);
+                       input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_2) |
+                               BIT_MASK(BTN_3) | BIT_MASK(BTN_4) |
+                               BIT_MASK(BTN_5) | BIT_MASK(BTN_6) |
+                               BIT_MASK(BTN_7) | BIT_MASK(BTN_8);
                case SPACEBALL_3003C:
-                       input_dev->keybit[LONG(BTN_0)] |= BIT(BTN_1) | BIT(BTN_8);
+                       input_dev->keybit[BIT_WORD(BTN_0)] |= BIT_MASK(BTN_1) |
+                               BIT_MASK(BTN_8);
        }
 
        for (i = 0; i < 3; i++) {
index c4937f1e837c192dd41ab252d933ac81308e8e4b..f7ce4004f4ba1baf036766e5af0f90d7ef14c8e1 100644 (file)
@@ -185,7 +185,7 @@ static int spaceorb_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = 0; i < 6; i++)
                set_bit(spaceorb_buttons[i], input_dev->keybit);
index 8581ee991d4e8e90cff96d8dee1fcfc3f038855d..baa10b2f7ba1c74843b8d8bbf2060e3649b045f7 100644 (file)
@@ -156,10 +156,11 @@ static int stinger_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_A)] = BIT(BTN_A) | BIT(BTN_B) | BIT(BTN_C) | BIT(BTN_X) |
-                                        BIT(BTN_Y) | BIT(BTN_Z) | BIT(BTN_TL) | BIT(BTN_TR) |
-                                        BIT(BTN_START) | BIT(BTN_SELECT);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_A)] = BIT_MASK(BTN_A) | BIT_MASK(BTN_B) |
+               BIT_MASK(BTN_C) | BIT_MASK(BTN_X) | BIT_MASK(BTN_Y) |
+               BIT_MASK(BTN_Z) | BIT_MASK(BTN_TL) | BIT_MASK(BTN_TR) |
+               BIT_MASK(BTN_START) | BIT_MASK(BTN_SELECT);
        input_set_abs_params(input_dev, ABS_X, -64, 64, 0, 4);
        input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 4);
 
index 3b36ee04f7261848e87c0c61c45b9e517e1bf218..0feeb8acb532a297a819d5713a3aa2bce3490af8 100644 (file)
@@ -333,7 +333,7 @@ static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data)
        input_dev->open = tmdc_open;
        input_dev->close = tmdc_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        for (i = 0; i < port->absc && i < TMDC_ABS; i++)
                if (port->abs[i] >= 0)
index 8381c6f143735f69af27b714cfcd7d79d2a37ed7..bbebd4e2ad7f35845770540f5c3a74f74fd3de1a 100644 (file)
@@ -229,7 +229,7 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs)
                input_dev->open = tgfx_open;
                input_dev->close = tgfx_close;
 
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
                input_set_abs_params(input_dev, ABS_X, -1, 1, 0, 0);
                input_set_abs_params(input_dev, ABS_Y, -1, 1, 0, 0);
 
index c91504ec38ebf012423b46db735d90174697580a..1085c841fec48ca932263e898b0e759ca363fb62 100644 (file)
@@ -207,7 +207,7 @@ static int twidjoy_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
        input_set_abs_params(input_dev, ABS_X, -50, 50, 4, 4);
        input_set_abs_params(input_dev, ABS_Y, -50, 50, 4, 4);
 
index 4e85f72eefd7075b4a6a7c9ae339c64a8dec6d4d..e928b6e3724a528b632f1a3af472073eaf888419 100644 (file)
@@ -162,9 +162,11 @@ static int warrior_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TRIGGER)] = BIT(BTN_TRIGGER) | BIT(BTN_THUMB) | BIT(BTN_TOP) | BIT(BTN_TOP2);
-       input_dev->relbit[0] = BIT(REL_DIAL);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) |
+               BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TRIGGER)] = BIT_MASK(BTN_TRIGGER) |
+               BIT_MASK(BTN_THUMB) | BIT_MASK(BTN_TOP) | BIT_MASK(BTN_TOP2);
+       input_dev->relbit[0] = BIT_MASK(REL_DIAL);
        input_set_abs_params(input_dev, ABS_X, -64, 64, 0, 8);
        input_set_abs_params(input_dev, ABS_Y, -64, 64, 0, 8);
        input_set_abs_params(input_dev, ABS_THROTTLE, -112, 112, 0, 0);
index 623629a69b03e9be1b2a000a98cff8ccede174ef..6dd375825a1403226c9c727da6d3fc460ed17b6f 100644 (file)
@@ -658,7 +658,7 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
        input_dev->open = xpad_open;
        input_dev->close = xpad_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
 
        /* set up buttons */
        for (i = 0; xpad_btn[i] >= 0; i++)
index 63d6ead6b877051baf18392140cd9e23a2df9f68..72abc196ce66580000b25e0800e5b4908fc03383 100644 (file)
@@ -125,7 +125,7 @@ static int __devinit aaedkbd_probe(struct platform_device *pdev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &pdev->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
        input_dev->keycode = aaedkbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
        input_dev->keycodemax = ARRAY_SIZE(aaedkbd_keycode);
index c67e84ec2d6a506b94696c1739dd9d9a76752181..81bf7562aca0d94c65c7ec75278c240055692916 100644 (file)
@@ -209,7 +209,7 @@ static int __init amikbd_init(void)
        amikbd_dev->id.product = 0x0001;
        amikbd_dev->id.version = 0x0100;
 
-       amikbd_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       amikbd_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
 
        for (i = 0; i < 0x78; i++)
                set_bit(i, amikbd_dev->keybit);
index a1800151b6ce8dc045005138154b065055afe171..4e92100c56a8dddcc342c40c5c2867e46e6c0fcf 100644 (file)
@@ -237,7 +237,7 @@ static int __init atakbd_init(void)
        atakbd_dev->id.product = 0x0001;
        atakbd_dev->id.version = 0x0100;
 
-       atakbd_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       atakbd_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
        atakbd_dev->keycode = atakbd_keycode;
        atakbd_dev->keycodesize = sizeof(unsigned char);
        atakbd_dev->keycodemax = ARRAY_SIZE(atakbd_keycode);
index 41fc3d03b6eb495759cb93fbb7611e2acf76b712..b39c5b31e6201155ece9d224ab7e013ed9cb157f 100644 (file)
@@ -900,27 +900,32 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
 
        input_set_drvdata(input_dev, atkbd);
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_MSC);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
+               BIT_MASK(EV_MSC);
 
        if (atkbd->write) {
-               input_dev->evbit[0] |= BIT(EV_LED);
-               input_dev->ledbit[0] = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
+               input_dev->evbit[0] |= BIT_MASK(EV_LED);
+               input_dev->ledbit[0] = BIT_MASK(LED_NUML) |
+                       BIT_MASK(LED_CAPSL) | BIT_MASK(LED_SCROLLL);
        }
 
        if (atkbd->extra)
-               input_dev->ledbit[0] |= BIT(LED_COMPOSE) | BIT(LED_SUSPEND) |
-                                       BIT(LED_SLEEP) | BIT(LED_MUTE) | BIT(LED_MISC);
+               input_dev->ledbit[0] |= BIT_MASK(LED_COMPOSE) |
+                       BIT_MASK(LED_SUSPEND) | BIT_MASK(LED_SLEEP) |
+                       BIT_MASK(LED_MUTE) | BIT_MASK(LED_MISC);
 
        if (!atkbd->softrepeat) {
                input_dev->rep[REP_DELAY] = 250;
                input_dev->rep[REP_PERIOD] = 33;
        }
 
-       input_dev->mscbit[0] = atkbd->softraw ? BIT(MSC_SCAN) : BIT(MSC_RAW) | BIT(MSC_SCAN);
+       input_dev->mscbit[0] = atkbd->softraw ? BIT_MASK(MSC_SCAN) :
+               BIT_MASK(MSC_RAW) | BIT_MASK(MSC_SCAN);
 
        if (atkbd->scroll) {
-               input_dev->evbit[0] |= BIT(EV_REL);
-               input_dev->relbit[0] = BIT(REL_WHEEL) | BIT(REL_HWHEEL);
+               input_dev->evbit[0] |= BIT_MASK(EV_REL);
+               input_dev->relbit[0] = BIT_MASK(REL_WHEEL) |
+                       BIT_MASK(REL_HWHEEL);
                set_bit(BTN_MIDDLE, input_dev->keybit);
        }
 
index 6578bfff644bdc5099f0da31d9876c451af4fa27..790fed368aae0ea144ddb053b6c20276d6717792 100644 (file)
@@ -325,7 +325,8 @@ static int __init corgikbd_probe(struct platform_device *pdev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &pdev->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
+               BIT_MASK(EV_PWR) | BIT_MASK(EV_SW);
        input_dev->keycode = corgikbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
        input_dev->keycodemax = ARRAY_SIZE(corgikbd_keycode);
index e2a3293bc67ed37b66949747de99d0e3d4d1dfd9..3eddf52a0bba5cabbe76a1f41cedee7c5fbf8ffc 100644 (file)
@@ -62,7 +62,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, input);
 
-       input->evbit[0] = BIT(EV_KEY);
+       input->evbit[0] = BIT_MASK(EV_KEY);
 
        input->name = pdev->name;
        input->phys = "gpio-keys/input0";
index cdd254f2e6c7970a93819d7966fead2454c56613..adbf29f0169d81f1f5a740243ade99756fc798cb 100644 (file)
@@ -323,8 +323,9 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
                goto bail2;
        }
 
-       kbd->dev->evbit[0]      = BIT(EV_KEY) | BIT(EV_REP);
-       kbd->dev->ledbit[0]     = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
+       kbd->dev->evbit[0]      = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
+       kbd->dev->ledbit[0]     = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) |
+               BIT_MASK(LED_SCROLLL);
        kbd->dev->keycodemax    = HIL_KEYCODES_SET1_TBLSIZE;
        kbd->dev->keycodesize   = sizeof(hil_kbd_set1[0]);
        kbd->dev->keycode       = hil_kbd_set1;
index 499b6974457f7039366941e1a4ae299fd0580d8b..50d80ecf0b80915ee81d2ab5c59b01be9cb1c4b7 100644 (file)
@@ -266,8 +266,9 @@ hil_keyb_init(void)
                if (hphilkeyb_keycode[i] != KEY_RESERVED)
                        set_bit(hphilkeyb_keycode[i], hil_dev.dev->keybit);
 
-       hil_dev.dev->evbit[0]   = BIT(EV_KEY) | BIT(EV_REP);
-       hil_dev.dev->ledbit[0]  = BIT(LED_NUML) | BIT(LED_CAPSL) | BIT(LED_SCROLLL);
+       hil_dev.dev->evbit[0]   = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
+       hil_dev.dev->ledbit[0]  = BIT_MASK(LED_NUML) | BIT_MASK(LED_CAPSL) |
+               BIT_MASK(LED_SCROLLL);
        hil_dev.dev->keycodemax = HIL_KEYCODES_SET1_TBLSIZE;
        hil_dev.dev->keycodesize= sizeof(hphilkeyb_keycode[0]);
        hil_dev.dev->keycode    = hphilkeyb_keycode;
index 7a41b271f222cfb5bdf5b68cd6946e27d6c88bf8..5a0ca18d6755827b77d776af407364b1a8b2d30d 100644 (file)
@@ -233,7 +233,7 @@ static int locomokbd_probe(struct locomo_dev *dev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &dev->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
        input_dev->keycode = locomokbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
        input_dev->keycodemax = ARRAY_SIZE(locomokbd_keycode);
index b97a41e3ee56cef949835fdc9135f597aefa7850..48d1cab0aa1c7284dcc795391d1759303f39db7c 100644 (file)
@@ -106,7 +106,7 @@ static int nkbd_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
        input_dev->keycode = nkbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
        input_dev->keycodemax = ARRAY_SIZE(nkbd_keycode);
index b7061aa38816d13b1a9469706cb34e9b4c3d5d88..bdd64ee4c5c8fa5187cfce8cb3f718dd7b5f4a3c 100644 (file)
@@ -183,8 +183,9 @@ static int __devinit pxakbd_probe(struct platform_device *pdev)
        input_dev->close = pxakbd_close;
        input_dev->dev.parent = &pdev->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_REL);
-       input_dev->relbit[LONG(REL_WHEEL)] = BIT(REL_WHEEL);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
+               BIT_MASK(EV_REL);
+       input_dev->relbit[BIT_WORD(REL_WHEEL)] = BIT_MASK(REL_WHEEL);
        for (row = 0; row < pdata->nr_rows; row++) {
                for (col = 0; col < pdata->nr_cols; col++) {
                        int code = pdata->keycodes[row][col];
index 41b80385476c82fd67a170a12dae1eb5f6e2f34e..410d78a774d03c2eab0ce95a1fd608f73df09436 100644 (file)
@@ -381,7 +381,8 @@ static int __init spitzkbd_probe(struct platform_device *dev)
        input_dev->id.product = 0x0001;
        input_dev->id.version = 0x0100;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_PWR) | BIT(EV_SW);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) |
+               BIT_MASK(EV_PWR) | BIT_MASK(EV_SW);
        input_dev->keycode = spitzkbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
        input_dev->keycodemax = ARRAY_SIZE(spitzkbd_keycode);
index b44b0684d5439e7e18ce620f5fe65a6962997261..7437219370b1a22e0695003d7318f596e60350d1 100644 (file)
@@ -110,7 +110,7 @@ static int skbd_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
        input_dev->keycode = skbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
        input_dev->keycodemax = ARRAY_SIZE(skbd_keycode);
index 1d4e39624cfecf08d1a4ef4f6a81fce8da3b5112..be0f5d19d0238590f2ffd219a5ef602e505fcb3c 100644 (file)
@@ -277,9 +277,11 @@ static int sunkbd_connect(struct serio *serio, struct serio_driver *drv)
 
        input_dev->event = sunkbd_event;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_SND) | BIT(EV_REP);
-       input_dev->ledbit[0] = BIT(LED_CAPSL) | BIT(LED_COMPOSE) | BIT(LED_SCROLLL) | BIT(LED_NUML);
-       input_dev->sndbit[0] = BIT(SND_CLICK) | BIT(SND_BELL);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) |
+               BIT_MASK(EV_SND) | BIT_MASK(EV_REP);
+       input_dev->ledbit[0] = BIT_MASK(LED_CAPSL) | BIT_MASK(LED_COMPOSE) |
+               BIT_MASK(LED_SCROLLL) | BIT_MASK(LED_NUML);
+       input_dev->sndbit[0] = BIT_MASK(SND_CLICK) | BIT_MASK(SND_BELL);
 
        input_dev->keycode = sunkbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
index f3a56eb58ed1fa05d6abf0c572cf34aef4019095..152a2c0705080f6432fcfb2f4fb4e27c7fa4d47e 100644 (file)
@@ -110,7 +110,7 @@ static int xtkbd_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
        input_dev->keycode = xtkbd->keycode;
        input_dev->keycodesize = sizeof(unsigned char);
        input_dev->keycodemax = ARRAY_SIZE(xtkbd_keycode);
index 471aab206443bd8641d03e561aa58565ce5b3cb4..3a7937481ad8730d654835d4014557a364c70a3f 100644 (file)
@@ -662,10 +662,10 @@ static void ati_remote_input_init(struct ati_remote *ati_remote)
        struct input_dev *idev = ati_remote->idev;
        int i;
 
-       idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       idev->keybit[LONG(BTN_MOUSE)] = ( BIT(BTN_LEFT) | BIT(BTN_RIGHT) |
-                                         BIT(BTN_SIDE) | BIT(BTN_EXTRA) );
-       idev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       idev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA);
+       idev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
        for (i = 0; ati_remote_tbl[i].kind != KIND_END; i++)
                if (ati_remote_tbl[i].type == EV_KEY)
                        set_bit(ati_remote_tbl[i].code, idev->keybit);
index 1031543e5c3f3e1f71e4e15bcae5ae600aa0f087..f2709b82485c181067b8a8fccab942a83bd425ed 100644 (file)
@@ -346,9 +346,10 @@ static int ati_remote2_input_init(struct ati_remote2 *ar2)
        ar2->idev = idev;
        input_set_drvdata(idev, ar2);
 
-       idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP) | BIT(EV_REL);
-       idev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
-       idev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       idev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP) | BIT_MASK(EV_REL);
+       idev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT);
+       idev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
        for (i = 0; ati_remote2_key_table[i].key_code != KEY_RESERVED; i++)
                set_bit(ati_remote2_key_table[i].key_code, idev->keybit);
 
index e43e92fd9e2311f8a15c01f52b2eb769b003cb7c..4e3ad657ed8033b7ab917a1e4c886296b3722849 100644 (file)
@@ -81,7 +81,7 @@ static int atlas_acpi_button_add(struct acpi_device *device)
        input_dev->name = "Atlas ACPI button driver";
        input_dev->phys = "ASIM0000/atlas/input0";
        input_dev->id.bustype = BUS_HOST;
-       input_dev->evbit[LONG(EV_KEY)] = BIT(EV_KEY);
+       input_dev->evbit[BIT_WORD(EV_KEY)] = BIT_MASK(EV_KEY);
 
        set_bit(KEY_F1, input_dev->keybit);
        set_bit(KEY_F2, input_dev->keybit);
index 064b07936019c1f6465eb6aa1c1391666734a653..1aef97ed5e84575cc43225fd020038e28659f599 100644 (file)
@@ -104,7 +104,7 @@ static int __devinit cobalt_buttons_probe(struct platform_device *pdev)
        input->id.bustype = BUS_HOST;
        input->cdev.dev = &pdev->dev;
 
-       input->evbit[0] = BIT(EV_KEY);
+       input->evbit[0] = BIT_MASK(EV_KEY);
        for (i = 0; i < ARRAY_SIZE(buttons_map); i++) {
                set_bit(buttons_map[i].keycode, input->keybit);
                buttons_map[i].count = 0;
index e759944041abd7c3a92b0849df88e34e59a47b92..d2ade7443b7db832ba756992f16117ee19b63799 100644 (file)
@@ -109,8 +109,8 @@ static int __devinit ixp4xx_spkr_probe(struct platform_device *dev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &dev->dev;
 
-       input_dev->evbit[0] = BIT(EV_SND);
-       input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+       input_dev->evbit[0] = BIT_MASK(EV_SND);
+       input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
        input_dev->event = ixp4xx_spkr_event;
 
        err = request_irq(IRQ_IXP4XX_TIMER2, &ixp4xx_spkr_interrupt,
index 1bffc9fa98c270f3c8898a70a423602867846d9e..fd74347047dde8315cec4457caaf560b00e02b2a 100644 (file)
@@ -497,7 +497,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
        usb_to_input_id(udev, &input_dev->id);
        input_dev->dev.parent = &interface->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY);              /* We will only report KEY events. */
+       input_dev->evbit[0] = BIT_MASK(EV_KEY);         /* We will only report KEY events. */
        for (i = 0; i < ARRAY_SIZE(keyspan_key_table); i++)
                if (keyspan_key_table[i] != KEY_RESERVED)
                        set_bit(keyspan_key_table[i], input_dev->keybit);
index e9f26e766b4d84606a5d0d79dc3f255a825773e9..0c64d9bb718ecf9250b84137fa581d1c552339a0 100644 (file)
@@ -65,8 +65,8 @@ static int __devinit m68kspkr_probe(struct platform_device *dev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &dev->dev;
 
-       input_dev->evbit[0] = BIT(EV_SND);
-       input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+       input_dev->evbit[0] = BIT_MASK(EV_SND);
+       input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
        input_dev->event = m68kspkr_event;
 
        err = input_register_device(input_dev);
index c19f77fbaf2a9ffb7646f03bfcb8493797830f93..4941a9e61e902967a410404f0b67171bdbdb51d5 100644 (file)
@@ -86,8 +86,8 @@ static int __devinit pcspkr_probe(struct platform_device *dev)
        pcspkr_dev->id.version = 0x0100;
        pcspkr_dev->dev.parent = &dev->dev;
 
-       pcspkr_dev->evbit[0] = BIT(EV_SND);
-       pcspkr_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+       pcspkr_dev->evbit[0] = BIT_MASK(EV_SND);
+       pcspkr_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
        pcspkr_dev->event = pcspkr_event;
 
        err = input_register_device(pcspkr_dev);
index 448a470d28f264d4ee6f666438d162a17225f694..7a7b8c7b96333b441bf9746b42e75d7a31f359d5 100644 (file)
@@ -363,10 +363,11 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
 
        input_dev->event = powermate_input_event;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL) | BIT(EV_MSC);
-       input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
-       input_dev->relbit[LONG(REL_DIAL)] = BIT(REL_DIAL);
-       input_dev->mscbit[LONG(MSC_PULSELED)] = BIT(MSC_PULSELED);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) |
+               BIT_MASK(EV_MSC);
+       input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
+       input_dev->relbit[BIT_WORD(REL_DIAL)] = BIT_MASK(REL_DIAL);
+       input_dev->mscbit[BIT_WORD(MSC_PULSELED)] = BIT_MASK(MSC_PULSELED);
 
        /* get a handle to the interrupt data pipe */
        pipe = usb_rcvintpipe(udev, endpoint->bEndpointAddress);
index e36ec1d92be895a4279e12f88d7654d2eddc466d..a3637d870880a22a8d92befb7e75aa9272096c1d 100644 (file)
@@ -115,8 +115,8 @@ static int __devinit sparcspkr_probe(struct device *dev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = dev;
 
-       input_dev->evbit[0] = BIT(EV_SND);
-       input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+       input_dev->evbit[0] = BIT_MASK(EV_SND);
+       input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
 
        input_dev->event = state->event;
 
index ab15880fd5663ab63cd0bbbc085dbea617eb7410..46279ef2b649b7f523006eeffa1bfd14e0173f77 100644 (file)
@@ -945,7 +945,7 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
        /* input_dev->event = input_ev; TODO */
 
        /* register available key events */
-       input_dev->evbit[0] = BIT(EV_KEY);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY);
        for (i = 0; i < 256; i++) {
                int k = map_p1k_to_key(i);
                if (k >= 0) {
index 64d70a9b714c9d84572f5c39d5f98b7a60f9d5b9..2b5ed119c9a90e9b5d66245eebfe9fcc1e11a197 100644 (file)
@@ -455,24 +455,25 @@ int alps_init(struct psmouse *psmouse)
        if (alps_hw_init(psmouse, &version))
                goto init_fail;
 
-       dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY);
-       dev1->keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
-       dev1->keybit[LONG(BTN_TOOL_FINGER)] |= BIT(BTN_TOOL_FINGER);
-       dev1->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
+       dev1->evbit[BIT_WORD(EV_KEY)] |= BIT_MASK(EV_KEY);
+       dev1->keybit[BIT_WORD(BTN_TOUCH)] |= BIT_MASK(BTN_TOUCH);
+       dev1->keybit[BIT_WORD(BTN_TOOL_FINGER)] |= BIT_MASK(BTN_TOOL_FINGER);
+       dev1->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
 
-       dev1->evbit[LONG(EV_ABS)] |= BIT(EV_ABS);
+       dev1->evbit[BIT_WORD(EV_ABS)] |= BIT_MASK(EV_ABS);
        input_set_abs_params(dev1, ABS_X, 0, 1023, 0, 0);
        input_set_abs_params(dev1, ABS_Y, 0, 767, 0, 0);
        input_set_abs_params(dev1, ABS_PRESSURE, 0, 127, 0, 0);
 
        if (priv->i->flags & ALPS_WHEEL) {
-               dev1->evbit[LONG(EV_REL)] |= BIT(EV_REL);
-               dev1->relbit[LONG(REL_WHEEL)] |= BIT(REL_WHEEL);
+               dev1->evbit[BIT_WORD(EV_REL)] |= BIT_MASK(EV_REL);
+               dev1->relbit[BIT_WORD(REL_WHEEL)] |= BIT_MASK(REL_WHEEL);
        }
 
        if (priv->i->flags & (ALPS_FW_BK_1 | ALPS_FW_BK_2)) {
-               dev1->keybit[LONG(BTN_FORWARD)] |= BIT(BTN_FORWARD);
-               dev1->keybit[LONG(BTN_BACK)] |= BIT(BTN_BACK);
+               dev1->keybit[BIT_WORD(BTN_FORWARD)] |= BIT_MASK(BTN_FORWARD);
+               dev1->keybit[BIT_WORD(BTN_BACK)] |= BIT_MASK(BTN_BACK);
        }
 
        snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys);
@@ -483,9 +484,10 @@ int alps_init(struct psmouse *psmouse)
        dev2->id.product = PSMOUSE_ALPS;
        dev2->id.version = 0x0000;
 
-       dev2->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       dev2->relbit[LONG(REL_X)] |= BIT(REL_X) | BIT(REL_Y);
-       dev2->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
+       dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       dev2->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
+       dev2->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
 
        if (input_register_device(priv->dev2))
                goto init_fail;
index 239a0e16d91abf215904584e72b3985c746e770b..a185ac78a42ca441a193229f2bd04ccf7cfd8079 100644 (file)
@@ -111,9 +111,10 @@ static int __init amimouse_init(void)
        amimouse_dev->id.product = 0x0002;
        amimouse_dev->id.version = 0x0100;
 
-       amimouse_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       amimouse_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
-       amimouse_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
+       amimouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       amimouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
+       amimouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
        amimouse_dev->open = amimouse_open;
        amimouse_dev->close = amimouse_close;
 
index c8c7244b48a1bae505aab6b5e70f48657ad30dbb..98a3561d4b054f21633433b4f12d6e1367a94f44 100644 (file)
@@ -137,9 +137,10 @@ static int __init atamouse_init(void)
        atamouse_dev->id.product = 0x0002;
        atamouse_dev->id.version = 0x0100;
 
-       atamouse_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       atamouse_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
-       atamouse_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
+       atamouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       atamouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
+       atamouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
        atamouse_dev->open = atamouse_open;
        atamouse_dev->close = atamouse_close;
 
index 449bf4dcbbcc726cc7546edbbeb122078d039a1c..27f88fbb7136c0a40f6257db82266f105fee0a7e 100644 (file)
@@ -298,12 +298,12 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
        idd = ptr->idd + 1;
        txt = "unknown";
        if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_REL) {
-               ptr->dev->evbit[0] = BIT(EV_REL);
+               ptr->dev->evbit[0] = BIT_MASK(EV_REL);
                txt = "relative";
        }
 
        if ((did & HIL_IDD_DID_TYPE_MASK) == HIL_IDD_DID_TYPE_ABS) {
-               ptr->dev->evbit[0] = BIT(EV_ABS);
+               ptr->dev->evbit[0] = BIT_MASK(EV_ABS);
                txt = "absolute";
        }
        if (!ptr->dev->evbit[0])
@@ -311,7 +311,7 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
 
        ptr->nbtn = HIL_IDD_NUM_BUTTONS(idd);
        if (ptr->nbtn)
-               ptr->dev->evbit[0] |= BIT(EV_KEY);
+               ptr->dev->evbit[0] |= BIT_MASK(EV_KEY);
 
        naxsets = HIL_IDD_NUM_AXSETS(*idd);
        ptr->naxes = HIL_IDD_NUM_AXES_PER_SET(*idd);
index 79b624fe8994ff2d513b91a984840df869704e80..655a392174322605a37cf6d2fda29f3cf02c1d32 100644 (file)
@@ -163,9 +163,10 @@ static int __init inport_init(void)
        inport_dev->id.product = 0x0001;
        inport_dev->id.version = 0x0100;
 
-       inport_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       inport_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-       inport_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       inport_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       inport_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
+       inport_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 
        inport_dev->open  = inport_open;
        inport_dev->close = inport_close;
index d7de4c53b3d8cb8cd853c14ae382f5f47f2fda83..9ec57d80186e43b7f776ec3b9aed0c7c385ce625 100644 (file)
@@ -270,9 +270,10 @@ static int lifebook_create_relative_device(struct psmouse *psmouse)
        dev2->id.version = 0x0000;
        dev2->dev.parent = &psmouse->ps2dev.serio->dev;
 
-       dev2->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       dev2->relbit[LONG(REL_X)] = BIT(REL_X) | BIT(REL_Y);
-       dev2->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
+       dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       dev2->relbit[BIT_WORD(REL_X)] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
+       dev2->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT);
 
        error = input_register_device(priv->dev2);
        if (error)
@@ -295,9 +296,9 @@ int lifebook_init(struct psmouse *psmouse)
        if (lifebook_absolute_mode(psmouse))
                return -1;
 
-       dev1->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY);
+       dev1->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);
        dev1->relbit[0] = 0;
-       dev1->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       dev1->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(dev1, ABS_X, 0, max_coord, 0, 0);
        input_set_abs_params(dev1, ABS_Y, 0, max_coord, 0, 0);
 
index 26c3b2e2ca94a3eff06a3ef800f59f78a19f5c58..b23a4f3ea5cdcf48d5e09cf789ba610940a3f68f 100644 (file)
@@ -156,9 +156,10 @@ static int __init logibm_init(void)
        logibm_dev->id.product = 0x0001;
        logibm_dev->id.version = 0x0100;
 
-       logibm_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       logibm_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-       logibm_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       logibm_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       logibm_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
+       logibm_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 
        logibm_dev->open  = logibm_open;
        logibm_dev->close = logibm_close;
index 05d992e514f0bd5452dc0a6f0c9161b01a01c753..8991ab0b4fe3b3caed329b0a32aea07d29c6d303 100644 (file)
@@ -144,9 +144,9 @@ static int __init pc110pad_init(void)
        pc110pad_dev->id.product = 0x0001;
        pc110pad_dev->id.version = 0x0100;
 
-       pc110pad_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       pc110pad_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y);
-       pc110pad_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       pc110pad_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       pc110pad_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y);
+       pc110pad_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 
        pc110pad_dev->absmax[ABS_X] = 0x1ff;
        pc110pad_dev->absmax[ABS_Y] = 0x0ff;
index 0735257565329aa590096f1f9bc8fd0ab49e665b..da316d13d7f578cdd6b3b0aa8f1a122f8c055ccd 100644 (file)
@@ -1115,9 +1115,10 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, const struct psmouse
 
        input_dev->dev.parent = &psmouse->ps2dev.serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-       input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       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_MIDDLE) | BIT_MASK(BTN_RIGHT);
+       input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 
        psmouse->set_rate = psmouse_set_rate;
        psmouse->set_resolution = psmouse_set_resolution;
index 355efd0423e7df49cd5cbbf35b26eb3da774adf5..18a48636ba4a96f88c8b7f253fd9aaf894e593b6 100644 (file)
@@ -78,9 +78,10 @@ static int __init rpcmouse_init(void)
        rpcmouse_dev->id.product = 0x0001;
        rpcmouse_dev->id.version = 0x0100;
 
-       rpcmouse_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       rpcmouse_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-       rpcmouse_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       rpcmouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       rpcmouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
+       rpcmouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 
        rpcmouse_lastx = (short) iomd_readl(IOMD_MOUSEX);
        rpcmouse_lasty = (short) iomd_readl(IOMD_MOUSEY);
index 77b8ee2b9651750728fe47409042ab0710057cc1..ed917bfd086aa13dbafc56bf19a971ee906307e3 100644 (file)
@@ -268,9 +268,10 @@ static int sermouse_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT);
-       input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       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);
+       input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 
        if (c & 0x01) set_bit(BTN_MIDDLE, input_dev->keybit);
        if (c & 0x02) set_bit(BTN_SIDE, input_dev->keybit);
index 7b977fd23571737ee3e49cb70ee4174e4c083376..3fadb2accac0264baa3dc2790241fd5e4ae1783a 100644 (file)
@@ -85,7 +85,7 @@ int touchkit_ps2_detect(struct psmouse *psmouse, int set_properties)
                return -ENODEV;
 
        if (set_properties) {
-               dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
+               dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
                set_bit(BTN_TOUCH, dev->keybit);
                input_set_abs_params(dev, ABS_X, 0, TOUCHKIT_MAX_XC, 0, 0);
                input_set_abs_params(dev, ABS_Y, 0, TOUCHKIT_MAX_YC, 0, 0);
index 79146d6ed2ab2d392988d196d64d4f9d6c0e92bf..78c3ea75da2a056b2799045c6c2329f5834a8705 100644 (file)
@@ -998,34 +998,36 @@ static const struct input_device_id mousedev_ids[] = {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_KEYBIT |
                                INPUT_DEVICE_ID_MATCH_RELBIT,
-               .evbit = { BIT(EV_KEY) | BIT(EV_REL) },
-               .keybit = { [LONG(BTN_LEFT)] = BIT(BTN_LEFT) },
-               .relbit = { BIT(REL_X) | BIT(REL_Y) },
+               .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) },
+               .keybit = { [BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) },
+               .relbit = { BIT_MASK(REL_X) | BIT_MASK(REL_Y) },
        },      /* A mouse like device, at least one button,
                   two relative axes */
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_RELBIT,
-               .evbit = { BIT(EV_KEY) | BIT(EV_REL) },
-               .relbit = { BIT(REL_WHEEL) },
+               .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_REL) },
+               .relbit = { BIT_MASK(REL_WHEEL) },
        },      /* A separate scrollwheel */
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_KEYBIT |
                                INPUT_DEVICE_ID_MATCH_ABSBIT,
-               .evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
-               .keybit = { [LONG(BTN_TOUCH)] = BIT(BTN_TOUCH) },
-               .absbit = { BIT(ABS_X) | BIT(ABS_Y) },
+               .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) },
+               .keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) },
+               .absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) },
        },      /* A tablet like device, at least touch detection,
                   two absolute axes */
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
                                INPUT_DEVICE_ID_MATCH_KEYBIT |
                                INPUT_DEVICE_ID_MATCH_ABSBIT,
-               .evbit = { BIT(EV_KEY) | BIT(EV_ABS) },
-               .keybit = { [LONG(BTN_TOOL_FINGER)] = BIT(BTN_TOOL_FINGER) },
-               .absbit = { BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE) |
-                               BIT(ABS_TOOL_WIDTH) },
+               .evbit = { BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) },
+               .keybit = { [BIT_WORD(BTN_TOOL_FINGER)] =
+                               BIT_MASK(BTN_TOOL_FINGER) },
+               .absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) |
+                               BIT_MASK(ABS_PRESSURE) |
+                               BIT_MASK(ABS_TOOL_WIDTH) },
        },      /* A touchpad */
 
        { },    /* Terminating entry */
index 558200e96d0f22a1d586f578f5df62944646b21d..5a41b8f7f888f0887583802a715e6341446fdbdd 100644 (file)
@@ -31,6 +31,8 @@ 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 */
index dd2310458c46a87aafaf0d2873a54f535dde0781..b973d0ef6d16ae6d332838204a57a20bf184d575 100644 (file)
@@ -192,10 +192,14 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
        input_dev->open = usb_acecad_open;
        input_dev->close = usb_acecad_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
-       input_dev->keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
-       input_dev->keybit[LONG(BTN_DIGI)] = BIT(BTN_TOOL_PEN) |BIT(BTN_TOUCH) | BIT(BTN_STYLUS) | BIT(BTN_STYLUS2);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) |
+               BIT_MASK(ABS_PRESSURE);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_TOOL_PEN) |
+               BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS) |
+               BIT_MASK(BTN_STYLUS2);
 
        switch (id->driver_info) {
                case 0:
index b2ca10f2fe0e48b74d8cf22739f8623561a09c7c..d2c6da264722576ddee43d1041ed641fe25af422 100644 (file)
@@ -573,10 +573,12 @@ static void gtco_setup_caps(struct input_dev *inputdev)
        struct gtco *device = input_get_drvdata(inputdev);
 
        /* Which events */
-       inputdev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC);
+       inputdev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) |
+               BIT_MASK(EV_MSC);
 
        /* Misc event menu block */
-       inputdev->mscbit[0] = BIT(MSC_SCAN)|BIT(MSC_SERIAL)|BIT(MSC_RAW) ;
+       inputdev->mscbit[0] = BIT_MASK(MSC_SCAN) | BIT_MASK(MSC_SERIAL) |
+               BIT_MASK(MSC_RAW);
 
        /* Absolute values based on HID report info */
        input_set_abs_params(inputdev, ABS_X, device->min_X, device->max_X,
index 91e6d00d4a43ffdc4a8a26e21ea1ca9bd6e9df90..1182fc133167ac203e2d5e52cc71201ce4108c24 100644 (file)
@@ -153,10 +153,13 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
        input_dev->open = kbtab_open;
        input_dev->close = kbtab_close;
 
-       input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC);
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH);
-       input_dev->mscbit[0] |= BIT(MSC_SERIAL);
+       input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) |
+               BIT_MASK(EV_MSC);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) |
+               BIT_MASK(BTN_TOUCH);
+       input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL);
        input_set_abs_params(input_dev, ABS_X, 0, 0x2000, 4, 0);
        input_set_abs_params(input_dev, ABS_Y, 0, 0x1750, 4, 0);
        input_set_abs_params(input_dev, ABS_PRESSURE, 0, 0xff, 0, 0);
index 064e123c9b766170be132d2bb894b535d168b961..d64b1ea136b35c1a79ee18ca658f717e27f408f2 100644 (file)
@@ -140,48 +140,58 @@ static void wacom_close(struct input_dev *dev)
 
 void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_1) | BIT(BTN_5);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_1) |
+               BIT_MASK(BTN_5);
        input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0);
 }
 
 void input_dev_g4(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->evbit[0] |= BIT(EV_MSC);
-       input_dev->mscbit[0] |= BIT(MSC_SERIAL);
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_4);
+       input_dev->evbit[0] |= BIT_MASK(EV_MSC);
+       input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) |
+               BIT_MASK(BTN_4);
 }
 
 void input_dev_g(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->evbit[0] |= BIT(EV_REL);
-       input_dev->relbit[0] |= BIT(REL_WHEEL);
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_STYLUS2);
+       input_dev->evbit[0] |= BIT_MASK(EV_REL);
+       input_dev->relbit[0] |= BIT_MASK(REL_WHEEL);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) |
+               BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_STYLUS2);
        input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0);
 }
 
 void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_FINGER);
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_0) | BIT(BTN_1) | BIT(BTN_2) | BIT(BTN_3);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_FINGER);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) |
+               BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
        input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
 }
 
 void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_4) | BIT(BTN_5) | BIT(BTN_6) | BIT(BTN_7);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_4) |
+               BIT_MASK(BTN_5) | BIT_MASK(BTN_6) | BIT_MASK(BTN_7);
        input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
 }
 
 void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->evbit[0] |= BIT(EV_MSC) | BIT(EV_REL);
-       input_dev->mscbit[0] |= BIT(MSC_SERIAL);
-       input_dev->relbit[0] |= BIT(REL_WHEEL);
-       input_dev->keybit[LONG(BTN_LEFT)] |= BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE) | BIT(BTN_SIDE) | BIT(BTN_EXTRA);
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER) | BIT(BTN_TOOL_MOUSE) | BIT(BTN_TOOL_BRUSH)
-               | BIT(BTN_TOOL_PENCIL) | BIT(BTN_TOOL_AIRBRUSH) | BIT(BTN_TOOL_LENS) | BIT(BTN_STYLUS2);
+       input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL);
+       input_dev->mscbit[0] |= BIT_MASK(MSC_SERIAL);
+       input_dev->relbit[0] |= BIT_MASK(REL_WHEEL);
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE) |
+               BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER) |
+               BIT_MASK(BTN_TOOL_MOUSE) | BIT_MASK(BTN_TOOL_BRUSH) |
+               BIT_MASK(BTN_TOOL_PENCIL) | BIT_MASK(BTN_TOOL_AIRBRUSH) |
+               BIT_MASK(BTN_TOOL_LENS) | BIT_MASK(BTN_STYLUS2);
        input_set_abs_params(input_dev, ABS_DISTANCE, 0, wacom_wac->features->distance_max, 0, 0);
        input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0);
        input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0);
@@ -192,12 +202,13 @@ void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 
 void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_STYLUS2) | BIT(BTN_TOOL_RUBBER);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_STYLUS2) |
+               BIT_MASK(BTN_TOOL_RUBBER);
 }
 
 void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_RUBBER);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_RUBBER);
 }
 
 static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id)
@@ -243,12 +254,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
        input_dev->open = wacom_open;
        input_dev->close = wacom_close;
 
-       input_dev->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_DIGI)] |= BIT(BTN_TOOL_PEN) | BIT(BTN_TOUCH) | BIT(BTN_STYLUS);
+       input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_DIGI)] |= BIT_MASK(BTN_TOOL_PEN) |
+               BIT_MASK(BTN_TOUCH) | BIT_MASK(BTN_STYLUS);
        input_set_abs_params(input_dev, ABS_X, 0, wacom_wac->features->x_max, 4, 0);
        input_set_abs_params(input_dev, ABS_Y, 0, wacom_wac->features->y_max, 4, 0);
        input_set_abs_params(input_dev, ABS_PRESSURE, 0, wacom_wac->features->pressure_max, 0, 0);
-       input_dev->absbit[LONG(ABS_MISC)] |= BIT(ABS_MISC);
+       input_dev->absbit[BIT_WORD(ABS_MISC)] |= BIT_MASK(ABS_MISC);
 
        wacom_init_input_dev(input_dev, wacom_wac);
 
index 51ae4fb7d123b2882380f1ec78531949c70c59a9..f59aecf5ec1565fe4959308edc8cc034c3a0a9a3 100644 (file)
@@ -917,8 +917,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
        input_dev->phys = ts->phys;
        input_dev->dev.parent = &spi->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(input_dev, ABS_X,
                        pdata->x_min ? : 0,
                        pdata->x_max ? : MAX_12BIT,
index e6a31d118786c67c76913f7270e2761eecd69a8a..b1b2e07bf080b3cb348726e3c7a3aff935ad7725 100644 (file)
@@ -302,8 +302,8 @@ static int __init corgits_probe(struct platform_device *pdev)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &pdev->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(input_dev, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0, 0);
        input_set_abs_params(input_dev, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0, 0);
        input_set_abs_params(input_dev, ABS_PRESSURE, PRESSURE_MIN, PRESSURE_MAX, 0, 0);
index 557d781719f12b631c6dd940b109c91be04cef9b..d20689cdbd5d63665601e9e00baca7ffd08eb42d 100644 (file)
@@ -320,8 +320,8 @@ static int elo_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 
        serio_set_drvdata(serio, elo);
        err = serio_open(serio, drv);
index daf7a4afc9352e08afe3e04637a18bd8698382eb..80b21800355f10d255a8e8f06fdad8a3b37270fa 100644 (file)
@@ -122,8 +122,8 @@ static int fujitsu_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.vendor = SERIO_FUJITSU;
        input_dev->id.product = 0;
        input_dev->id.version = 0x0100;
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 
        input_set_abs_params(input_dev, ABS_X, 0, 4096, 0, 0);
        input_set_abs_params(input_dev, ABS_Y, 0, 4096, 0, 0);
index 39d602600d7cfe1e7a89d5f9f4f23652d8ad90d9..a48a15868c4ade3b1067a97f955d819df739c831 100644 (file)
@@ -137,8 +137,8 @@ static int gunze_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.product = 0x0051;
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(input_dev, ABS_X, 24, 1000, 0, 0);
        input_set_abs_params(input_dev, ABS_Y, 24, 1000, 0, 0);
 
index 09ed7803cb8fcd07143bd3c1dfb3d571fb0efb58..2ae6c6016a8665d79eb4f6dd63d76a3675230f30 100644 (file)
@@ -373,8 +373,9 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv)
 
        input_dev->event = h3600ts_event;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_LED) | BIT(EV_PWR);
-       input_dev->ledbit[0] = BIT(LED_SLEEP);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS) |
+               BIT_MASK(EV_LED) | BIT_MASK(EV_PWR);
+       input_dev->ledbit[0] = BIT_MASK(LED_SLEEP);
        input_set_abs_params(input_dev, ABS_X, 60, 985, 0, 0);
        input_set_abs_params(input_dev, ABS_Y, 35, 1024, 0, 0);
 
index 1a15475aedfcc269d5bbfc033c15db3025a3dd5b..c38d4e0f95c6a093e7bf009fcb662160b97a3a8e 100644 (file)
@@ -81,8 +81,8 @@ static int __init hp680_ts_init(void)
        if (!hp680_ts_dev)
                return -ENOMEM;
 
-       hp680_ts_dev->evbit[0] = BIT(EV_ABS) | BIT(EV_KEY);
-       hp680_ts_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       hp680_ts_dev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY);
+       hp680_ts_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
 
        input_set_abs_params(hp680_ts_dev, ABS_X,
                HP680_TS_ABS_X_MIN, HP680_TS_ABS_X_MAX, 0, 0);
index 44140feeffc503428a54399b591f1628f3842010..80a65886870624300be79bfb008f4add780d68e4 100644 (file)
@@ -186,8 +186,8 @@ static int __init mk712_init(void)
        mk712_dev->open    = mk712_open;
        mk712_dev->close   = mk712_close;
 
-       mk712_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       mk712_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       mk712_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       mk712_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(mk712_dev, ABS_X, 0, 0xfff, 88, 0);
        input_set_abs_params(mk712_dev, ABS_Y, 0, 0xfff, 88, 0);
 
index 4ec3b1f940c8f424560f4d5ebcc1bb060ce44162..9077228418b7028242caa03cc99292ee8f2c62cd 100644 (file)
@@ -151,8 +151,8 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.product = 0;
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(mtouch->dev, ABS_X, MTOUCH_MIN_XC, MTOUCH_MAX_XC, 0, 0);
        input_set_abs_params(mtouch->dev, ABS_Y, MTOUCH_MIN_YC, MTOUCH_MAX_YC, 0, 0);
 
index f2c0d3c7149cacc684a3cb30f20ba159dbd1ac00..c7f9cebebbb6dbe5376e53407b44d4c41370aee8 100644 (file)
@@ -113,8 +113,8 @@ static int pm_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
 
-        input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-        input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+        input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+        input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
         input_set_abs_params(pm->dev, ABS_X, 0, 0x3ff, 0, 0);
         input_set_abs_params(pm->dev, ABS_Y, 0, 0x3ff, 0, 0);
 
index 3def7bb1df44641c569880e64f389613e2ad3425..3a5c142c2a78a6fd6b0e55cbf79c5c57bf236999 100644 (file)
@@ -125,8 +125,8 @@ static int tr_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.product = 0;
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(tr->dev, ABS_X, TR_MIN_XC, TR_MAX_XC, 0, 0);
        input_set_abs_params(tr->dev, ABS_Y, TR_MIN_YC, TR_MAX_YC, 0, 0);
 
index ac4bdcf186660a8c040ea5604648a59438061808..763a656a59f8270929f2366f710147ef2339e43e 100644 (file)
@@ -132,8 +132,8 @@ static int tw_connect(struct serio *serio, struct serio_driver *drv)
        input_dev->id.product = 0;
        input_dev->id.version = 0x0100;
        input_dev->dev.parent = &serio->dev;
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(tw->dev, ABS_X, TW_MIN_XC, TW_MAX_XC, 0, 0);
        input_set_abs_params(tw->dev, ABS_Y, TW_MIN_YC, TW_MAX_YC, 0, 0);
 
index 89373b01d8f5694148dab2f6ccf6d67839c65ee6..7549939b9535634de87ddb09a829b186758303e0 100644 (file)
@@ -517,7 +517,7 @@ static int ucb1400_ts_probe(struct device *dev)
        idev->id.product        = id;
        idev->open              = ucb1400_ts_open;
        idev->close             = ucb1400_ts_close;
-       idev->evbit[0]          = BIT(EV_ABS);
+       idev->evbit[0]          = BIT_MASK(EV_ABS);
 
        ucb1400_adc_enable(ucb);
        x_res = ucb1400_ts_read_xres(ucb);
index 9fb3d5c309998162c5f14d40c6587e95c95395a5..5f34b78d5ddbef126193d13b1c2afc4e8a3600b8 100644 (file)
@@ -868,8 +868,8 @@ static int usbtouch_probe(struct usb_interface *intf,
        input_dev->open = usbtouch_open;
        input_dev->close = usbtouch_close;
 
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-       input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH);
        input_set_abs_params(input_dev, ABS_X, type->min_xc, type->max_xc, 0, 0);
        input_set_abs_params(input_dev, ABS_Y, type->min_yc, type->max_yc, 0, 0);
        if (type->max_press)
index 2766e4fc4ea82e36cfa7ce205076ad7f1c3cae44..883da72b5368d236d6c0246da16509b9a97bc42f 100644 (file)
@@ -791,8 +791,10 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
                        if (hid->keycode[i])
                                set_bit(hid->keycode[i], input_dev->keybit);
 
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP);
-               input_dev->ledbit[0] = BIT(LED_SCROLLL) | BIT(LED_CAPSL) | BIT(LED_NUML);
+               input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_LED) |
+                       BIT_MASK(EV_REP);
+               input_dev->ledbit[0] = BIT_MASK(LED_SCROLLL) |
+                       BIT_MASK(LED_CAPSL) | BIT_MASK(LED_NUML);
                input_dev->event = adbhid_kbd_event;
                input_dev->keycodemax = KEY_FN;
                input_dev->keycodesize = sizeof(hid->keycode[0]);
@@ -801,16 +803,18 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
        case ADB_MOUSE:
                sprintf(hid->name, "ADB mouse");
 
-               input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-               input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-               input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+               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_MIDDLE) | BIT_MASK(BTN_RIGHT);
+               input_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
                break;
 
        case ADB_MISC:
                switch (original_handler_id) {
                case 0x02: /* Adjustable keyboard button device */
                        sprintf(hid->name, "ADB adjustable keyboard buttons");
-                       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+                       input_dev->evbit[0] = BIT_MASK(EV_KEY) |
+                               BIT_MASK(EV_REP);
                        set_bit(KEY_SOUND, input_dev->keybit);
                        set_bit(KEY_MUTE, input_dev->keybit);
                        set_bit(KEY_VOLUMEUP, input_dev->keybit);
@@ -818,7 +822,8 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
                        break;
                case 0x1f: /* Powerbook button device */
                        sprintf(hid->name, "ADB Powerbook buttons");
-                       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+                       input_dev->evbit[0] = BIT_MASK(EV_KEY) |
+                               BIT_MASK(EV_REP);
                        set_bit(KEY_MUTE, input_dev->keybit);
                        set_bit(KEY_VOLUMEUP, input_dev->keybit);
                        set_bit(KEY_VOLUMEDOWN, input_dev->keybit);
index 33dee3a773ed29ae4cad14fe9fa37203ba7cbfef..89302309da92d56f397096ad8412a4e7fa2ef1d4 100644 (file)
@@ -117,9 +117,10 @@ static int emumousebtn_input_register(void)
        emumousebtn->id.product = 0x0001;
        emumousebtn->id.version = 0x0100;
 
-       emumousebtn->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       emumousebtn->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-       emumousebtn->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       emumousebtn->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       emumousebtn->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
+       emumousebtn->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 
        ret = input_register_device(emumousebtn);
        if (ret)
index 5a12b5679556a78a2fc70be51beaa3f0433d2fd7..154a7ce7cb826dd43443b4492e9f8ca92a322ce7 100644 (file)
@@ -820,7 +820,7 @@ static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
 
        input_dev->name = DRIVER_NAME " remote control";
        input_dev->phys = cinergyt2->phys;
-       input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
        for (i = 0; i < ARRAY_SIZE(rc_keys); i += 3)
                set_bit(rc_keys[i + 2], input_dev->keybit);
        input_dev->keycodesize = 0;
index 7b9f35bfb4f062fe132f78de4fd69736bf293b2f..c0c2c22ddd835143d087ca450306e90f342310c4 100644 (file)
@@ -106,7 +106,7 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
        if (!input_dev)
                return -ENOMEM;
 
-       input_dev->evbit[0] = BIT(EV_KEY);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY);
        input_dev->name = "IR-receiver inside an USB DVB receiver";
        input_dev->phys = d->rc_phys;
        usb_to_input_id(d->udev, &input_dev->id);
index 5e691fd79904e98cbbc8cc5b9a6ddacf1b6d0658..1ec981d98b91bf60da958e0530dccca725b68474 100644 (file)
@@ -1198,7 +1198,7 @@ static int ttusb_init_rc( struct ttusb_dec *dec)
 
        input_dev->name = "ttusb_dec remote control";
        input_dev->phys = dec->rc_phys;
-       input_dev->evbit[0] = BIT(EV_KEY);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY);
        input_dev->keycodesize = sizeof(u16);
        input_dev->keycodemax = 0x1a;
        input_dev->keycode = rc_keys;
index 491505d6fdeea14d4c7b9934aa656666d83eaa6e..3e93f80587708f2f118d150c8c9a0ac3cc2c3208 100644 (file)
@@ -238,8 +238,8 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev
        usb_to_input_id(dev, &input_dev->id);
        input_dev->dev.parent = &dev->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY);
-       input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY);
+       input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
 
        input_dev->private = cam;
 
index dd1a6d6bbc9eef80a81f30162f9f20ca49eaf780..d847273eeba0c247c4f707a4fed3b00feef04b3e 100644 (file)
@@ -102,8 +102,8 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev)
        usb_to_input_id(dev, &input_dev->id);
        input_dev->dev.parent = &dev->dev;
 
-       input_dev->evbit[0] = BIT(EV_KEY);
-       input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
+       input_dev->evbit[0] = BIT_MASK(EV_KEY);
+       input_dev->keybit[BIT_WORD(BTN_0)] = BIT_MASK(BTN_0);
 
        input_dev->private = cam;
 
index 0550ce075fc4f5cde48b3de4a12ea428288b7ad6..1d9defb1a10c04d442b3edde8920977d686616ad 100644 (file)
@@ -226,9 +226,9 @@ int ibmasm_init_remote_input_dev(struct service_processor *sp)
        mouse_dev->id.product = pdev->device;
        mouse_dev->id.version = 1;
        mouse_dev->dev.parent = sp->dev;
-       mouse_dev->evbit[0]  = BIT(EV_KEY) | BIT(EV_ABS);
-       mouse_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) |
-               BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
+       mouse_dev->evbit[0]  = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+       mouse_dev->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
        set_bit(BTN_TOUCH, mouse_dev->keybit);
        mouse_dev->name = "ibmasm RSA I remote mouse";
        input_set_abs_params(mouse_dev, ABS_X, 0, MOUSE_X_MAX, 0, 0);
@@ -239,7 +239,7 @@ int ibmasm_init_remote_input_dev(struct service_processor *sp)
        keybd_dev->id.product = pdev->device;
        keybd_dev->id.version = 2;
        keybd_dev->dev.parent = sp->dev;
-       keybd_dev->evbit[0]  = BIT(EV_KEY);
+       keybd_dev->evbit[0]  = BIT_MASK(EV_KEY);
        keybd_dev->name = "ibmasm RSA I remote keyboard";
 
        for (i = 0; i < XLATE_SIZE; i++) {
index e73a71f04bb41b26d10b31e4608f8e33adf8ddc6..86da96becd28101118d619d56cbe93b290005b8c 100644 (file)
@@ -411,9 +411,9 @@ static int sony_laptop_setup_input(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);
 
        error = input_register_device(jog_dev);
        if (error)
index edb8024d744bff94c1fa4c3d3abc4adaaf863802..6e35b92b1d2caeb6ee4b24f8cf7a8c7c0f158899 100644 (file)
@@ -469,8 +469,8 @@ struct hid_device {                                                 /* device report descriptor */
        /* handler for raw output data, used by hidraw */
        int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t);
 #ifdef CONFIG_USB_HIDINPUT_POWERBOOK
-       unsigned long pb_pressed_fn[NBITS(KEY_MAX)];
-       unsigned long pb_pressed_numlock[NBITS(KEY_MAX)];
+       unsigned long pb_pressed_fn[BITS_TO_LONGS(KEY_CNT)];
+       unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)];
 #endif
 };
 
index 219d220d185bc9a82b2473ad18bdde6f0e6d160e..62268929856c9d26c8a9be4b134e4d7704796aac 100644 (file)
@@ -98,6 +98,7 @@ struct input_absinfo {
 #define EV_PWR                 0x16
 #define EV_FF_STATUS           0x17
 #define EV_MAX                 0x1f
+#define EV_CNT                 (EV_MAX+1)
 
 /*
  * Synchronization events.
@@ -567,6 +568,7 @@ struct input_absinfo {
 /* We avoid low common keys in module aliases so they don't get huge. */
 #define KEY_MIN_INTERESTING    KEY_MUTE
 #define KEY_MAX                        0x1ff
+#define KEY_CNT                        (KEY_MAX+1)
 
 /*
  * Relative axes
@@ -583,6 +585,7 @@ struct input_absinfo {
 #define REL_WHEEL              0x08
 #define REL_MISC               0x09
 #define REL_MAX                        0x0f
+#define REL_CNT                        (REL_MAX+1)
 
 /*
  * Absolute axes
@@ -615,6 +618,7 @@ struct input_absinfo {
 #define ABS_VOLUME             0x20
 #define ABS_MISC               0x28
 #define ABS_MAX                        0x3f
+#define ABS_CNT                        (ABS_MAX+1)
 
 /*
  * Switch events
@@ -625,6 +629,7 @@ struct input_absinfo {
 #define SW_HEADPHONE_INSERT    0x02  /* set = inserted */
 #define SW_RADIO               0x03  /* set = radio enabled */
 #define SW_MAX                 0x0f
+#define SW_CNT                 (SW_MAX+1)
 
 /*
  * Misc events
@@ -636,6 +641,7 @@ struct input_absinfo {
 #define MSC_RAW                        0x03
 #define MSC_SCAN               0x04
 #define MSC_MAX                        0x07
+#define MSC_CNT                        (MSC_MAX+1)
 
 /*
  * LEDs
@@ -653,6 +659,7 @@ struct input_absinfo {
 #define LED_MAIL               0x09
 #define LED_CHARGING           0x0a
 #define LED_MAX                        0x0f
+#define LED_CNT                        (LED_MAX+1)
 
 /*
  * Autorepeat values
@@ -670,6 +677,7 @@ struct input_absinfo {
 #define SND_BELL               0x01
 #define SND_TONE               0x02
 #define SND_MAX                        0x07
+#define SND_CNT                        (SND_MAX+1)
 
 /*
  * IDs.
@@ -920,6 +928,7 @@ struct ff_effect {
 #define FF_AUTOCENTER  0x61
 
 #define FF_MAX         0x7f
+#define FF_CNT         (FF_MAX+1)
 
 #ifdef __KERNEL__
 
@@ -932,10 +941,6 @@ struct ff_effect {
 #include <linux/timer.h>
 #include <linux/mod_devicetable.h>
 
-#define NBITS(x) (((x)/BITS_PER_LONG)+1)
-#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
-#define LONG(x) ((x)/BITS_PER_LONG)
-
 /**
  * struct input_dev - represents an input device
  * @name: name of the device
@@ -1020,15 +1025,15 @@ struct input_dev {
        const char *uniq;
        struct input_id id;
 
-       unsigned long evbit[NBITS(EV_MAX)];
-       unsigned long keybit[NBITS(KEY_MAX)];
-       unsigned long relbit[NBITS(REL_MAX)];
-       unsigned long absbit[NBITS(ABS_MAX)];
-       unsigned long mscbit[NBITS(MSC_MAX)];
-       unsigned long ledbit[NBITS(LED_MAX)];
-       unsigned long sndbit[NBITS(SND_MAX)];
-       unsigned long ffbit[NBITS(FF_MAX)];
-       unsigned long swbit[NBITS(SW_MAX)];
+       unsigned long evbit[BITS_TO_LONGS(EV_CNT)];
+       unsigned long keybit[BITS_TO_LONGS(KEY_CNT)];
+       unsigned long relbit[BITS_TO_LONGS(REL_CNT)];
+       unsigned long absbit[BITS_TO_LONGS(ABS_CNT)];
+       unsigned long mscbit[BITS_TO_LONGS(MSC_CNT)];
+       unsigned long ledbit[BITS_TO_LONGS(LED_CNT)];
+       unsigned long sndbit[BITS_TO_LONGS(SND_CNT)];
+       unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];
+       unsigned long swbit[BITS_TO_LONGS(SW_CNT)];
 
        unsigned int keycodemax;
        unsigned int keycodesize;
@@ -1046,10 +1051,10 @@ struct input_dev {
        int abs[ABS_MAX + 1];
        int rep[REP_MAX + 1];
 
-       unsigned long key[NBITS(KEY_MAX)];
-       unsigned long led[NBITS(LED_MAX)];
-       unsigned long snd[NBITS(SND_MAX)];
-       unsigned long sw[NBITS(SW_MAX)];
+       unsigned long key[BITS_TO_LONGS(KEY_CNT)];
+       unsigned long led[BITS_TO_LONGS(LED_CNT)];
+       unsigned long snd[BITS_TO_LONGS(SND_CNT)];
+       unsigned long sw[BITS_TO_LONGS(SW_CNT)];
 
        int absmax[ABS_MAX + 1];
        int absmin[ABS_MAX + 1];
@@ -1293,7 +1298,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
        dev->absfuzz[axis] = fuzz;
        dev->absflat[axis] = flat;
 
-       dev->absbit[LONG(axis)] |= BIT(axis);
+       dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis);
 }
 
 extern struct class input_class;
@@ -1334,7 +1339,7 @@ struct ff_device {
 
        void *private;
 
-       unsigned long ffbit[NBITS(FF_MAX)];
+       unsigned long ffbit[BITS_TO_LONGS(FF_CNT)];
 
        struct mutex mutex;
 
index a6c1e8eed2265e914f90b6611902974eed726fa0..15ddd4483b09b9b94b47a9130bc0579c31468c74 100644 (file)
@@ -162,10 +162,6 @@ struct uinput_ff_erase {
 #define UI_FF_UPLOAD           1
 #define UI_FF_ERASE            2
 
-#ifndef NBITS
-#define NBITS(x) ((((x)-1)/(sizeof(long)*8))+1)
-#endif /* NBITS */
-
 #define UINPUT_MAX_NAME_SIZE   80
 struct uinput_user_dev {
        char name[UINPUT_MAX_NAME_SIZE];
index ff5784b440d792b87bf2cd088801b1b6b5b5c0af..66c736953cfe7f01a27a495681c9c779b0a240a1 100644 (file)
@@ -656,11 +656,13 @@ static inline int hidp_setup_input(struct hidp_session *session, struct hidp_con
        }
 
        if (req->subclass & 0x80) {
-               input->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-               input->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
-               input->relbit[0] = BIT(REL_X) | BIT(REL_Y);
-               input->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA);
-               input->relbit[0] |= BIT(REL_WHEEL);
+               input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+               input->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
+                       BIT_MASK(BTN_RIGHT) | BIT_MASK(BTN_MIDDLE);
+               input->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
+               input->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_SIDE) |
+                       BIT_MASK(BTN_EXTRA);
+               input->relbit[0] |= BIT_MASK(REL_WHEEL);
        }
 
        input->dev.parent = hidp_get_device(session);
index eaabf087c59b53e1dcf05af11647fdd2288d136a..d1e9d68f8ba0a003f0820f95800620d3030184cd 100644 (file)
@@ -146,18 +146,18 @@ static void rfkill_disconnect(struct input_handle *handle)
 static const struct input_device_id rfkill_ids[] = {
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
-               .evbit = { BIT(EV_KEY) },
-               .keybit = { [LONG(KEY_WLAN)] = BIT(KEY_WLAN) },
+               .evbit = { BIT_MASK(EV_KEY) },
+               .keybit = { [BIT_WORD(KEY_WLAN)] = BIT_MASK(KEY_WLAN) },
        },
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
-               .evbit = { BIT(EV_KEY) },
-               .keybit = { [LONG(KEY_BLUETOOTH)] = BIT(KEY_BLUETOOTH) },
+               .evbit = { BIT_MASK(EV_KEY) },
+               .keybit = { [BIT_WORD(KEY_BLUETOOTH)] = BIT_MASK(KEY_BLUETOOTH) },
        },
        {
                .flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
-               .evbit = { BIT(EV_KEY) },
-               .keybit = { [LONG(KEY_UWB)] = BIT(KEY_UWB) },
+               .evbit = { BIT_MASK(EV_KEY) },
+               .keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
        },
        { }
 };
index a1aa89f2faf3bc9e6f25ccb3784871d0631a49dd..566b5ab9d4e892008c95c5658746b7f4fb3aff28 100644 (file)
@@ -236,8 +236,8 @@ int __init snd_pmac_attach_beep(struct snd_pmac *chip)
        input_dev->id.product = 0x0001;
        input_dev->id.version = 0x0100;
 
-       input_dev->evbit[0] = BIT(EV_SND);
-       input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+       input_dev->evbit[0] = BIT_MASK(EV_SND);
+       input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
        input_dev->event = snd_pmac_beep_event;
        input_dev->dev.parent = &chip->pdev->dev;
        input_set_drvdata(input_dev, chip);
index a1de0c6089573c7f7bc1a700f6a16b9307309523..cd536ca20e5632d479a70e2d498da16555cfe79d 100644 (file)
@@ -200,8 +200,9 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *dev)
 
         switch (dev->chip.usb_id) {
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2):
-               input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-               input->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_Z);
+               input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+               input->absbit[0] = BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) |
+                       BIT_MASK(ABS_Z);
                input->keycode = keycode_rk2;
                input->keycodesize = sizeof(char);
                input->keycodemax = ARRAY_SIZE(keycode_rk2);
@@ -228,8 +229,8 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *dev)
                snd_usb_caiaq_set_auto_msg(dev, 1, 10, 0);
                break;
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
-               input->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
-               input->absbit[0] = BIT(ABS_X);
+               input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
+               input->absbit[0] = BIT_MASK(ABS_X);
                input->keycode = keycode_ak1;
                input->keycodesize = sizeof(char);
                input->keycodemax = ARRAY_SIZE(keycode_ak1);