* [PATCH] staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings
@ 2015-01-18 7:11 Asaf Vertz
2015-01-25 12:01 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Asaf Vertz @ 2015-01-18 7:11 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel
Fixed the following warnings (reported by sparse):
drivers/staging/wlan-ng/hfa384x_usb.c:3828:36: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3229:16: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3430:18: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3349:51: warning: restricted __le16 degrades to integer
drivers/staging/wlan-ng/hfa384x_usb.c:3357:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3358:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3393:36: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3102:28: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:3004:28: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:1308:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: warning: incorrect type in assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: expected unsigned short [unsigned] [usertype] type
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: got restricted __le16 [usertype] <noident>
Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
---
drivers/staging/wlan-ng/hfa384x.h | 4 ++--
drivers/staging/wlan-ng/hfa384x_usb.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wlan-ng/hfa384x.h b/drivers/staging/wlan-ng/hfa384x.h
index 20d146b..964a662 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -879,7 +879,7 @@ typedef struct hfa384x_usb_error {
/* Unions for packaging all the known packet types together */
typedef union hfa384x_usbout {
- u16 type;
+ __le16 type;
hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_cmdreq_t cmdreq;
hfa384x_usb_wridreq_t wridreq;
@@ -889,7 +889,7 @@ typedef union hfa384x_usbout {
} __packed hfa384x_usbout_t;
typedef union hfa384x_usbin {
- u16 type;
+ __le16 type;
hfa384x_usb_rxfrm_t rxfrm;
hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_infofrm_t infofrm;
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index 55d2f56..e84ebb9 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3346,7 +3346,7 @@ retry:
if (unlocked_usbctlx_cancel_async(hw, ctlx) == 0)
run_queue = 1;
} else {
- const u16 intype = (usbin->type & ~cpu_to_le16(0x8000));
+ const __le16 intype = (usbin->type & ~cpu_to_le16(0x8000));
/*
* Check that our message is what we're expecting ...
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings
2015-01-18 7:11 [PATCH] staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings Asaf Vertz
@ 2015-01-25 12:01 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2015-01-25 12:01 UTC (permalink / raw)
To: Asaf Vertz; +Cc: devel, linux-kernel
On Sun, Jan 18, 2015 at 09:11:39AM +0200, Asaf Vertz wrote:
> Fixed the following warnings (reported by sparse):
> drivers/staging/wlan-ng/hfa384x_usb.c:3828:36: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3229:16: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3430:18: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3349:51: warning: restricted __le16 degrades to integer
> drivers/staging/wlan-ng/hfa384x_usb.c:3357:37: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3358:37: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3393:36: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3102:28: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:3004:28: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:1308:37: warning: cast to restricted __le16
> drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: warning: incorrect type in assignment (different base types)
> drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: expected unsigned short [unsigned] [usertype] type
> drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: got restricted __le16 [usertype] <noident>
>
> Signed-off-by: Asaf Vertz <asaf.vertz@tandemg.com>
> ---
> drivers/staging/wlan-ng/hfa384x.h | 4 ++--
> drivers/staging/wlan-ng/hfa384x_usb.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
Applied, thanks.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-25 16:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-18 7:11 [PATCH] staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings Asaf Vertz
2015-01-25 12:01 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox