From: Ian Abbott <abbotti@mev.co.uk>
To: Chase Southwood <chase.southwood@gmail.com>,
<gregkh@linuxfoundation.org>
Cc: <hsweeten@visionengravers.com>, <devel@driverdev.osuosl.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] staging: comedi: usbdux: fix sparse endianness warnings
Date: Sat, 30 Aug 2014 11:40:51 +0100 [thread overview]
Message-ID: <5401AA33.4010206@mev.co.uk> (raw)
In-Reply-To: <1409362832-1312-1-git-send-email-chase.southwood@gmail.com>
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@gmail.com>
> Cc: Ian Abbott <abbotti@mev.co.uk>
> Cc: H Hartley Sweeten <hsweeten@visionengravers.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@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 )=-
next prev parent reply other threads:[~2014-08-30 10:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-30 1:40 [PATCH] staging: comedi: usbdux: fix sparse endianness warnings Chase Southwood
2014-08-30 10:40 ` Ian Abbott [this message]
2014-08-31 19:09 ` Chase Southwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5401AA33.4010206@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=chase.southwood@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox