All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: iio: minor fixes for sparse warnings
@ 2014-07-28 11:18 Teodora Baluta
  2014-07-28 11:18 ` [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16 Teodora Baluta
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Teodora Baluta @ 2014-07-28 11:18 UTC (permalink / raw)
  To: linux-iio; +Cc: Teodora Baluta

Fix sparse warnings mostly regarding casting or incorrect argument type for iio drivers in staging.

Teodora Baluta (5):
  staging: iio: ad7816: fix sparse warning cast to restricted __be16
  staging: iio: ad5933: fix sparse warning cast to restricted __be16
  staging: iio: hmc5843_core: fix sparse warnings
  staging: iio: isl29018: fix sparse warning regarding incorrect type   
     (different signedness)
  staging: iio: adis16240: fix sparse warnings regarding incorrect    
    argument type

 drivers/staging/iio/adc/ad7816.c                | 2 +-
 drivers/staging/iio/impedance-analyzer/ad5933.c | 8 ++++----
 drivers/staging/iio/light/isl29018.c            | 2 +-
 drivers/staging/iio/magnetometer/hmc5843_core.c | 6 +++---
 drivers/staging/iio/resolver/ad2s1210.c         | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16
  2014-07-28 11:18 [PATCH 0/5] staging: iio: minor fixes for sparse warnings Teodora Baluta
@ 2014-07-28 11:18 ` Teodora Baluta
  2014-08-02 11:56   ` Jonathan Cameron
  2014-07-28 11:18 ` [PATCH 2/5] staging: iio: ad5933: " Teodora Baluta
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Teodora Baluta @ 2014-07-28 11:18 UTC (permalink / raw)
  To: linux-iio; +Cc: Teodora Baluta

Fix following sparse endianness problems:

  CHECK   drivers/staging/iio/adc/ad7816.c
drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
__be16
drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
__be16
drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
__be16
drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
__be16

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
---
 drivers/staging/iio/adc/ad7816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index 158d770..6686eac 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -90,7 +90,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
 		return ret;
 	}
 
-	*data = be16_to_cpu(*data);
+	be16_to_cpus(data);
 
 	return ret;
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/5] staging: iio: ad5933: fix sparse warning cast to restricted __be16
  2014-07-28 11:18 [PATCH 0/5] staging: iio: minor fixes for sparse warnings Teodora Baluta
  2014-07-28 11:18 ` [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16 Teodora Baluta
@ 2014-07-28 11:18 ` Teodora Baluta
  2014-08-02 11:57   ` Jonathan Cameron
  2014-07-28 11:18 ` [PATCH 3/5] staging: iio: hmc5843_core: fix sparse warnings Teodora Baluta
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Teodora Baluta @ 2014-07-28 11:18 UTC (permalink / raw)
  To: linux-iio; +Cc: Teodora Baluta

Fix the following sparse endianness warnings:

  CHECK   drivers/staging/iio/impedance-analyzer/ad5933.c
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
restricted __be16

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 2cef4b9..87ce844 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -647,7 +647,7 @@ static void ad5933_work(struct work_struct *work)
 	struct ad5933_state *st = container_of(work,
 		struct ad5933_state, work.work);
 	struct iio_dev *indio_dev = i2c_get_clientdata(st->client);
-	signed short buf[2];
+	u16 buf[2];
 	unsigned char status;
 
 	mutex_lock(&indio_dev->mlock);
