linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: Steve Pennington <sgpenn@gmail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Greg Donald <gdonald@gmail.com>, Joe Perches <joe@perches.com>,
	Roberta Dobrescu <roberta.dobrescu@gmail.com>,
	Masanari Iida <standby24x7@gmail.com>,
	linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723au: fix incorrect type in assignment warning
Date: Tue, 21 Jul 2015 13:47:10 -0400	[thread overview]
Message-ID: <wrfjr3o1o129.fsf@redhat.com> (raw)
In-Reply-To: <1437499895-18532-1-git-send-email-sgpenn@gmail.com> (Steve Pennington's message of "Tue, 21 Jul 2015 12:31:35 -0500")

Steve Pennington <sgpenn@gmail.com> writes:
> Repaced call to htons with call to cpu_to_be16s to fix the
> following sparse warning:
> drivers/staging/rtl8723au/core/rtw_recv.c:1557:21: warning: incorrect type in assignment (different base types)
> drivers/staging/rtl8723au/core/rtw_recv.c:1557:21:    expected unsigned short [unsigned] [assigned] [usertype] len
> drivers/staging/rtl8723au/core/rtw_recv.c:1557:21:    got restricted __be16 [usertype] <noident>
>
> Signed-off-by: Steve Pennington <sgpenn@gmail.com>
> ---
>  drivers/staging/rtl8723au/core/rtw_recv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c
> index 274a4b6..39318ae 100644
> --- a/drivers/staging/rtl8723au/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723au/core/rtw_recv.c
> @@ -1554,7 +1554,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)
>  	ether_addr_copy(ptr + ETH_ALEN, pattrib->src);
>  
>  	if (!bsnaphdr) {
> -		len = htons(len);
> +		cpu_to_be16s(&len);
>  		memcpy(ptr + 12, &len, 2);
>  	}

Thats an awful fix - use put_unaligned_le16() instead.

Jes

  reply	other threads:[~2015-07-21 17:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21 17:31 [PATCH] staging: rtl8723au: fix incorrect type in assignment warning Steve Pennington
2015-07-21 17:47 ` Jes Sorensen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-22 17:50 Steve Pennington
2015-07-22 17:56 ` Jes Sorensen

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=wrfjr3o1o129.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=gdonald@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=roberta.dobrescu@gmail.com \
    --cc=sgpenn@gmail.com \
    --cc=standby24x7@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).