Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: accel: mma8452: define unsigned return values where appropriate

smatch warned:
sval_binop_signed: invalid divide LLONG_MIN/-1

and this fixes it. It's actually good to have, in order to avoid accidental
checking for negative return values here.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Martin Kepplinger and committed by
Jonathan Cameron
32b28076 25fc503e

+2 -2
+2 -2
drivers/iio/accel/mma8452.c
··· 248 248 return -EINVAL; 249 249 } 250 250 251 - static int mma8452_get_odr_index(struct mma8452_data *data) 251 + static unsigned int mma8452_get_odr_index(struct mma8452_data *data) 252 252 { 253 253 return (data->ctrl_reg1 & MMA8452_CTRL_DR_MASK) >> 254 254 MMA8452_CTRL_DR_SHIFT; ··· 260 260 }; 261 261 262 262 /* Datasheet table: step time "Relationship with the ODR" (sample frequency) */ 263 - static const int mma8452_transient_time_step_us[4][8] = { 263 + static const unsigned int mma8452_transient_time_step_us[4][8] = { 264 264 { 1250, 2500, 5000, 10000, 20000, 20000, 20000, 20000 }, /* normal */ 265 265 { 1250, 2500, 5000, 10000, 20000, 80000, 80000, 80000 }, /* l p l n */ 266 266 { 1250, 2500, 2500, 2500, 2500, 2500, 2500, 2500 }, /* high res*/