* [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning
@ 2015-05-25 15:00 Gaston Gonzalez
2015-05-25 16:35 ` Dan Carpenter
0 siblings, 1 reply; 5+ messages in thread
From: Gaston Gonzalez @ 2015-05-25 15:00 UTC (permalink / raw)
To: gregkh, cristina.opriceana, hamohammed.sa, gdonald,
mahfouz.saif.elyazal, paul.gortmaker
Cc: devel, linux-kernel, gascoar
Silence the following sparse warning:
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: expected restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: got int
Signed-off-by: Gaston Gonzalez <gascoar@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 d2e8b12..7dd8442 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
- auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
+ auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
auth->header.duration_id = 0x013a; //FIXME
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning
2015-05-25 15:00 [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning Gaston Gonzalez
@ 2015-05-25 16:35 ` Dan Carpenter
2015-05-25 22:50 ` Gaston Gonzalez
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2015-05-25 16:35 UTC (permalink / raw)
To: Gaston Gonzalez
Cc: gregkh, cristina.opriceana, hamohammed.sa, gdonald,
mahfouz.saif.elyazal, paul.gortmaker, devel, linux-kernel
On Mon, May 25, 2015 at 12:00:42PM -0300, Gaston Gonzalez wrote:
> Silence the following sparse warning:
>
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: incorrect type in assignment (different base types)
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: expected restricted __le16 [usertype] frame_ctl
> drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: got int
>
> Signed-off-by: Gaston Gonzalez <gascoar@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 d2e8b12..7dd8442 100644
> --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> @@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be
> auth = (struct ieee80211_authentication *)
> skb_put(skb, sizeof(struct ieee80211_authentication));
>
> - auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> + auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is also wrong then.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning
2015-05-25 16:35 ` Dan Carpenter
@ 2015-05-25 22:50 ` Gaston Gonzalez
2015-05-26 5:12 ` Sudip Mukherjee
2015-05-26 8:25 ` Dan Carpenter
0 siblings, 2 replies; 5+ messages in thread
From: Gaston Gonzalez @ 2015-05-25 22:50 UTC (permalink / raw)
To: Dan Carpenter
Cc: gregkh, cristina.opriceana, hamohammed.sa, gdonald,
mahfouz.saif.elyazal, paul.gortmaker, devel, linux-kernel,
Gaston Gonzalez
On 25/05/15 13:35, Dan Carpenter wrote:
> This is also wrong then.
>
> regards,
> dan carpenter
Hi Dan,
Yes, you are right. It is the next sparse warning in line for that file.
Including the fix for that, the patch would be as showed below.
There are similar endianness warnings for other variables in that file,
like the FIXME in last line of the patch. But keeping in mind the rule
'one thing per patch' I guess this should be fixed in other patche/s, right?
Regards,
Gaston
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff
*ieee80211_authentication_req(struct ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
- auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
- if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+ auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+ if (challengelen)
+ auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
auth->header.duration_id = 0x013a; //FIXME
--
2.1.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning
2015-05-25 22:50 ` Gaston Gonzalez
@ 2015-05-26 5:12 ` Sudip Mukherjee
2015-05-26 8:25 ` Dan Carpenter
1 sibling, 0 replies; 5+ messages in thread
From: Sudip Mukherjee @ 2015-05-26 5:12 UTC (permalink / raw)
To: Gaston Gonzalez
Cc: Dan Carpenter, devel, hamohammed.sa, paul.gortmaker, gregkh,
linux-kernel, gdonald, cristina.opriceana
On Mon, May 25, 2015 at 07:50:55PM -0300, Gaston Gonzalez wrote:
> On 25/05/15 13:35, Dan Carpenter wrote:
> > This is also wrong then.
> >
> > regards,
> > dan carpenter
> Hi Dan,
>
> Yes, you are right. It is the next sparse warning in line for that file.
> Including the fix for that, the patch would be as showed below.
please send a proper patch with proper commit message.
regards
sudip
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning
2015-05-25 22:50 ` Gaston Gonzalez
2015-05-26 5:12 ` Sudip Mukherjee
@ 2015-05-26 8:25 ` Dan Carpenter
1 sibling, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2015-05-26 8:25 UTC (permalink / raw)
To: Gaston Gonzalez
Cc: devel, hamohammed.sa, paul.gortmaker, gregkh, linux-kernel,
gdonald, cristina.opriceana
Btw, the subject should say "fix endian bug". "silence" means that
their is a warning and possible some messy code but no runtime bug.
On Mon, May 25, 2015 at 07:50:55PM -0300, Gaston Gonzalez wrote:
> On 25/05/15 13:35, Dan Carpenter wrote:
> > This is also wrong then.
> >
> > regards,
> > dan carpenter
> Hi Dan,
>
> Yes, you are right. It is the next sparse warning in line for that file.
> Including the fix for that, the patch would be as showed below.
>
> There are similar endianness warnings for other variables in that file,
> like the FIXME in last line of the patch. But keeping in mind the rule
> 'one thing per patch' I guess this should be fixed in other patche/s, right?
The one thing per patch rule is a bit fuzzy. It depends on how you sell
it a bit. I wouldn't mind if you fixed the whole function at once. Or
even all then endian bugs in a file if the patch wasn't too complicated.
But this is also acceptable to fix one struct member so send your
proposed patch.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-26 14:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-25 15:00 [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning Gaston Gonzalez
2015-05-25 16:35 ` Dan Carpenter
2015-05-25 22:50 ` Gaston Gonzalez
2015-05-26 5:12 ` Sudip Mukherjee
2015-05-26 8:25 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox