All of lore.kernel.org
 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: Wed, 22 Jul 2015 13:56:42 -0400	[thread overview]
Message-ID: <wrfjsi8gaxet.fsf@redhat.com> (raw)
In-Reply-To: <1437587411-31841-1-git-send-email-sgpenn@gmail.com> (Steve Pennington's message of "Wed, 22 Jul 2015 12:50:11 -0500")

Steve Pennington <sgpenn@gmail.com> writes:
> Repaced calls to htons and memcpy with a single call to put_unaligned_be16

You may want an 'l' in replaced, but not a biggie to me.

> 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 | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c
> index 274a4b6..ad0549c 100644
> --- a/drivers/staging/rtl8723au/core/rtw_recv.c
> +++ b/drivers/staging/rtl8723au/core/rtw_recv.c
> @@ -1554,8 +1554,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)
>  	ether_addr_copy(ptr + ETH_ALEN, pattrib->src);
>  
>  	if (!bsnaphdr) {
> -		len = htons(len);
> -		memcpy(ptr + 12, &len, 2);
> +		put_unaligned_be16(len, ptr + 12);
>  	}

This one looks good to me.

Jes

  reply	other threads:[~2015-07-22 17:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-22 17:50 [PATCH] staging: rtl8723au: fix incorrect type in assignment warning Steve Pennington
2015-07-22 17:56 ` Jes Sorensen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-21 17:31 Steve Pennington
2015-07-21 17:47 ` 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=wrfjsi8gaxet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.