[OPW,kernel] staging: rtl8192u: Fix incorrect type in assignment in ieee80211_softmac.c
diff mbox

Message ID 1414610871-21727-1-git-send-email-dilekuzulmez@gmail.com
State New, archived
Headers show

Commit Message

Dilek Uzulmez Oct. 29, 2014, 7:27 p.m. UTC
This patch fixes the following Sparse warning in ieee80211_softmac.c-

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:811:24: warning:
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:811:24:
expected unsigned short [unsigned] [usertype] val16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:811:24:    got
restricted __le16 [usertype] <noident>

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kroah-Hartman Oct. 29, 2014, 8:26 p.m. UTC | #1
On Wed, Oct 29, 2014 at 09:27:51PM +0200, Dilek Uzulmez wrote:
> This patch fixes the following Sparse warning in ieee80211_softmac.c-
> 
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:811:24: warning:
> incorrect type in assignment (different base types)
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:811:24:
> expected unsigned short [unsigned] [usertype] val16
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:811:24:    got
> restricted __le16 [usertype] <noident>
> 
> Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
> ---
>  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> index a85bb23..83a6dea 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> @@ -808,7 +808,7 @@ static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
>  		*(tag++) = MFIE_TYPE_IBSS_SET;
>  		*(tag++) = 2;
>  		//*((u16*)(tag)) = cpu_to_le16(ieee->current_network.atim_window);
> -		 val16 = cpu_to_le16(ieee->current_network.atim_window);
> +		 val16 = ieee->current_network.atim_window;

You changed the logic here, is that intentional?

Patch
diff mbox

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index a85bb23..83a6dea 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -808,7 +808,7 @@  static struct sk_buff *ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
 		*(tag++) = MFIE_TYPE_IBSS_SET;
 		*(tag++) = 2;
 		//*((u16*)(tag)) = cpu_to_le16(ieee->current_network.atim_window);
-		 val16 = cpu_to_le16(ieee->current_network.atim_window);
+		 val16 = ieee->current_network.atim_window;
 		memcpy((u8 *)tag, (u8 *)&val16, 2);
 		tag+=2;
 	}