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

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 <sst@poczta.fm>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Slawomir Stepien and committed by
Jonathan Cameron
fdee2ca1 2eb4c9f2

+3 -3
+3 -3
drivers/staging/iio/adc/ad7280a.c
··· 601 601 struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); 602 602 unsigned int val; 603 603 604 - switch ((u32)this_attr->address) { 604 + switch (this_attr->address) { 605 605 case AD7280A_CELL_OVERVOLTAGE: 606 606 val = 1000 + (st->cell_threshhigh * 1568) / 100; 607 607 break; ··· 637 637 if (ret) 638 638 return ret; 639 639 640 - switch ((u32)this_attr->address) { 640 + switch (this_attr->address) { 641 641 case AD7280A_CELL_OVERVOLTAGE: 642 642 case AD7280A_CELL_UNDERVOLTAGE: 643 643 val = ((val - 1000) * 100) / 1568; /* LSB 15.68mV */ ··· 653 653 val = clamp(val, 0L, 0xFFL); 654 654 655 655 mutex_lock(&st->lock); 656 - switch ((u32)this_attr->address) { 656 + switch (this_attr->address) { 657 657 case AD7280A_CELL_OVERVOLTAGE: 658 658 st->cell_threshhigh = val; 659 659 break;