public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: comedi: usbduxsigma: fix more sparse endianness warnings
@ 2014-08-31 19:45 Chase Southwood
  2014-09-01  9:23 ` Ian Abbott
  0 siblings, 1 reply; 4+ messages in thread
From: Chase Southwood @ 2014-08-31 19:45 UTC (permalink / raw)
  To: gregkh; +Cc: abbotti, hsweeten, devel, linux-kernel, Chase Southwood

Sparse shows a couple of warnings like:

drivers/staging/comedi/drivers/usbduxsigma.c:787:23: warning: cast to restricted __be32

Looking at the indicated lines shows that the issue is caused by an
incorrect cast to uint32_t instead of __be32.  Fix this cast.

Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
---
 drivers/staging/comedi/drivers/usbduxsigma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index 5dbab04..5bad118 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -784,7 +784,7 @@ static int usbduxsigma_ai_insn_read(struct comedi_device *dev,
 		}
 
 		/* 32 bits big endian from the A/D converter */
-		val = be32_to_cpu(get_unaligned((uint32_t
+		val = be32_to_cpu(get_unaligned((__be32
 						 *)(devpriv->insn_buf + 1)));
 		val &= 0x00ffffff;	/* strip status byte */
 		val ^= 0x00800000;	/* convert to unsigned */
@@ -1343,7 +1343,7 @@ static int usbduxsigma_getstatusinfo(struct comedi_device *dev, int chan)
 		return ret;
 
 	/* 32 bits big endian from the A/D converter */
-	val = be32_to_cpu(get_unaligned((uint32_t *)(devpriv->insn_buf + 1)));
+	val = be32_to_cpu(get_unaligned((__be32 *)(devpriv->insn_buf + 1)));
 	val &= 0x00ffffff;	/* strip status byte */
 	val ^= 0x00800000;	/* convert to unsigned */
 
-- 
2.1.0


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

* Re: [PATCH] staging: comedi: usbduxsigma: fix more sparse endianness warnings
  2014-08-31 19:45 [PATCH] staging: comedi: usbduxsigma: fix more sparse endianness warnings Chase Southwood
@ 2014-09-01  9:23 ` Ian Abbott
  2014-09-01  9:24   ` Ian Abbott
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Abbott @ 2014-09-01  9:23 UTC (permalink / raw)
  To: Chase Southwood, gregkh; +Cc: hsweeten, devel, linux-kernel

On 2014-08-31 20:45, Chase Southwood wrote:
> Sparse shows a couple of warnings like:
>
> drivers/staging/comedi/drivers/usbduxsigma.c:787:23: warning: cast to restricted __be32
>
> Looking at the indicated lines shows that the issue is caused by an
> incorrect cast to uint32_t instead of __be32.  Fix this cast.
>
> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> ---
>   drivers/staging/comedi/drivers/usbduxsigma.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

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

* Re: [PATCH] staging: comedi: usbduxsigma: fix more sparse endianness warnings
  2014-09-01  9:23 ` Ian Abbott
@ 2014-09-01  9:24   ` Ian Abbott
  2014-09-02 17:39     ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Abbott @ 2014-09-01  9:24 UTC (permalink / raw)
  To: Chase Southwood, gregkh; +Cc: hsweeten, devel, linux-kernel

On 2014-09-01 10:23, Ian Abbott wrote:
> On 2014-08-31 20:45, Chase Southwood wrote:
>> Sparse shows a couple of warnings like:
>>
>> drivers/staging/comedi/drivers/usbduxsigma.c:787:23: warning: cast to
>> restricted __be32
>>
>> Looking at the indicated lines shows that the issue is caused by an
>> incorrect cast to uint32_t instead of __be32.  Fix this cast.
>>
>> Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
>> Cc: Ian Abbott <abbotti@mev.co.uk>
>> Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
>> ---
>>   drivers/staging/comedi/drivers/usbduxsigma.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>

I meant:

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

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

* Re: [PATCH] staging: comedi: usbduxsigma: fix more sparse endianness warnings
  2014-09-01  9:24   ` Ian Abbott
@ 2014-09-02 17:39     ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2014-09-02 17:39 UTC (permalink / raw)
  To: Ian Abbott; +Cc: Chase Southwood, devel, linux-kernel

On Mon, Sep 01, 2014 at 10:24:40AM +0100, Ian Abbott wrote:
> On 2014-09-01 10:23, Ian Abbott wrote:
> >On 2014-08-31 20:45, Chase Southwood wrote:
> >>Sparse shows a couple of warnings like:
> >>
> >>drivers/staging/comedi/drivers/usbduxsigma.c:787:23: warning: cast to
> >>restricted __be32
> >>
> >>Looking at the indicated lines shows that the issue is caused by an
> >>incorrect cast to uint32_t instead of __be32.  Fix this cast.
> >>
> >>Signed-off-by: Chase Southwood <chase.southwood@gmail.com>
> >>Cc: Ian Abbott <abbotti@mev.co.uk>
> >>Cc: H Hartley Sweeten <hsweeten@visionengravers.com>
> >>---
> >>  drivers/staging/comedi/drivers/usbduxsigma.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> >Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> 
> I meant:
> 
> Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

Either is fine, especially as you are listed as the maintainer of this
subsystem :)

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

end of thread, other threads:[~2014-09-02 17:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-31 19:45 [PATCH] staging: comedi: usbduxsigma: fix more sparse endianness warnings Chase Southwood
2014-09-01  9:23 ` Ian Abbott
2014-09-01  9:24   ` Ian Abbott
2014-09-02 17:39     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox