Re: [PATCH] staging: iio: ade7759: fix signed extension bug on shift of a u8

2017-09-30 Thread Jonathan Cameron
On Wed, 13 Sep 2017 18:02:02 +0100 Colin King wrote: > From: Colin Ian King > > The current shift of st->rx[2] left shifts a u8 24 bits left, > promotes the integer to a an int and then to a unsigned u64. If > the top bit of st->rx[2] is set then we end up with all the upper > bits being set to

[PATCH] staging: iio: ade7759: fix signed extension bug on shift of a u8

2017-09-13 Thread Colin King
From: Colin Ian King The current shift of st->rx[2] left shifts a u8 24 bits left, promotes the integer to a an int and then to a unsigned u64. If the top bit of st->rx[2] is set then we end up with all the upper bits being set to 1. Fix this by casting st->rx[2] to a u64 before the 24 bit left s