From: Jiri Kosina Date: Wed, 17 Feb 2010 08:36:35 +0000 (+0100) Subject: HID: extend mask for BUTTON usage page X-Git-Tag: firefly_0821_release~9833^2~3115^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f978b9bf535cbbd1ae8d9fbdd7c4f60ab38f260;p=firefly-linux-kernel-4.4.55.git HID: extend mask for BUTTON usage page Now that joystick button usages can expand over 15 buttons, we have to properly mask out the code from hid usage to cover the whole 0xffff available space. Reported-by: Stefan Bader Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index a01a1b0de1c3..79d9edd0bdfa 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -193,7 +193,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel break; case HID_UP_BUTTON: - code = ((usage->hid - 1) & 0xf); + code = ((usage->hid - 1) & HID_USAGE); switch (field->application) { case HID_GD_MOUSE: