Skip to contentSkip to conversation

iio:light:apds9960 Fix sparse endian warnings.

PATCH Applied Jonathan Cameron 1 participant 2 messages Sep 23, 2015 – Oct 12, 2015 IIO

lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

PATCH 1/1 iio:light:apds9960 Fix sparse endian warnings.

This patch is a tidy up of warnings from the autobuilder.

Quoted 1 line
Quoted 1 line

drivers/iio/light/apds9960.c:495:32: sparse: cast to restricted __le16

drivers/iio/light/apds9960.c:635:24: sparse: cast to restricted __le16

Quoted 1 line
Quoted 1 line

drivers/iio/light/apds9960.c:672:21: sparse: incorrect type in assignment (different base types)

drivers/iio/light/apds9960.c:672:21: expected unsigned short [unsigned] [usertype] buf
drivers/iio/light/apds9960.c:672:21: got restricted __le16 [usertype] <noident>

---
 drivers/iio/light/apds9960.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/light/apds9960.c +3 -3
index bf80ce47926b..7d269ef9e062 100644
@@ -472,7 +472,7 @@ static int apds9960_read_raw(struct iio_dev *indio_dev,
 			     int *val, int *val2, long mask)
 {
 	struct apds9960_data *data = iio_priv(indio_dev);
-	u16 buf;
+	__le16 buf;
 	int ret = -EINVAL;
 
 	if (data->gesture_mode_running)
@@ -613,7 +613,7 @@ static int apds9960_read_event(struct iio_dev *indio_dev,
 			       int *val, int *val2)
 {
 	u8 reg;
-	u16 buf;
+	__le16 buf;
 	int ret = 0;
 	struct apds9960_data *data = iio_priv(indio_dev);
 
@@ -649,7 +649,7 @@ static int apds9960_write_event(struct iio_dev *indio_dev,
 				int val, int val2)
 {
 	u8 reg;
-	u16 buf;
+	__le16 buf;
 	int ret = 0;
 	struct apds9960_data *data = iio_priv(indio_dev);
 
Signature · 1 line
2.5.1
author maintainer Applied
#1 lore raw
Quoted 10 lines · Jonathan Cameron

This patch is a tidy up of warnings from the autobuilder.

Quoted 1 line
Quoted 1 line

drivers/iio/light/apds9960.c:495:32: sparse: cast to restricted __le16

drivers/iio/light/apds9960.c:635:24: sparse: cast to restricted __le16

Quoted 1 line
Quoted 1 line

drivers/iio/light/apds9960.c:672:21: sparse: incorrect type in assignment (different base types)

drivers/iio/light/apds9960.c:672:21: expected unsigned short [unsigned] [usertype] buf
drivers/iio/light/apds9960.c:672:21: got restricted __le16 [usertype] <noident>

Ah well, been on the list for a while and is kind of obvious.

Applied.

Quoted 36 lines
---
 drivers/iio/light/apds9960.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/iio/light/apds9960.c +3 -3
index bf80ce47926b..7d269ef9e062 100644
@@ -472,7 +472,7 @@ static int apds9960_read_raw(struct iio_dev *indio_dev,
 			     int *val, int *val2, long mask)
 {
 	struct apds9960_data *data = iio_priv(indio_dev);
-	u16 buf;
+	__le16 buf;
 	int ret = -EINVAL;
 
 	if (data->gesture_mode_running)
@@ -613,7 +613,7 @@ static int apds9960_read_event(struct iio_dev *indio_dev,
 			       int *val, int *val2)
 {
 	u8 reg;
-	u16 buf;
+	__le16 buf;
 	int ret = 0;
 	struct apds9960_data *data = iio_priv(indio_dev);
 
@@ -649,7 +649,7 @@ static int apds9960_write_event(struct iio_dev *indio_dev,
 				int val, int val2)
 {
 	u8 reg;
-	u16 buf;
+	__le16 buf;
 	int ret = 0;
 	struct apds9960_data *data = iio_priv(indio_dev);