LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Johannes Postma <jgmpostma@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
	devel@driverdev.osuosl.org,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16
Date: Thu, 06 Aug 2015 08:21:51 -0400	[thread overview]
Message-ID: <wrfjpp30bo9s.fsf@redhat.com> (raw)
In-Reply-To: <1438860112-1786-1-git-send-email-jgmpostma@gmail.com> (Johannes Postma's message of "Thu, 6 Aug 2015 12:21:52 +0100")

Johannes Postma <jgmpostma@gmail.com> writes:
> usPtr is used as __le16 *, but was defined as u16 *.
> This was reported by sparse as:
> drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c:1850:29: warning: cast to
> restricted __le16
>
> This patch fixes the type of usPtr.
>
> Signed-off-by: Johannes Postma <jgmpostma@gmail.com>
> ---
>  drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Looks OK to me. Probably worth changing the *(usPtr + index) to be
usPtr[index] as well to make the code easier to read.

Jes

> diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> index cb5076a..eb76ac4 100644
> --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
> @@ -1838,7 +1838,7 @@ Hal_EfuseParseThermalMeter_8723A(struct rtw_adapter *padapter,
>  
>  static void rtl8723a_cal_txdesc_chksum(struct tx_desc *ptxdesc)
>  {
> -	u16 *usPtr = (u16 *) ptxdesc;
> +	__le16 *usPtr = (__le16 *)ptxdesc;
>  	u32 count = 16;		/*  (32 bytes / 2 bytes per XOR) => 16 times */
>  	u32 index;
>  	u16 checksum = 0;

  reply	other threads:[~2015-08-06 12:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 11:21 Johannes Postma
2015-08-06 12:21 ` Jes Sorensen [this message]
2015-08-07  8:37   ` Johannes Postma
2015-08-07 12:26     ` Jes Sorensen
2015-08-07 13:08       ` Johannes Postma
  -- strict thread matches above, loose matches on Subject: below --
2015-03-11 17:21 [PATCH] staging: rtl8723au: Fix sparse warning " Marcus Folkesson
2015-03-11 18:23 ` Jes Sorensen
2014-11-18  1:45 [PATCH] staging:rtl8723au: " Tobenna P. Igwe
2014-11-18  1:59 ` Greg KH
2014-11-18  2:51   ` Tobenna Peter, Igwe
2014-11-18  4:06     ` Greg KH

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=wrfjpp30bo9s.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgmpostma@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --subject='Re: [PATCH] staging: rtl8723au: Fix sparse warning: cast to restricted __le16' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).