diff options
author | Fengguang Wu <wfg@mail.ustc.edu.cn> | 2007-12-07 03:35:14 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-01-28 08:51:22 -0500 |
commit | 70d215c4a7dfbddc138a2dd726d8f80f3e6d2622 (patch) | |
tree | 68e38ea2f3f0df7a51b73e6d150b74a780c67a6e /drivers | |
parent | c4124c9b68bf8ecf1e8afedad3a22e18666cb6f3 (diff) |
HID: the `bit' in hidinput_mapping_quirks() is an out parameter
Fix a panic, by changing
hidinput_mapping_quirks(,, unsigned long *bit,)
to
hidinput_mapping_quirks(,, unsigned long **bit,)
The `bit' in this function is an out parameter.
Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/hid-input-quirks.c | 36 | ||||
-rw-r--r-- | drivers/hid/hid-input.c | 2 |
2 files changed, 19 insertions, 19 deletions
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c index fbe8b6de1a63..4bcdc9bb658e 100644 --- a/drivers/hid/hid-input-quirks.c +++ b/drivers/hid/hid-input-quirks.c | |||
@@ -16,16 +16,16 @@ | |||
16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
17 | #include <linux/hid.h> | 17 | #include <linux/hid.h> |
18 | 18 | ||
19 | #define map_abs(c) do { usage->code = c; usage->type = EV_ABS; bit = input->absbit; *max = ABS_MAX; } while (0) | 19 | #define map_abs(c) do { usage->code = c; usage->type = EV_ABS; *bit = input->absbit; *max = ABS_MAX; } while (0) |
20 | #define map_rel(c) do { usage->code = c; usage->type = EV_REL; bit = input->relbit; *max = REL_MAX; } while (0) | 20 | #define map_rel(c) do { usage->code = c; usage->type = EV_REL; *bit = input->relbit; *max = REL_MAX; } while (0) |
21 | #define map_key(c) do { usage->code = c; usage->type = EV_KEY; bit = input->keybit; *max = KEY_MAX; } while (0) | 21 | #define map_key(c) do { usage->code = c; usage->type = EV_KEY; *bit = input->keybit; *max = KEY_MAX; } while (0) |
22 | #define map_led(c) do { usage->code = c; usage->type = EV_LED; bit = input->ledbit; *max = LED_MAX; } while (0) | 22 | #define map_led(c) do { usage->code = c; usage->type = EV_LED; *bit = input->ledbit; *max = LED_MAX; } while (0) |
23 | 23 | ||
24 | #define map_abs_clear(c) do { map_abs(c); clear_bit(c, bit); } while (0) | 24 | #define map_abs_clear(c) do { map_abs(c); clear_bit(c, *bit); } while (0) |
25 | #define map_key_clear(c) do { map_key(c); clear_bit(c, bit); } while (0) | 25 | #define map_key_clear(c) do { map_key(c); clear_bit(c, *bit); } while (0) |
26 | 26 | ||
27 | static int quirk_belkin_wkbd(struct hid_usage *usage, struct input_dev *input, | 27 | static int quirk_belkin_wkbd(struct hid_usage *usage, struct input_dev *input, |
28 | unsigned long *bit, int *max) | 28 | unsigned long **bit, int *max) |
29 | { | 29 | { |
30 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) | 30 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) |
31 | return 0; | 31 | return 0; |
@@ -41,7 +41,7 @@ static int quirk_belkin_wkbd(struct hid_usage *usage, struct input_dev *input, | |||
41 | } | 41 | } |
42 | 42 | ||
43 | static int quirk_cherry_cymotion(struct hid_usage *usage, struct input_dev *input, | 43 | static int quirk_cherry_cymotion(struct hid_usage *usage, struct input_dev *input, |
44 | unsigned long *bit, int *max) | 44 | unsigned long **bit, int *max) |
45 | { | 45 | { |
46 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) | 46 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) |
47 | return 0; | 47 | return 0; |
@@ -57,7 +57,7 @@ static int quirk_cherry_cymotion(struct hid_usage *usage, struct input_dev *inpu | |||
57 | } | 57 | } |
58 | 58 | ||
59 | static int quirk_logitech_ultrax_remote(struct hid_usage *usage, struct input_dev *input, | 59 | static int quirk_logitech_ultrax_remote(struct hid_usage *usage, struct input_dev *input, |
60 | unsigned long *bit, int *max) | 60 | unsigned long **bit, int *max) |
61 | { | 61 | { |
62 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) | 62 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) |
63 | return 0; | 63 | return 0; |
@@ -90,7 +90,7 @@ static int quirk_logitech_ultrax_remote(struct hid_usage *usage, struct input_de | |||
90 | } | 90 | } |
91 | 91 | ||
92 | static int quirk_chicony_tactical_pad(struct hid_usage *usage, struct input_dev *input, | 92 | static int quirk_chicony_tactical_pad(struct hid_usage *usage, struct input_dev *input, |
93 | unsigned long *bit, int *max) | 93 | unsigned long **bit, int *max) |
94 | { | 94 | { |
95 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) | 95 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) |
96 | return 0; | 96 | return 0; |
@@ -115,7 +115,7 @@ static int quirk_chicony_tactical_pad(struct hid_usage *usage, struct input_dev | |||
115 | } | 115 | } |
116 | 116 | ||
117 | static int quirk_microsoft_ergonomy_kb(struct hid_usage *usage, struct input_dev *input, | 117 | static int quirk_microsoft_ergonomy_kb(struct hid_usage *usage, struct input_dev *input, |
118 | unsigned long *bit, int *max) | 118 | unsigned long **bit, int *max) |
119 | { | 119 | { |
120 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) | 120 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) |
121 | return 0; | 121 | return 0; |
@@ -138,7 +138,7 @@ static int quirk_microsoft_ergonomy_kb(struct hid_usage *usage, struct input_dev | |||
138 | } | 138 | } |
139 | 139 | ||
140 | static int quirk_microsoft_presenter_8k(struct hid_usage *usage, struct input_dev *input, | 140 | static int quirk_microsoft_presenter_8k(struct hid_usage *usage, struct input_dev *input, |
141 | unsigned long *bit, int *max) | 141 | unsigned long **bit, int *max) |
142 | { | 142 | { |
143 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) | 143 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) |
144 | return 0; | 144 | return 0; |
@@ -156,7 +156,7 @@ static int quirk_microsoft_presenter_8k(struct hid_usage *usage, struct input_de | |||
156 | } | 156 | } |
157 | 157 | ||
158 | static int quirk_petalynx_remote(struct hid_usage *usage, struct input_dev *input, | 158 | static int quirk_petalynx_remote(struct hid_usage *usage, struct input_dev *input, |
159 | unsigned long *bit, int *max) | 159 | unsigned long **bit, int *max) |
160 | { | 160 | { |
161 | if (((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) && | 161 | if (((usage->hid & HID_USAGE_PAGE) != HID_UP_LOGIVENDOR) && |
162 | ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER)) | 162 | ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER)) |
@@ -184,7 +184,7 @@ static int quirk_petalynx_remote(struct hid_usage *usage, struct input_dev *inpu | |||
184 | } | 184 | } |
185 | 185 | ||
186 | static int quirk_logitech_wireless(struct hid_usage *usage, struct input_dev *input, | 186 | static int quirk_logitech_wireless(struct hid_usage *usage, struct input_dev *input, |
187 | unsigned long *bit, int *max) | 187 | unsigned long **bit, int *max) |
188 | { | 188 | { |
189 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) | 189 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) |
190 | return 0; | 190 | return 0; |
@@ -236,7 +236,7 @@ static int quirk_logitech_wireless(struct hid_usage *usage, struct input_dev *in | |||
236 | } | 236 | } |
237 | 237 | ||
238 | static int quirk_cherry_genius_29e(struct hid_usage *usage, struct input_dev *input, | 238 | static int quirk_cherry_genius_29e(struct hid_usage *usage, struct input_dev *input, |
239 | unsigned long *bit, int *max) | 239 | unsigned long **bit, int *max) |
240 | { | 240 | { |
241 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) | 241 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) |
242 | return 0; | 242 | return 0; |
@@ -254,7 +254,7 @@ static int quirk_cherry_genius_29e(struct hid_usage *usage, struct input_dev *in | |||
254 | } | 254 | } |
255 | 255 | ||
256 | static int quirk_btc_8193(struct hid_usage *usage, struct input_dev *input, | 256 | static int quirk_btc_8193(struct hid_usage *usage, struct input_dev *input, |
257 | unsigned long *bit, int *max) | 257 | unsigned long **bit, int *max) |
258 | { | 258 | { |
259 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) | 259 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) |
260 | return 0; | 260 | return 0; |
@@ -307,7 +307,7 @@ static int quirk_btc_8193(struct hid_usage *usage, struct input_dev *input, | |||
307 | static const struct hid_input_blacklist { | 307 | static const struct hid_input_blacklist { |
308 | __u16 idVendor; | 308 | __u16 idVendor; |
309 | __u16 idProduct; | 309 | __u16 idProduct; |
310 | int (*quirk)(struct hid_usage *, struct input_dev *, unsigned long *, int *); | 310 | int (*quirk)(struct hid_usage *, struct input_dev *, unsigned long **, int *); |
311 | } hid_input_blacklist[] = { | 311 | } hid_input_blacklist[] = { |
312 | { VENDOR_ID_BELKIN, DEVICE_ID_BELKIN_WIRELESS_KEYBOARD, quirk_belkin_wkbd }, | 312 | { VENDOR_ID_BELKIN, DEVICE_ID_BELKIN_WIRELESS_KEYBOARD, quirk_belkin_wkbd }, |
313 | 313 | ||
@@ -335,7 +335,7 @@ static const struct hid_input_blacklist { | |||
335 | 335 | ||
336 | int hidinput_mapping_quirks(struct hid_usage *usage, | 336 | int hidinput_mapping_quirks(struct hid_usage *usage, |
337 | struct input_dev *input, | 337 | struct input_dev *input, |
338 | unsigned long *bit, int *max) | 338 | unsigned long **bit, int *max) |
339 | { | 339 | { |
340 | struct hid_device *device = input_get_drvdata(input); | 340 | struct hid_device *device = input_get_drvdata(input); |
341 | int i = 0; | 341 | int i = 0; |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index aeb018e31bfc..5325d98b4328 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -382,7 +382,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
382 | } | 382 | } |
383 | 383 | ||
384 | /* handle input mappings for quirky devices */ | 384 | /* handle input mappings for quirky devices */ |
385 | ret = hidinput_mapping_quirks(usage, input, bit, &max); | 385 | ret = hidinput_mapping_quirks(usage, input, &bit, &max); |
386 | if (ret) | 386 | if (ret) |
387 | goto mapped; | 387 | goto mapped; |
388 | 388 | ||