Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1190142 > unrolled thread
| Started by | Jes Sorensen <Jes.Sorensen@redhat.com> |
|---|---|
| First post | 2015-07-22 20:00 +0200 |
| Last post | 2015-07-22 20:00 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] staging: rtl8723au: fix incorrect type in assignment warning Jes Sorensen <Jes.Sorensen@redhat.com> - 2015-07-22 20:00 +0200
| From | Jes Sorensen <Jes.Sorensen@redhat.com> |
|---|---|
| Date | 2015-07-22 20:00 +0200 |
| Subject | Re: [PATCH] staging: rtl8723au: fix incorrect type in assignment warning |
| Message-ID | <pP6tb-6JB-1@gated-at.bofh.it> |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web