* [PATCH] Drivers:net:wireless:ti:wl1251: Fixed Sparse invalid assignment warning
@ 2014-03-04 8:18 Surendra Patil
2014-03-05 16:50 ` Pavel Machek
2014-03-06 8:55 ` Luca Coelho
0 siblings, 2 replies; 3+ messages in thread
From: Surendra Patil @ 2014-03-04 8:18 UTC (permalink / raw)
To: linville
Cc: pavel, pali.rohar, david.gnedt, surendra.tux, linux-wireless,
netdev, linux-kernel
Sparse warns about invalid assignment in
drivers/net/wireless/ti/wl1251/cmd.c:451:42: warning: invalid assignment: |=
drivers/net/wireless/ti/wl1251/cmd.c:451:42: left side has type restricted __le16
drivers/net/wireless/ti/wl1251/cmd.c:451:42: right side has type int
Hence type converted right side to __le16.
Signed-off-by: Surendra Patil <surendra.tux@gmail.com>
---
drivers/net/wireless/ti/wl1251/cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c
index 223649b..bf1fa18 100644
--- a/drivers/net/wireless/ti/wl1251/cmd.c
+++ b/drivers/net/wireless/ti/wl1251/cmd.c
@@ -448,7 +448,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
* Note: This bug may be caused by the fw's DTIM handling.
*/
if (is_zero_ether_addr(wl->bssid))
- cmd->params.scan_options |= WL1251_SCAN_OPT_PRIORITY_HIGH;
+ cmd->params.scan_options |= cpu_to_le16(WL1251_SCAN_OPT_PRIORITY_HIGH);
cmd->params.num_channels = n_channels;
cmd->params.num_probe_requests = n_probes;
cmd->params.tx_rate = cpu_to_le16(1 << 1); /* 2 Mbps */
--
1.8.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Drivers:net:wireless:ti:wl1251: Fixed Sparse invalid assignment warning
2014-03-04 8:18 [PATCH] Drivers:net:wireless:ti:wl1251: Fixed Sparse invalid assignment warning Surendra Patil
@ 2014-03-05 16:50 ` Pavel Machek
2014-03-06 8:55 ` Luca Coelho
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2014-03-05 16:50 UTC (permalink / raw)
To: Surendra Patil
Cc: linville, pali.rohar, david.gnedt, linux-wireless, netdev, linux-kernel
On Tue 2014-03-04 00:18:52, Surendra Patil wrote:
> Sparse warns about invalid assignment in
> drivers/net/wireless/ti/wl1251/cmd.c:451:42: warning: invalid assignment: |=
> drivers/net/wireless/ti/wl1251/cmd.c:451:42: left side has type restricted __le16
> drivers/net/wireless/ti/wl1251/cmd.c:451:42: right side has type int
> Hence type converted right side to __le16.
>
> Signed-off-by: Surendra Patil <surendra.tux@gmail.com>
Acked-by: Pavel MMachek <pavel@ucw.cz>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Drivers:net:wireless:ti:wl1251: Fixed Sparse invalid assignment warning
2014-03-04 8:18 [PATCH] Drivers:net:wireless:ti:wl1251: Fixed Sparse invalid assignment warning Surendra Patil
2014-03-05 16:50 ` Pavel Machek
@ 2014-03-06 8:55 ` Luca Coelho
1 sibling, 0 replies; 3+ messages in thread
From: Luca Coelho @ 2014-03-06 8:55 UTC (permalink / raw)
To: Surendra Patil
Cc: linville, pavel, pali.rohar, david.gnedt, linux-wireless, netdev,
linux-kernel
On Tue, 2014-03-04 at 00:18 -0800, Surendra Patil wrote:
> Sparse warns about invalid assignment in
> drivers/net/wireless/ti/wl1251/cmd.c:451:42: warning: invalid assignment: |=
> drivers/net/wireless/ti/wl1251/cmd.c:451:42: left side has type restricted __le16
> drivers/net/wireless/ti/wl1251/cmd.c:451:42: right side has type int
> Hence type converted right side to __le16.
>
> Signed-off-by: Surendra Patil <surendra.tux@gmail.com>
> ---
> drivers/net/wireless/ti/wl1251/cmd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ti/wl1251/cmd.c b/drivers/net/wireless/ti/wl1251/cmd.c
> index 223649b..bf1fa18 100644
> --- a/drivers/net/wireless/ti/wl1251/cmd.c
> +++ b/drivers/net/wireless/ti/wl1251/cmd.c
> @@ -448,7 +448,7 @@ int wl1251_cmd_scan(struct wl1251 *wl, u8 *ssid, size_t ssid_len,
> * Note: This bug may be caused by the fw's DTIM handling.
> */
> if (is_zero_ether_addr(wl->bssid))
> - cmd->params.scan_options |= WL1251_SCAN_OPT_PRIORITY_HIGH;
> + cmd->params.scan_options |= cpu_to_le16(WL1251_SCAN_OPT_PRIORITY_HIGH);
> cmd->params.num_channels = n_channels;
> cmd->params.num_probe_requests = n_probes;
> cmd->params.tx_rate = cpu_to_le16(1 << 1); /* 2 Mbps */
AFAIR wl1251 is not really endianess-safe. I think there are lots of
other places where endianess macros should be added.
Nothing wrong with this patch, I'm just saying that while at it, maybe
someone could take care of all the endianess issues with wl1251? ;)
--
Luca.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-06 8:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-04 8:18 [PATCH] Drivers:net:wireless:ti:wl1251: Fixed Sparse invalid assignment warning Surendra Patil
2014-03-05 16:50 ` Pavel Machek
2014-03-06 8:55 ` Luca Coelho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).