Staging: iio/dac/ad5360.c: signedness bug in
Subsystems (5)
PATCH 1/1 Staging: iio/dac/ad5360.c: signedness bug in
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 Dan Carpenter <[email protected]>
drivers/staging/iio/dac/ad5360.c +1 -1
@@ -371,8 +371,8 @@ static int ad5360_read_raw(struct iio_dev *indio_dev, long m) {struct ad5360_state *st =iio_priv (indio_dev); -unsigned long scale_uv;unsigned int ofs_index; +int scale_uv;int ret;switch (m) {
Re: [patch] Staging: iio/dac/ad5360.c: signedness bug in ad5360_read_raw()
Quoted 5 lines · Dan Carpenter
ad5360_get_channel_vref()returns an int andscale_uvshould be the same. Making it unsigned here breaks the error handling.Signed-off-by Dan Carpenter <[email protected]>
Thanks.
Quoted 14 lines
drivers/staging/iio/dac/ad5360.c +1
-1@@ -371,8 +371,8 @@ static int ad5360_read_raw(struct iio_dev *indio_dev, long m) {struct ad5360_state *st =iio_priv (indio_dev); -unsigned long scale_uv;unsigned int ofs_index; +int scale_uv;int ret;switch (m) {
Jonathan Cameron
Acked-byRe: [patch] Staging: iio/dac/ad5360.c: signedness bug in ad5360_read_raw()
Quoted 8 lines · Lars-Peter Clausen
Quoted 5 lines · Dan Carpenter
ad5360_get_channel_vref()returns an int andscale_uvshould be the same. Making it unsigned here breaks the error handling.Signed-off-by Dan Carpenter <[email protected]>
Acked-by Jonathan Cameron <jic23cam.ac.uk>
Quoted 19 lines
Thanks.
Quoted 14 lines
drivers/staging/iio/dac/ad5360.c +1
-1@@ -371,8 +371,8 @@ static int ad5360_read_raw(struct iio_dev *indio_dev, long m) {struct ad5360_state *st =iio_priv (indio_dev); -unsigned long scale_uv;unsigned int ofs_index; +int scale_uv;int ret;switch (m) {