Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1a54f49e8989462cfc9cab0c377b2d4e60e5b70a
Commit:     1a54f49e8989462cfc9cab0c377b2d4e60e5b70a
Parent:     0038cae0ffd72b75699010bd112655dc2615e2fd
Author:     Rene van Paassen <[EMAIL PROTECTED]>
AuthorDate: Mon May 21 00:31:55 2007 -0400
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 00:35:16 2007 -0400

    Input: aiptek - use set_bit instead of bitwise or
    
    Have to use set_bit since some bit values are over 32, and bitwise or
    won't work on these. To be safe for the future too, use set_bit for all
    input dev capabilities
    
    Signed-off-by: Rene van Paassen <[EMAIL PROTECTED]>
    Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/tablet/aiptek.c |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index c182877..8c62afe 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -329,6 +329,19 @@ struct aiptek {
        unsigned char *data;                    /* incoming packet data         
 */
 };
 
+static const int eventTypes[] = {
+        EV_KEY, EV_ABS, EV_REL, EV_MSC,
+};
+
+static const int absEvents[] = {
+        ABS_X, ABS_Y, ABS_PRESSURE, ABS_TILT_X, ABS_TILT_Y,
+        ABS_WHEEL, ABS_MISC,
+};
+
+static const int relEvents[] = {
+        REL_X, REL_Y, REL_WHEEL,
+};
+
 static const int buttonEvents[] = {
        BTN_LEFT, BTN_RIGHT, BTN_MIDDLE,
        BTN_TOOL_PEN, BTN_TOOL_RUBBER, BTN_TOOL_PENCIL, BTN_TOOL_AIRBRUSH,
@@ -1727,17 +1740,16 @@ aiptek_probe(struct usb_interface *intf, const struct 
usb_device_id *id)
        /* Now program the capacities of the tablet, in terms of being
         * an input device.
         */
-       inputdev->evbit[0] |= BIT(EV_KEY)
-           | BIT(EV_ABS)
-           | BIT(EV_REL)
-           | BIT(EV_MSC);
+       for (i = 0; i < ARRAY_SIZE(eventTypes); ++i)
+               __set_bit(eventTypes[i], inputdev->evbit);
 
-       inputdev->absbit[0] |= BIT(ABS_MISC);
+       for (i = 0; i < ARRAY_SIZE(absEvents); ++i)
+               __set_bit(absEvents[i], inputdev->absbit);
 
-       inputdev->relbit[0] |=
-           (BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL) | BIT(REL_MISC));
+       for (i = 0; i < ARRAY_SIZE(relEvents); ++i)
+               __set_bit(relEvents[i], inputdev->relbit);
 
-       inputdev->mscbit[0] = BIT(MSC_SERIAL);
+       __set_bit(MSC_SERIAL, inputdev->mscbit);
 
        /* Set up key and button codes */
        for (i = 0; i < ARRAY_SIZE(buttonEvents); ++i)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to