* [PATCH] HID: replace offsets values with their corresponding BTN_* defines
@ 2010-12-14 10:56 Florian, Fainelli
2010-12-14 13:50 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Florian, Fainelli @ 2010-12-14 10:56 UTC (permalink / raw)
To: jkosina; +Cc: linux-input, linux-kernel, Florian Fainelli
From: Florian Fainelli <ffainelli@freebox.fr>
Instead of using magic values, use their corresponding BTN_* defines
from linux/input.h.
Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
---
drivers/hid/hid-input.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index d8d372b..f505789 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -319,21 +319,21 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
switch (field->application) {
case HID_GD_MOUSE:
- case HID_GD_POINTER: code += 0x110; break;
+ case HID_GD_POINTER: code += BTN_MOUSE; break;
case HID_GD_JOYSTICK:
if (code <= 0xf)
code += BTN_JOYSTICK;
else
code += BTN_TRIGGER_HAPPY;
break;
- case HID_GD_GAMEPAD: code += 0x130; break;
+ case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
default:
switch (field->physical) {
case HID_GD_MOUSE:
- case HID_GD_POINTER: code += 0x110; break;
- case HID_GD_JOYSTICK: code += 0x120; break;
- case HID_GD_GAMEPAD: code += 0x130; break;
- default: code += 0x100;
+ case HID_GD_POINTER: code += BTN_MOUSE; break;
+ case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
+ case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
+ default: code += BTN_MISC;
}
}
--
1.5.6.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: replace offsets values with their corresponding BTN_* defines
2010-12-14 10:56 [PATCH] HID: replace offsets values with their corresponding BTN_* defines Florian, Fainelli
@ 2010-12-14 13:50 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2010-12-14 13:50 UTC (permalink / raw)
To: Florian, Fainelli; +Cc: linux-input, linux-kernel, Florian Fainelli
On Tue, 14 Dec 2010, Florian@zmc.proxad.net wrote:
> From: Florian Fainelli <ffainelli@freebox.fr>
>
> Instead of using magic values, use their corresponding BTN_* defines
> from linux/input.h.
>
> Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
Applied, thanks Florian.
> ---
> drivers/hid/hid-input.c | 12 ++++++------
> 1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index d8d372b..f505789 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -319,21 +319,21 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
>
> switch (field->application) {
> case HID_GD_MOUSE:
> - case HID_GD_POINTER: code += 0x110; break;
> + case HID_GD_POINTER: code += BTN_MOUSE; break;
> case HID_GD_JOYSTICK:
> if (code <= 0xf)
> code += BTN_JOYSTICK;
> else
> code += BTN_TRIGGER_HAPPY;
> break;
> - case HID_GD_GAMEPAD: code += 0x130; break;
> + case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
> default:
> switch (field->physical) {
> case HID_GD_MOUSE:
> - case HID_GD_POINTER: code += 0x110; break;
> - case HID_GD_JOYSTICK: code += 0x120; break;
> - case HID_GD_GAMEPAD: code += 0x130; break;
> - default: code += 0x100;
> + case HID_GD_POINTER: code += BTN_MOUSE; break;
> + case HID_GD_JOYSTICK: code += BTN_JOYSTICK; break;
> + case HID_GD_GAMEPAD: code += BTN_GAMEPAD; break;
> + default: code += BTN_MISC;
> }
> }
>
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-14 13:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-14 10:56 [PATCH] HID: replace offsets values with their corresponding BTN_* defines Florian, Fainelli
2010-12-14 13:50 ` Jiri Kosina
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.