All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: comedi: usbdux: fix more sparse endianness warnings
@ 2014-08-31 19:44 Chase Southwood
  2014-09-01  9:03 ` Ian Abbott
  0 siblings, 1 reply; 2+ messages in thread
From: Chase Southwood @ 2014-08-31 19:44 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, 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.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Suggested-by: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---

 drivers/staging/comedi/drivers/usbdux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c
index 86c2c27..8eb2742 100644
--- a/drivers/staging/comedi/drivers/usbdux.c
+++ b/drivers/staging/comedi/drivers/usbdux.c
@@ -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;
 
-- 
2.1.0


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

end of thread, other threads:[~2014-09-01  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-31 19:44 [PATCH] staging: comedi: usbdux: fix more sparse endianness warnings Chase Southwood
2014-09-01  9:03 ` Ian Abbott

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.