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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 7 Dec 2009 20:24:18 -0800
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Gary Stein <lordcnidarian@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] driver/input/ff-memless.c

Hi Gary,

On Mon, Dec 07, 2009 at 02:37:30PM -0500, Gary Stein wrote:
> I was experiencing force feedback joystick issues in my Force 3D Pro and
> when developing a new driver for the new Logitech G940 after I
> recompiled my kernel.
> 
> I was able to track it down to a signed vs unsigned problem in
> ff-memless.c and gcc 4.4.2.
> The code in question did not seem to give a problem with gcc 4.2.4.
> 
> According to gitweb, a signed vs unsigned was changed on May 8th by
> Jussi Kivilinna <jussi.kivilinna@...et.fi>
> Input: ff-memless - fix signed to unsigned bit overflow
> 
> to change the gain from a signed to an unsigned int to fix a rumble
> issue, but it appears to broke a the
> constant force section of the code.
> 
> It is a simple, cast to fix and should not have any ill effects.
> 

Could I please have your "Signed-off-by: ..."? Thanks.

> gary
> 
> 
> --- linux-2.6.31.orig/drivers/input/ff-memless.c	2009-09-09
> 17:13:59.000000000 -0500
> +++ linux-2.6.31.int/drivers/input/ff-memless.c	2009-12-07
> 15:09:22.000000000 -0500
> @@ -239,8 +239,8 @@
>  		level = fixp_new16(apply_envelope(state,
>  					new->u.constant.level,
>  					&new->u.constant.envelope));
> -		x = fixp_mult(fixp_sin(i), level) * gain / 0xffff;
> -		y = fixp_mult(-fixp_cos(i), level) * gain / 0xffff;
> +		x = (int)(fixp_mult(fixp_sin(i), level) * gain) / 0xffff;
> +		y = (int)(fixp_mult(-fixp_cos(i), level) * gain) / 0xffff;
>  		/*
>  		 * here we abuse ff_ramp to hold x and y of constant force
>  		 * If in future any driver wants something else than x and y

-- 
Dmitry
--
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