Skip to content

Commit

Permalink
staging:iio:resolver:ad2s1210 fix negative IIO_ANGL_VEL read
Browse files Browse the repository at this point in the history
gcc-7 points out an older regression:

drivers/staging/iio/resolver/ad2s1210.c: In function 'ad2s1210_read_raw':
drivers/staging/iio/resolver/ad2s1210.c:515:42: error: '<<' in boolean context, did you mean '<' ? [-Werror=int-in-bool-context]

The original code had 'unsigned short' here, but incorrectly got
converted to 'bool'. This reverts the regression and uses a normal
type instead.

Fixes: 2914854 ("staging:iio:resolver:ad2s1210 minimal chan spec conversion.")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
arndb authored and jic23 committed Jul 15, 2017
1 parent 3091141 commit 105967a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/iio/resolver/ad2s1210.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
long m)
{
struct ad2s1210_state *st = iio_priv(indio_dev);
bool negative;
u16 negative;
int ret = 0;
u16 pos;
s16 vel;
Expand Down

0 comments on commit 105967a

Please sign in to comment.