iio: introduce type casts to avoid __ucmpdi2 calls
authorMichael Hennerich <michael.hennerich@analog.com>
Tue, 25 Oct 2011 08:51:04 +0000 (10:51 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Nov 2011 00:28:56 +0000 (16:28 -0800)
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 <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/adc/ad7192.c
drivers/staging/iio/adc/ad7280a.c
drivers/staging/iio/dds/ad9832.c
drivers/staging/iio/dds/ad9834.c
drivers/staging/iio/impedance-analyzer/ad5933.c

index 31c376b..d8bf559 100644 (file)
@@ -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;
index 372d059..0c212e0 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;
index 9b4ff60..b58baec 100644 (file)
@@ -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);
index c468f69..2e29f6f 100644 (file)
@@ -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;
index 1086e0b..ece7707 100644 (file)
@@ -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]) {