From: Michael Hennerich Date: Tue, 25 Oct 2011 08:51:04 +0000 (+0200) Subject: iio: introduce type casts to avoid __ucmpdi2 calls X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e15fbc91a4304a977ed99c3eb21bab7015e86c11;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git iio: introduce type casts to avoid __ucmpdi2 calls This patch type casts the switch control variable to 32 bits in order to prevent a call __ucmpdi2 generated by some versions of gcc. This fixes an undefined reference to `__ucmpdi2' when compiled for arch/blackfin Signed-off-by: Michael Hennerich Acked-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 31c376b9d5eb..d8bf559fef87 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -795,7 +795,7 @@ static ssize_t ad7192_set(struct device *dev, return -EBUSY; } - switch (this_attr->address) { + switch ((u32) this_attr->address) { case AD7192_REG_GPOCON: if (val) st->gpocon |= AD7192_GPOCON_BPDSW; diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 372d059042f9..0c212e050a8d 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -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; diff --git a/drivers/staging/iio/dds/ad9832.c b/drivers/staging/iio/dds/ad9832.c index 9b4ff6065359..b58baec4da8e 100644 --- a/drivers/staging/iio/dds/ad9832.c +++ b/drivers/staging/iio/dds/ad9832.c @@ -88,7 +88,7 @@ static ssize_t ad9832_write(struct device *dev, goto error_ret; mutex_lock(&indio_dev->mlock); - switch (this_attr->address) { + switch ((u32) this_attr->address) { case AD9832_FREQ0HM: case AD9832_FREQ1HM: ret = ad9832_write_frequency(st, this_attr->address, val); diff --git a/drivers/staging/iio/dds/ad9834.c b/drivers/staging/iio/dds/ad9834.c index c468f696fe25..2e29f6f1073c 100644 --- a/drivers/staging/iio/dds/ad9834.c +++ b/drivers/staging/iio/dds/ad9834.c @@ -77,7 +77,7 @@ static ssize_t ad9834_write(struct device *dev, goto error_ret; mutex_lock(&indio_dev->mlock); - switch (this_attr->address) { + switch ((u32) this_attr->address) { case AD9834_REG_FREQ0: case AD9834_REG_FREQ1: ret = ad9834_write_frequency(st, this_attr->address, val); @@ -153,7 +153,7 @@ static ssize_t ad9834_store_wavetype(struct device *dev, mutex_lock(&indio_dev->mlock); - switch (this_attr->address) { + switch ((u32) this_attr->address) { case 0: if (sysfs_streq(buf, "sine")) { st->control &= ~AD9834_MODE; diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 1086e0befc28..ece770766426 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c @@ -329,7 +329,7 @@ static ssize_t ad5933_show(struct device *dev, int ret = 0, len = 0; mutex_lock(&indio_dev->mlock); - switch (this_attr->address) { + switch ((u32) this_attr->address) { case AD5933_OUT_RANGE: len = sprintf(buf, "%d\n", st->range_avail[(st->ctrl_hb >> 1) & 0x3]); @@ -380,7 +380,7 @@ static ssize_t ad5933_store(struct device *dev, } mutex_lock(&indio_dev->mlock); - switch (this_attr->address) { + switch ((u32) this_attr->address) { case AD5933_OUT_RANGE: for (i = 0; i < 4; i++) if (val == st->range_avail[i]) {