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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 15 May 2014 21:11:23 +0000
From:	Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:	Andrew Duggan <aduggan@...aptics.com>
Cc:	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	Jiri Kosina <jkosina@...e.cz>
Subject: Re: [PATCH] HID: rmi: fix masks for x and w_x data

On May 15 2014 or thereabouts, Andrew Duggan wrote:
> The F11 data in the HID report contains four bits of data for w_x and the least significant bits
> of x. Currently only the first three bits are being used which is resulting in small jumps in
> the position data on the x axis and in the w_x data.
> 
> Signed-off-by: Andrew Duggan <aduggan@...aptics.com>
> ---

Good catch. I might have considered that 3:0 means 3 bits, not 4. I must
have been tired while writing it :)

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>

Cheers,
Benjamin

>  drivers/hid/hid-rmi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
> index 7ebdc96..c529b03 100644
> --- a/drivers/hid/hid-rmi.c
> +++ b/drivers/hid/hid-rmi.c
> @@ -277,9 +277,9 @@ static void rmi_f11_process_touch(struct rmi_data *hdata, int slot,
>  	input_mt_report_slot_state(hdata->input, MT_TOOL_FINGER,
>  			finger_state == 0x01);
>  	if (finger_state == 0x01) {
> -		x = (touch_data[0] << 4) | (touch_data[2] & 0x07);
> +		x = (touch_data[0] << 4) | (touch_data[2] & 0x0F);
>  		y = (touch_data[1] << 4) | (touch_data[2] >> 4);
> -		wx = touch_data[3] & 0x07;
> +		wx = touch_data[3] & 0x0F;
>  		wy = touch_data[3] >> 4;
>  		wide = (wx > wy);
>  		major = max(wx, wy);
> -- 
> 1.9.1
> 
--
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