From: Dan Carpenter Date: Sat, 29 Oct 2011 07:20:42 +0000 (+0300) Subject: Staging: iio/dac/ad5064.c: signedness bug in ad5064_read_raw() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=23a3b8cc9ce1bec3e21ca6e90566cf30caa760e5;p=linux-beck.git Staging: iio/dac/ad5064.c: signedness bug in ad5064_read_raw() regulator_get_voltage() returns an int so "scale_uv" should be an int. Making it unsigned here breaks the error handling. Signed-off-by: Dan Carpenter Acked-by: Lars-Peter Clausen Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/dac/ad5064.c b/drivers/staging/iio/dac/ad5064.c index a701063a9267..867e4ab1ff63 100644 --- a/drivers/staging/iio/dac/ad5064.c +++ b/drivers/staging/iio/dac/ad5064.c @@ -280,8 +280,8 @@ static int ad5064_read_raw(struct iio_dev *indio_dev, long m) { struct ad5064_state *st = iio_priv(indio_dev); - unsigned long scale_uv; unsigned int vref; + int scale_uv; switch (m) { case 0: