iio: introduce type casts to avoid __ucmpdi2 calls
[firefly-linux-kernel-4.4.55.git] / drivers / staging / iio / adc / ad7280a.c
index 372d059042f9bbbd456615b4236826032aa7cbe6..0c212e050a8dfa788f0dfa0da8340c7d17cd3427 100644 (file)
@@ -600,7 +600,7 @@ static ssize_t ad7280_read_channel_config(struct device *dev,
        struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
        unsigned val;
 
-       switch (this_attr->address) {
+       switch ((u32) this_attr->address) {
        case AD7280A_CELL_OVERVOLTAGE:
                val = 1000 + (st->cell_threshhigh * 1568) / 100;
                break;
@@ -636,7 +636,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev,
        if (ret)
                return ret;
 
-       switch (this_attr->address) {
+       switch ((u32) this_attr->address) {
        case AD7280A_CELL_OVERVOLTAGE:
        case AD7280A_CELL_UNDERVOLTAGE:
                val = ((val - 1000) * 100) / 1568; /* LSB 15.68mV */
@@ -652,7 +652,7 @@ static ssize_t ad7280_write_channel_config(struct device *dev,
        val = clamp(val, 0L, 0xFFL);
 
        mutex_lock(&indio_dev->mlock);
-       switch (this_attr->address) {
+       switch ((u32) this_attr->address) {
        case AD7280A_CELL_OVERVOLTAGE:
                st->cell_threshhigh = val;
                break;