staging: iio: ad5933: fix sparse warnings
authorTeodora Baluta <teodora.baluta@intel.com>
Fri, 25 Jul 2014 08:50:00 +0000 (09:50 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sun, 27 Jul 2014 13:33:07 +0000 (14:33 +0100)
Fix the following sparse warnings:

  CHECK   drivers/staging/iio/impedance-analyzer/ad5933.c
drivers/staging/iio/impedance-analyzer/ad5933.c:241:17: warning:
incorrect type in assignment (different base types)
drivers/staging/iio/impedance-analyzer/ad5933.c:241:17:    expected
unsigned int [unsigned] [usertype] d32
drivers/staging/iio/impedance-analyzer/ad5933.c:241:17:    got
restricted __be32 [usertype] <noident>
drivers/staging/iio/impedance-analyzer/ad5933.c:263:13: warning:
incorrect type in assignment (different base types)
drivers/staging/iio/impedance-analyzer/ad5933.c:263:13:    expected
unsigned short [unsigned] dat
drivers/staging/iio/impedance-analyzer/ad5933.c:263:13:    got
restricted __be16 [usertype] <noident>
drivers/staging/iio/impedance-analyzer/ad5933.c:271:13: warning:
incorrect type in assignment (different base types)
drivers/staging/iio/impedance-analyzer/ad5933.c:271:13:    expected
unsigned short [unsigned] [addressable] dat
drivers/staging/iio/impedance-analyzer/ad5933.c:271:13:    got
restricted __be16 [usertype] <noident>
drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
restricted __be32
drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
restricted __be32
drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
restricted __be32
drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
restricted __be32
drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
restricted __be32
drivers/staging/iio/impedance-analyzer/ad5933.c:310:19: warning: cast to
restricted __be32
drivers/staging/iio/impedance-analyzer/ad5933.c:446:21: warning:
incorrect type in assignment (different base types)
drivers/staging/iio/impedance-analyzer/ad5933.c:446:21:    expected
unsigned short [unsigned] dat
drivers/staging/iio/impedance-analyzer/ad5933.c:446:21:    got
restricted __be16 [usertype] <noident>
drivers/staging/iio/impedance-analyzer/ad5933.c:454:21: warning:
incorrect type in assignment (different base types)
drivers/staging/iio/impedance-analyzer/ad5933.c:454:21:    expected
unsigned short [unsigned] [addressable] dat
drivers/staging/iio/impedance-analyzer/ad5933.c:454:21:    got
restricted __be16 [usertype] <noident>
drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:548:23: warning: cast to
restricted __be16

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/impedance-analyzer/ad5933.c

index 2b96665da8a25aa0390462897d777039a6ff2c9e..2cef4b95ba634a8762fdfcec3156c6748d1fe7e0 100644 (file)
@@ -220,7 +220,7 @@ static int ad5933_set_freq(struct ad5933_state *st,
 {
        unsigned long long freqreg;
        union {
-               u32 d32;
+               __be32 d32;
                u8 d8[4];
        } dat;
 
@@ -244,7 +244,7 @@ static int ad5933_set_freq(struct ad5933_state *st,
 
 static int ad5933_setup(struct ad5933_state *st)
 {
-       unsigned short dat;
+       __be16 dat;
        int ret;
 
        ret = ad5933_reset(st);
@@ -297,7 +297,7 @@ static ssize_t ad5933_show_frequency(struct device *dev,
        int ret;
        unsigned long long freqreg;
        union {
-               u32 d32;
+               __be32 d32;
                u8 d8[4];
        } dat;
 
@@ -402,7 +402,7 @@ static ssize_t ad5933_store(struct device *dev,
        struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
        u16 val;
        int i, ret = 0;
-       unsigned short dat;
+       __be16 dat;
 
        if (this_attr->address != AD5933_IN_PGA_GAIN) {
                ret = kstrtou16(buf, 10, &val);
@@ -521,7 +521,7 @@ static int ad5933_read_raw(struct iio_dev *indio_dev,
                           long m)
 {
        struct ad5933_state *st = iio_priv(indio_dev);
-       unsigned short dat;
+       __be16 dat;
        int ret = -EINVAL;
 
        mutex_lock(&indio_dev->mlock);