@@ -671,10 +671,10 @@ static void ad5933_work(struct work_struct *work)
 				scan_count * 2, (u8 *)buf);
 
 		if (scan_count == 2) {
-			buf[0] = be16_to_cpu(buf[0]);
-			buf[1] = be16_to_cpu(buf[1]);
+			be16_to_cpus(&buf[0]);
+			be16_to_cpus(&buf[1]);
 		} else {
-			buf[0] = be16_to_cpu(buf[0]);
+			be16_to_cpus(&buf[0]);
 		}
 		iio_push_to_buffers(indio_dev, buf);
 	} else {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/5] staging: iio: hmc5843_core: fix sparse warnings
  2014-07-28 11:18 [PATCH 0/5] staging: iio: minor fixes for sparse warnings Teodora Baluta
  2014-07-28 11:18 ` [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16 Teodora Baluta
  2014-07-28 11:18 ` [PATCH 2/5] staging: iio: ad5933: " Teodora Baluta
@ 2014-07-28 11:18 ` Teodora Baluta
  2014-08-02 16:33   ` Jonathan Cameron
  2014-07-28 11:18 ` [PATCH 4/5] staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness) Teodora Baluta
  2014-07-28 11:18 ` [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type Teodora Baluta
  4 siblings, 1 reply; 11+ messages in thread
From: Teodora Baluta @ 2014-07-28 11:18 UTC (permalink / raw)
  To: linux-iio; +Cc: Teodora Baluta

Fix the following sparse warnings:

 CHECK   drivers/staging/iio/magnetometer/hmc5843_core.c
drivers/staging/iio/magnetometer/hmc5843_core.c:138:70: warning:
incorrect type in argument 3 (different signedness)
drivers/staging/iio/magnetometer/hmc5843_core.c:138:70:    expected
unsigned int *val
drivers/staging/iio/magnetometer/hmc5843_core.c:138:70:    got int
*<noident>
drivers/staging/iio/magnetometer/hmc5843_core.c:215:64: warning:
incorrect type in argument 3 (different signedness)
drivers/staging/iio/magnetometer/hmc5843_core.c:215:64:    expected
unsigned int *val
drivers/staging/iio/magnetometer/hmc5843_core.c:215:64:    got int
*<noident>
drivers/staging/iio/magnetometer/hmc5843_core.c:354:72: warning:
incorrect type in argument 3 (different signedness)
drivers/staging/iio/magnetometer/hmc5843_core.c:354:72:    expected
unsigned int *val
drivers/staging/iio/magnetometer/hmc5843_core.c:354:72:    got int
*<noident>
drivers/staging/iio/magnetometer/hmc5843_core.c:362:72: warning:
incorrect type in argument 3 (different signedness)
drivers/staging/iio/magnetometer/hmc5843_core.c:362:72:    expected
unsigned int *val
drivers/staging/iio/magnetometer/hmc5843_core.c:362:72:    got int
*<noident>

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
---
 drivers/staging/iio/magnetometer/hmc5843_core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c b/drivers/staging/iio/magnetometer/hmc5843_core.c
index 914ae1a..fd171d8 100644
--- a/drivers/staging/iio/magnetometer/hmc5843_core.c
+++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
@@ -131,7 +131,7 @@ static s32 hmc5843_set_mode(struct hmc5843_data *data, u8 operating_mode)
 static int hmc5843_wait_measurement(struct hmc5843_data *data)
 {
 	int tries = 150;
-	int val;
+	unsigned int val;
 	int ret;
 
 	while (tries-- > 0) {
@@ -209,7 +209,7 @@ static ssize_t hmc5843_show_measurement_configuration(struct device *dev,
 						char *buf)
 {
 	struct hmc5843_data *data = iio_priv(dev_to_iio_dev(dev));
-	int val;
+	unsigned int val;
 	int ret;
 
 	ret = regmap_read(data->regmap, HMC5843_CONFIG_REG_A, &val);
@@ -344,7 +344,7 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev,
 			    int *val, int *val2, long mask)
 {
 	struct hmc5843_data *data = iio_priv(indio_dev);
-	int rval;
+	unsigned int rval;
 	int ret;
 
 	switch (mask) {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/5] staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness)
  2014-07-28 11:18 [PATCH 0/5] staging: iio: minor fixes for sparse warnings Teodora Baluta
                   ` (2 preceding siblings ...)
  2014-07-28 11:18 ` [PATCH 3/5] staging: iio: hmc5843_core: fix sparse warnings Teodora Baluta
@ 2014-07-28 11:18 ` Teodora Baluta
  2014-08-02 16:35   ` Jonathan Cameron
  2014-07-28 11:18 ` [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type Teodora Baluta
  4 siblings, 1 reply; 11+ messages in thread
From: Teodora Baluta @ 2014-07-28 11:18 UTC (permalink / raw)
  To: linux-iio; +Cc: Teodora Baluta

Fix the following sparse warning:

drivers/staging/iio/light/isl29018.c:508:50: warning: incorrect type in
argument 3 (different signedness)
drivers/staging/iio/light/isl29018.c:508:50:    expected unsigned int
*conf_adc_bit
drivers/staging/iio/light/isl29018.c:508:50:    got int *<noident>

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
---
 drivers/staging/iio/light/isl29018.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 3660a43..86cc8f9 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -454,7 +454,7 @@ static const struct attribute_group isl29108_group = {
 static int isl29018_chip_init(struct isl29018_chip *chip)
 {
 	int status;
-	int new_adc_bit;
+	unsigned int new_adc_bit;
 	unsigned int new_range;
 
 	/* Code added per Intersil Application Note 1534:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type
  2014-07-28 11:18 [PATCH 0/5] staging: iio: minor fixes for sparse warnings Teodora Baluta
                   ` (3 preceding siblings ...)
  2014-07-28 11:18 ` [PATCH 4/5] staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness) Teodora Baluta
@ 2014-07-28 11:18 ` Teodora Baluta
  2014-08-02 16:44   ` Jonathan Cameron
  4 siblings, 1 reply; 11+ messages in thread
From: Teodora Baluta @ 2014-07-28 11:18 UTC (permalink / raw)
  To: linux-iio; +Cc: Teodora Baluta

Silence the following sparse warnings by changing cast from u16 to
__be16:

  CHECK   drivers/staging/iio/accel/adis16240_core.c
drivers/staging/iio/accel/adis16240_core.c:128:51: warning: incorrect
type in argument 3 (different signedness)
drivers/staging/iio/accel/adis16240_core.c:128:51:    expected unsigned
short [usertype] *val
drivers/staging/iio/accel/adis16240_core.c:128:51:    got signed short
*<noident>
drivers/staging/iio/accel/adis16240_core.c:142:51: warning: incorrect
type in argument 3 (different signedness)
drivers/staging/iio/accel/adis16240_core.c:142:51:    expected unsigned
short [usertype] *val
drivers/staging/iio/accel/adis16240_core.c:142:51:    got signed short
*<noident>

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
---
 drivers/staging/iio/resolver/ad2s1210.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
index 7fbaba4..1360099 100644
--- a/drivers/staging/iio/resolver/ad2s1210.c
+++ b/drivers/staging/iio/resolver/ad2s1210.c
@@ -491,7 +491,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
 
 	switch (chan->type) {
 	case IIO_ANGL:
-		pos = be16_to_cpup((u16 *)st->rx);
+		pos = be16_to_cpup((__be16 *) st->rx);
 		if (st->hysteresis)
 			pos >>= 16 - st->resolution;
 		*val = pos;
@@ -499,7 +499,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
 		break;
 	case IIO_ANGL_VEL:
 		negative = st->rx[0] & 0x80;
-		vel = be16_to_cpup((s16 *)st->rx);
+		vel = be16_to_cpup((__be16 *) st->rx);
 		vel >>= 16 - st->resolution;
 		if (vel & 0x8000) {
 			negative = (0xffff >> st->resolution) << st->resolution;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16
  2014-07-28 11:18 ` [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16 Teodora Baluta
@ 2014-08-02 11:56   ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2014-08-02 11:56 UTC (permalink / raw)
  To: Teodora Baluta, linux-iio, Lars-Peter Clausen

On 28/07/14 12:18, Teodora Baluta wrote:
> Fix following sparse endianness problems:
> 
>   CHECK   drivers/staging/iio/adc/ad7816.c
> drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
> __be16
> drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
> __be16
> drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
> __be16
> drivers/staging/iio/adc/ad7816.c:93:17: warning: cast to restricted
> __be16
> 
> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Hi Teodora,

There's actually a nastier problem hiding in here.  SPI requires that
the buffers passed to spi_read are in their own cache lines.
Here they are on the stack and hence this is unlikely to be true.
Cc'd Lars for info.

Also, in cases like this I'd prefer to introduce a local __be16 to
hold the value whilst it is big endian, rather than using it for both
big endian and cpu endian in different places in the code.

Thanks,

Jonathan
> ---
>  drivers/staging/iio/adc/ad7816.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
> index 158d770..6686eac 100644
> --- a/drivers/staging/iio/adc/ad7816.c
> +++ b/drivers/staging/iio/adc/ad7816.c
> @@ -90,7 +90,7 @@ static int ad7816_spi_read(struct ad7816_chip_info *chip, u16 *data)
>  		return ret;
>  	}
>  
> -	*data = be16_to_cpu(*data);
> +	be16_to_cpus(data);
>  
>  	return ret;
>  }
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/5] staging: iio: ad5933: fix sparse warning cast to restricted __be16
  2014-07-28 11:18 ` [PATCH 2/5] staging: iio: ad5933: " Teodora Baluta
@ 2014-08-02 11:57   ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2014-08-02 11:57 UTC (permalink / raw)
  To: Teodora Baluta, linux-iio, Lars-Peter Clausen

On 28/07/14 12:18, Teodora Baluta wrote:
> Fix the following sparse endianness warnings:
> 
>   CHECK   drivers/staging/iio/impedance-analyzer/ad5933.c
> drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:675:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
> restricted __be16
> drivers/staging/iio/impedance-analyzer/ad5933.c:677:34: warning: cast to
> restricted __be16
> 
> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Again, I'd prefer the introduction of a specific be16 variable to
make it very clear what is going on rather that what we have
here which is papering over the warning.

J
> ---
>  drivers/staging/iio/impedance-analyzer/ad5933.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 2cef4b9..87ce844 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -647,7 +647,7 @@ static void ad5933_work(struct work_struct *work)
>  	struct ad5933_state *st = container_of(work,
>  		struct ad5933_state, work.work);
>  	struct iio_dev *indio_dev = i2c_get_clientdata(st->client);
> -	signed short buf[2];
> +	u16 buf[2];
>  	unsigned char status;
>  
>  	mutex_lock(&indio_dev->mlock);
> @@ -671,10 +671,10 @@ static void ad5933_work(struct work_struct *work)
>  				scan_count * 2, (u8 *)buf);
>  
>  		if (scan_count == 2) {
> -			buf[0] = be16_to_cpu(buf[0]);
> -			buf[1] = be16_to_cpu(buf[1]);
> +			be16_to_cpus(&buf[0]);
> +			be16_to_cpus(&buf[1]);
>  		} else {
> -			buf[0] = be16_to_cpu(buf[0]);
> +			be16_to_cpus(&buf[0]);
>  		}
>  		iio_push_to_buffers(indio_dev, buf);
>  	} else {
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/5] staging: iio: hmc5843_core: fix sparse warnings
  2014-07-28 11:18 ` [PATCH 3/5] staging: iio: hmc5843_core: fix sparse warnings Teodora Baluta
@ 2014-08-02 16:33   ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2014-08-02 16:33 UTC (permalink / raw)
  To: Teodora Baluta, linux-iio

On 28/07/14 12:18, Teodora Baluta wrote:
> Fix the following sparse warnings:
> 
>  CHECK   drivers/staging/iio/magnetometer/hmc5843_core.c
> drivers/staging/iio/magnetometer/hmc5843_core.c:138:70: warning:
> incorrect type in argument 3 (different signedness)
> drivers/staging/iio/magnetometer/hmc5843_core.c:138:70:    expected
> unsigned int *val
> drivers/staging/iio/magnetometer/hmc5843_core.c:138:70:    got int
> *<noident>
> drivers/staging/iio/magnetometer/hmc5843_core.c:215:64: warning:
> incorrect type in argument 3 (different signedness)
> drivers/staging/iio/magnetometer/hmc5843_core.c:215:64:    expected
> unsigned int *val
> drivers/staging/iio/magnetometer/hmc5843_core.c:215:64:    got int
> *<noident>
> drivers/staging/iio/magnetometer/hmc5843_core.c:354:72: warning:
> incorrect type in argument 3 (different signedness)
> drivers/staging/iio/magnetometer/hmc5843_core.c:354:72:    expected
> unsigned int *val
> drivers/staging/iio/magnetometer/hmc5843_core.c:354:72:    got int
> *<noident>
> drivers/staging/iio/magnetometer/hmc5843_core.c:362:72: warning:
> incorrect type in argument 3 (different signedness)
> drivers/staging/iio/magnetometer/hmc5843_core.c:362:72:    expected
> unsigned int *val
> drivers/staging/iio/magnetometer/hmc5843_core.c:362:72:    got int
> *<noident>
> 
> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Applied to the togreg branch of iio.git.

Thanks,

Jonathan
> ---
>  drivers/staging/iio/magnetometer/hmc5843_core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/magnetometer/hmc5843_core.c b/drivers/staging/iio/magnetometer/hmc5843_core.c
> index 914ae1a..fd171d8 100644
> --- a/drivers/staging/iio/magnetometer/hmc5843_core.c
> +++ b/drivers/staging/iio/magnetometer/hmc5843_core.c
> @@ -131,7 +131,7 @@ static s32 hmc5843_set_mode(struct hmc5843_data *data, u8 operating_mode)
>  static int hmc5843_wait_measurement(struct hmc5843_data *data)
>  {
>  	int tries = 150;
> -	int val;
> +	unsigned int val;
>  	int ret;
>  
>  	while (tries-- > 0) {
> @@ -209,7 +209,7 @@ static ssize_t hmc5843_show_measurement_configuration(struct device *dev,
>  						char *buf)
>  {
>  	struct hmc5843_data *data = iio_priv(dev_to_iio_dev(dev));
> -	int val;
> +	unsigned int val;
>  	int ret;
>  
>  	ret = regmap_read(data->regmap, HMC5843_CONFIG_REG_A, &val);
> @@ -344,7 +344,7 @@ static int hmc5843_read_raw(struct iio_dev *indio_dev,
>  			    int *val, int *val2, long mask)
>  {
>  	struct hmc5843_data *data = iio_priv(indio_dev);
> -	int rval;
> +	unsigned int rval;
>  	int ret;
>  
>  	switch (mask) {
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/5] staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness)
  2014-07-28 11:18 ` [PATCH 4/5] staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness) Teodora Baluta
@ 2014-08-02 16:35   ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2014-08-02 16:35 UTC (permalink / raw)
  To: Teodora Baluta, linux-iio

On 28/07/14 12:18, Teodora Baluta wrote:
> Fix the following sparse warning:
> 
> drivers/staging/iio/light/isl29018.c:508:50: warning: incorrect type in
> argument 3 (different signedness)
> drivers/staging/iio/light/isl29018.c:508:50:    expected unsigned int
> *conf_adc_bit
> drivers/staging/iio/light/isl29018.c:508:50:    got int *<noident>
> 
> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Applied to the togreg branch of iio.git initially pushed out as testing
for the autobuilders to play.

J
> ---
>  drivers/staging/iio/light/isl29018.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
> index 3660a43..86cc8f9 100644
> --- a/drivers/staging/iio/light/isl29018.c
> +++ b/drivers/staging/iio/light/isl29018.c
> @@ -454,7 +454,7 @@ static const struct attribute_group isl29108_group = {
>  static int isl29018_chip_init(struct isl29018_chip *chip)
>  {
>  	int status;
> -	int new_adc_bit;
> +	unsigned int new_adc_bit;
>  	unsigned int new_range;
>  
>  	/* Code added per Intersil Application Note 1534:
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type
  2014-07-28 11:18 ` [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type Teodora Baluta
@ 2014-08-02 16:44   ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2014-08-02 16:44 UTC (permalink / raw)
  To: Teodora Baluta, linux-iio

On 28/07/14 12:18, Teodora Baluta wrote:
> Silence the following sparse warnings by changing cast from u16 to
> __be16:
> 
>   CHECK   drivers/staging/iio/accel/adis16240_core.c
> drivers/staging/iio/accel/adis16240_core.c:128:51: warning: incorrect
> type in argument 3 (different signedness)
> drivers/staging/iio/accel/adis16240_core.c:128:51:    expected unsigned
> short [usertype] *val
> drivers/staging/iio/accel/adis16240_core.c:128:51:    got signed short
> *<noident>
> drivers/staging/iio/accel/adis16240_core.c:142:51: warning: incorrect
> type in argument 3 (different signedness)
> drivers/staging/iio/accel/adis16240_core.c:142:51:    expected unsigned
> short [usertype] *val
> drivers/staging/iio/accel/adis16240_core.c:142:51:    got signed short
> *<noident>
> 
> Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Applied to the togreg branch of iio.git pushed out as testing for the
autobuilders to play.  Note that this is unlikely to go to Greg until
after the coming merge window (unless the merge window is significantly
delayed).

Thanks,

Jonathan
> ---
>  drivers/staging/iio/resolver/ad2s1210.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
> index 7fbaba4..1360099 100644
> --- a/drivers/staging/iio/resolver/ad2s1210.c
> +++ b/drivers/staging/iio/resolver/ad2s1210.c
> @@ -491,7 +491,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
>  
>  	switch (chan->type) {
>  	case IIO_ANGL:
> -		pos = be16_to_cpup((u16 *)st->rx);
> +		pos = be16_to_cpup((__be16 *) st->rx);
>  		if (st->hysteresis)
>  			pos >>= 16 - st->resolution;
>  		*val = pos;
> @@ -499,7 +499,7 @@ static int ad2s1210_read_raw(struct iio_dev *indio_dev,
>  		break;
>  	case IIO_ANGL_VEL:
>  		negative = st->rx[0] & 0x80;
> -		vel = be16_to_cpup((s16 *)st->rx);
> +		vel = be16_to_cpup((__be16 *) st->rx);
>  		vel >>= 16 - st->resolution;
>  		if (vel & 0x8000) {
>  			negative = (0xffff >> st->resolution) << st->resolution;
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-08-02 16:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-28 11:18 [PATCH 0/5] staging: iio: minor fixes for sparse warnings Teodora Baluta
2014-07-28 11:18 ` [PATCH 1/5] staging: iio: ad7816: fix sparse warning cast to restricted __be16 Teodora Baluta
2014-08-02 11:56   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 2/5] staging: iio: ad5933: " Teodora Baluta
2014-08-02 11:57   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 3/5] staging: iio: hmc5843_core: fix sparse warnings Teodora Baluta
2014-08-02 16:33   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 4/5] staging: iio: isl29018: fix sparse warning regarding incorrect type (different signedness) Teodora Baluta
2014-08-02 16:35   ` Jonathan Cameron
2014-07-28 11:18 ` [PATCH 5/5] staging: iio: adis16240: fix sparse warnings regarding incorrect argument type Teodora Baluta
2014-08-02 16:44   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.