[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5401AA33.4010206@mev.co.uk>
Date: Sat, 30 Aug 2014 11:40:51 +0100
From: Ian Abbott <abbotti@....co.uk>
To: Chase Southwood <chase.southwood@...il.com>,
<gregkh@...uxfoundation.org>
CC: <hsweeten@...ionengravers.com>, <devel@...verdev.osuosl.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: comedi: usbdux: fix sparse endianness warnings
On 30/08/14 02:40, Chase Southwood wrote:
> Sparse has many warnings like:
>
> drivers/staging/comedi/drivers/usbdux.c:366:32: warning: cast to
> restricted __le16
>
> on lines on which devpriv->in_buf or devpriv->insn_buf are passed to
> le16_to_cpu(). This suggests that both of these variables should actually
> be of type __le16.
>
> Signed-off-by: Chase Southwood <chase.southwood@...il.com>
> Cc: Ian Abbott <abbotti@....co.uk>
> Cc: H Hartley Sweeten <hsweeten@...ionengravers.com>
> ---
> This is, as usual, compile tested only. I tried to verify as best as I
> could that this is a sane change, but I am unable to test on the hardware.
>
> 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 053bc50..e1a19222 100644
> --- a/drivers/staging/comedi/drivers/usbdux.c
> +++ b/drivers/staging/comedi/drivers/usbdux.c
> @@ -198,9 +198,9 @@ struct usbdux_private {
> /* size of the PWM buffer which holds the bit pattern */
> int pwm_buf_sz;
> /* input buffer for the ISO-transfer */
> - uint16_t *in_buf;
> + __le16 *in_buf;
> /* input buffer for single insn */
> - uint16_t *insn_buf;
> + __le16 *insn_buf;
>
> unsigned int ao_readback[USBDUX_NUM_AO_CHAN];
>
>
That seems fine. Perhaps the variable 'p' in usbdux_ao_insn_write()
should also be of type '__le16 *'?
Reviewed-by: Ian Abbott <abbotti@....co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@....co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists