Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1581024 > unrolled thread

[PATCH] staging: rtl8712: Fix sparse warnings about endianness

Started bymaomao xu <albert008.xu@gmail.com>
First post2017-02-15 04:00 +0100
Last post2017-02-15 17:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: rtl8712: Fix sparse warnings about endianness maomao xu <albert008.xu@gmail.com> - 2017-02-15 04:00 +0100
    Re: [PATCH] staging: rtl8712: Fix sparse warnings about endianness Larry Finger <Larry.Finger@lwfinger.net> - 2017-02-15 17:40 +0100

#1581024 — [PATCH] staging: rtl8712: Fix sparse warnings about endianness

Frommaomao xu <albert008.xu@gmail.com>
Date2017-02-15 04:00 +0100
Subject[PATCH] staging: rtl8712: Fix sparse warnings about endianness
Message-ID<taXZ0-1Ol-3@gated-at.bofh.it>
drivers/staging/rtl8712/rtl871x_xmit.c:350:44: warning: restricted __le32 degrades to integer

Signed-off-by: maomao xu <albert008.xu@gmail.com>

diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c
index 4ab82ba..1c2ac28 100644
--- a/drivers/staging/rtl8712/rtl871x_xmit.c
+++ b/drivers/staging/rtl8712/rtl871x_xmit.c
@@ -347,7 +347,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
 	 * some settings above.
 	 */
 	if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
-		pattrib->priority = (txdesc.txdw1 >> QSEL_SHT) & 0x1f;
+		pattrib->priority = (le32_to_cpu(txdesc.txdw1) >> QSEL_SHT) & 0x1f;
 	return _SUCCESS;
 }
 
-- 
1.7.9.5

[toc] | [next] | [standalone]


#1581434

FromLarry Finger <Larry.Finger@lwfinger.net>
Date2017-02-15 17:40 +0100
Message-ID<tbaMx-2lv-5@gated-at.bofh.it>
In reply to#1581024
On 02/14/2017 08:57 PM, maomao xu wrote:
> drivers/staging/rtl8712/rtl871x_xmit.c:350:44: warning: restricted __le32 degrades to integer
>
> Signed-off-by: maomao xu <albert008.xu@gmail.com>
>

You are using the wrong tree. In the staging-next branch of 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git, there is a patch

commit 07222e535831b916221dd2a48a3047ec7e45dc72
Author: Larry Finger <Larry.Finger@lwfinger.net>
Date:   Fri Feb 10 21:30:27 2017 -0600

     staging: r8712u: Fix Sparse warning in rtl871x_xmit.c

that already makes that fix. In fact, all the endian issues in that driver are 
resolved. When the compilers were changed to include endian issues with all 
Sparse checks, we started getting patches that silenced the warnings, but broke 
the driver on big-endian hardware. For that reason, I generate the set of 
patches that fixed all of them and tested on a BE laptop that I keep just for 
that purpose.

NACK.

Larry

> diff --git a/drivers/staging/rtl8712/rtl871x_xmit.c b/drivers/staging/rtl8712/rtl871x_xmit.c
> index 4ab82ba..1c2ac28 100644
> --- a/drivers/staging/rtl8712/rtl871x_xmit.c
> +++ b/drivers/staging/rtl8712/rtl871x_xmit.c
> @@ -347,7 +347,7 @@ sint r8712_update_attrib(struct _adapter *padapter, _pkt *pkt,
>  	 * some settings above.
>  	 */
>  	if (check_fwstate(pmlmepriv, WIFI_MP_STATE))
> -		pattrib->priority = (txdesc.txdw1 >> QSEL_SHT) & 0x1f;
> +		pattrib->priority = (le32_to_cpu(txdesc.txdw1) >> QSEL_SHT) & 0x1f;
>  	return _SUCCESS;
>  }
>
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web