lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 14 Dec 2010 14:50:17 +0100 (CET)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Florian@....proxad.net, Fainelli@....proxad.net
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	Florian Fainelli <ffainelli@...ebox.fr>
Subject: Re: [PATCH] HID: replace offsets values with their corresponding
 BTN_* defines

On Tue, 14 Dec 2010, Florian@....proxad.net wrote:

> From: Florian Fainelli <ffainelli@...ebox.fr>
> 
> Instead of using magic values, use their corresponding BTN_* defines
> from linux/input.h.
> 
> Signed-off-by: Florian Fainelli <ffainelli@...ebox.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