From: Rasmus Villemoes Date: Thu, 22 Jan 2015 23:09:56 +0000 (+0100) Subject: staging: iio: ad2s1200: Fix sign extension X-Git-Tag: omap-for-v4.1/wl12xx-dt~47^2~4^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7067a5ad717d4dbb4faa3ec56744152f6ba97ad;p=pandora-kernel.git staging: iio: ad2s1200: Fix sign extension The line above makes vel a 12-bit quantity (st->rx[] is u8). The intention is to sign-extend vel using bit 11 as the sign bit. But because of C's promotion rules "vel = (vel << 4) >> 4;" is actually a no-op, since vel is promoted to int before the inner shift. sign_extend32 works equally well for 8 and 16 bits types, so use that. Signed-off-by: Rasmus Villemoes Acked-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- Reading git-diff-tree failed