Skip to contentSkip to conversation

staging: comedi: usbdux: fix more sparse endianness warnings

PATCH In review Chase Southwood 2 participants 2 messages Aug 31, 2014 – Sep 1, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: comedi: usbdux: fix more sparse endianness warnings

Sparse shows a couple of warnings like:

drivers/staging/comedi/drivers/usbdux.c:889:20: warning: incorrect type in assignment (different base types)
drivers/staging/comedi/drivers/usbdux.c:889:20: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/comedi/drivers/usbdux.c:889:20: got restricted __le16 [usertype] <noident>

This is the result of a couple of calls to cpu_to_le16() being assigned to uint16_t typed variables. Switch the types of these variables/pointers to __le16 accordingly.

---

 drivers/staging/comedi/drivers/usbdux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/usbdux.c +2 -2
index 86c2c27..8eb2742 100644
@@ -868,7 +868,7 @@ static int usbdux_ao_insn_write(struct comedi_device *dev,
 	struct usbdux_private *devpriv = dev->private;
 	unsigned int chan = CR_CHAN(insn->chanspec);
 	unsigned int val = s->readback[chan];
-	uint16_t *p = (uint16_t *)&devpriv->dux_commands[2];
+	__le16 *p = (__le16 *)&devpriv->dux_commands[2];
 	int ret = -EBUSY;
 	int i;
 
@@ -1180,7 +1180,7 @@ static int usbdux_counter_write(struct comedi_device *dev,
 {
 	struct usbdux_private *devpriv = dev->private;
 	unsigned int chan = CR_CHAN(insn->chanspec);
-	uint16_t *p = (uint16_t *)&devpriv->dux_commands[2];
+	__le16 *p = (__le16 *)&devpriv->dux_commands[2];
 	int ret = 0;
 	int i;
 
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Chase Southwood

Sparse shows a couple of warnings like:

drivers/staging/comedi/drivers/usbdux.c:889:20: warning: incorrect type in assignment (different base types)
drivers/staging/comedi/drivers/usbdux.c:889:20: expected unsigned short [unsigned] [short] [usertype] <noident>
drivers/staging/comedi/drivers/usbdux.c:889:20: got restricted __le16 [usertype] <noident>

This is the result of a couple of calls to cpu_to_le16() being assigned to uint16_t typed variables. Switch the types of these variables/pointers to __le16 accordingly.

Quoted 7 lines

---

  drivers/staging/comedi/drivers/usbdux.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-