Commit 685e0107 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Staging: iio/dac/ad5360.c: signedness bug in ad5360_read_raw()

ad5360_get_channel_vref() returns an int and scale_uv should be the
same.  Making it unsigned here breaks the error handling.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 23a3b8cc
...@@ -371,8 +371,8 @@ static int ad5360_read_raw(struct iio_dev *indio_dev, ...@@ -371,8 +371,8 @@ static int ad5360_read_raw(struct iio_dev *indio_dev,
long m) long m)
{ {
struct ad5360_state *st = iio_priv(indio_dev); struct ad5360_state *st = iio_priv(indio_dev);
unsigned long scale_uv;
unsigned int ofs_index; unsigned int ofs_index;
int scale_uv;
int ret; int ret;
switch (m) { switch (m) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment