From fdee2ca14bcaecbd5738c679f91acbab74b349aa Mon Sep 17 00:00:00 2001 From: Slawomir Stepien Date: Fri, 26 Oct 2018 18:53:10 +0200 Subject: [PATCH] staging: iio: adc: ad7280a: don't cast type inside switch expression The type promotion will kick in, so the comparison will work. Signed-off-by: Slawomir Stepien Signed-off-by: Jonathan Cameron --- drivers/staging/iio/adc/ad7280a.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 7161998c8a0e..89c2c2deca64 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -601,7 +601,7 @@ static ssize_t ad7280_read_channel_config(struct device *dev, struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); unsigned int val; - switch ((u32)this_attr->address) { + switch (this_attr->address) { case AD7280A_CELL_OVERVOLTAGE: val = 1000 + (st->cell_threshhigh * 1568) / 100; break; @@ -637,7 +637,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev, if (ret) return ret; - switch ((u32)this_attr->address) { + switch (this_attr->address) { case AD7280A_CELL_OVERVOLTAGE: case AD7280A_CELL_UNDERVOLTAGE: val = ((val - 1000) * 100) / 1568; /* LSB 15.68mV */ @@ -653,7 +653,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev, val = clamp(val, 0L, 0xFFL); mutex_lock(&st->lock); - switch ((u32)this_attr->address) { + switch (this_attr->address) { case AD7280A_CELL_OVERVOLTAGE: st->cell_threshhigh = val; break; -- 2.11.0