Commit 26a6b074 authored by Rashika Kheria's avatar Rashika Kheria Committed by Greg Kroah-Hartman

Staging: rtl8192e: Fix Sparse warning of restricted __le16 degrades to integer in rtllib_rx.c

This patch fixes the following sparse warning in rtllib_rx.c-
warning: restricted __le16 degrades to integer
Signed-off-by: default avatarRashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: default avatarJosh Triplett <josh@joshtriplett.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f5a0d0c
...@@ -2528,29 +2528,30 @@ static inline void rtllib_process_probe_response( ...@@ -2528,29 +2528,30 @@ static inline void rtllib_process_probe_response(
"'%s' ( %pM ): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", "'%s' ( %pM ): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
escape_essid(info_element->data, info_element->len), escape_essid(info_element->data, info_element->len),
beacon->header.addr3, beacon->header.addr3,
(beacon->capability & (1<<0xf)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0xf)) ? '1' : '0',
(beacon->capability & (1<<0xe)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0xe)) ? '1' : '0',
(beacon->capability & (1<<0xd)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0xd)) ? '1' : '0',
(beacon->capability & (1<<0xc)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0xc)) ? '1' : '0',
(beacon->capability & (1<<0xb)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0xb)) ? '1' : '0',
(beacon->capability & (1<<0xa)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0xa)) ? '1' : '0',
(beacon->capability & (1<<0x9)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x9)) ? '1' : '0',
(beacon->capability & (1<<0x8)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x8)) ? '1' : '0',
(beacon->capability & (1<<0x7)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x7)) ? '1' : '0',
(beacon->capability & (1<<0x6)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x6)) ? '1' : '0',
(beacon->capability & (1<<0x5)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x5)) ? '1' : '0',
(beacon->capability & (1<<0x4)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x4)) ? '1' : '0',
(beacon->capability & (1<<0x3)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x3)) ? '1' : '0',
(beacon->capability & (1<<0x2)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x2)) ? '1' : '0',
(beacon->capability & (1<<0x1)) ? '1' : '0', (le16_to_cpu(beacon->capability) & (1<<0x1)) ? '1' : '0',
(beacon->capability & (1<<0x0)) ? '1' : '0'); (le16_to_cpu(beacon->capability) & (1<<0x0)) ? '1' : '0');
if (rtllib_network_init(ieee, beacon, network, stats)) { if (rtllib_network_init(ieee, beacon, network, stats)) {
RTLLIB_DEBUG_SCAN("Dropped '%s' ( %pM) via %s.\n", RTLLIB_DEBUG_SCAN("Dropped '%s' ( %pM) via %s.\n",
escape_essid(info_element->data, escape_essid(info_element->data,
info_element->len), info_element->len),
beacon->header.addr3, beacon->header.addr3,
WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == WLAN_FC_GET_STYPE(
le16_to_cpu(beacon->header.frame_ctl)) ==
RTLLIB_STYPE_PROBE_RESP ? RTLLIB_STYPE_PROBE_RESP ?
"PROBE RESPONSE" : "BEACON"); "PROBE RESPONSE" : "BEACON");
goto free_network; goto free_network;
...@@ -2560,7 +2561,7 @@ static inline void rtllib_process_probe_response( ...@@ -2560,7 +2561,7 @@ static inline void rtllib_process_probe_response(
if (!rtllib_legal_channel(ieee, network->channel)) if (!rtllib_legal_channel(ieee, network->channel))
goto free_network; goto free_network;
if (WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == if (WLAN_FC_GET_STYPE(le16_to_cpu(beacon->header.frame_ctl)) ==
RTLLIB_STYPE_PROBE_RESP) { RTLLIB_STYPE_PROBE_RESP) {
if (IsPassiveChannel(ieee, network->channel)) { if (IsPassiveChannel(ieee, network->channel)) {
printk(KERN_INFO "GetScanInfo(): For Global Domain, " printk(KERN_INFO "GetScanInfo(): For Global Domain, "
...@@ -2629,7 +2630,8 @@ static inline void rtllib_process_probe_response( ...@@ -2629,7 +2630,8 @@ static inline void rtllib_process_probe_response(
RTLLIB_DEBUG_SCAN("Adding '%s' ( %pM) via %s.\n", RTLLIB_DEBUG_SCAN("Adding '%s' ( %pM) via %s.\n",
escape_essid(network->ssid, escape_essid(network->ssid,
network->ssid_len), network->bssid, network->ssid_len), network->bssid,
WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == WLAN_FC_GET_STYPE(
le16_to_cpu(beacon->header.frame_ctl)) ==
RTLLIB_STYPE_PROBE_RESP ? RTLLIB_STYPE_PROBE_RESP ?
"PROBE RESPONSE" : "BEACON"); "PROBE RESPONSE" : "BEACON");
memcpy(target, network, sizeof(*target)); memcpy(target, network, sizeof(*target));
...@@ -2640,7 +2642,8 @@ static inline void rtllib_process_probe_response( ...@@ -2640,7 +2642,8 @@ static inline void rtllib_process_probe_response(
RTLLIB_DEBUG_SCAN("Updating '%s' ( %pM) via %s.\n", RTLLIB_DEBUG_SCAN("Updating '%s' ( %pM) via %s.\n",
escape_essid(target->ssid, escape_essid(target->ssid,
target->ssid_len), target->bssid, target->ssid_len), target->bssid,
WLAN_FC_GET_STYPE(beacon->header.frame_ctl) == WLAN_FC_GET_STYPE(
le16_to_cpu(beacon->header.frame_ctl)) ==
RTLLIB_STYPE_PROBE_RESP ? RTLLIB_STYPE_PROBE_RESP ?
"PROBE RESPONSE" : "BEACON"); "PROBE RESPONSE" : "BEACON");
...@@ -2682,15 +2685,17 @@ void rtllib_rx_mgt(struct rtllib_device *ieee, ...@@ -2682,15 +2685,17 @@ void rtllib_rx_mgt(struct rtllib_device *ieee,
{ {
struct rtllib_hdr_4addr *header = (struct rtllib_hdr_4addr *)skb->data ; struct rtllib_hdr_4addr *header = (struct rtllib_hdr_4addr *)skb->data ;
if (WLAN_FC_GET_STYPE(header->frame_ctl) != RTLLIB_STYPE_PROBE_RESP && if ((WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) !=
WLAN_FC_GET_STYPE(header->frame_ctl) != RTLLIB_STYPE_BEACON) RTLLIB_STYPE_PROBE_RESP) &&
(WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) !=
RTLLIB_STYPE_BEACON))
ieee->last_rx_ps_time = jiffies; ieee->last_rx_ps_time = jiffies;
switch (WLAN_FC_GET_STYPE(header->frame_ctl)) { switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
case RTLLIB_STYPE_BEACON: case RTLLIB_STYPE_BEACON:
RTLLIB_DEBUG_MGMT("received BEACON (%d)\n", RTLLIB_DEBUG_MGMT("received BEACON (%d)\n",
WLAN_FC_GET_STYPE(header->frame_ctl)); WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
RTLLIB_DEBUG_SCAN("Beacon\n"); RTLLIB_DEBUG_SCAN("Beacon\n");
rtllib_process_probe_response( rtllib_process_probe_response(
ieee, (struct rtllib_probe_response *)header, ieee, (struct rtllib_probe_response *)header,
...@@ -2705,14 +2710,15 @@ void rtllib_rx_mgt(struct rtllib_device *ieee, ...@@ -2705,14 +2710,15 @@ void rtllib_rx_mgt(struct rtllib_device *ieee,
case RTLLIB_STYPE_PROBE_RESP: case RTLLIB_STYPE_PROBE_RESP:
RTLLIB_DEBUG_MGMT("received PROBE RESPONSE (%d)\n", RTLLIB_DEBUG_MGMT("received PROBE RESPONSE (%d)\n",
WLAN_FC_GET_STYPE(header->frame_ctl)); WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
RTLLIB_DEBUG_SCAN("Probe response\n"); RTLLIB_DEBUG_SCAN("Probe response\n");
rtllib_process_probe_response(ieee, rtllib_process_probe_response(ieee,
(struct rtllib_probe_response *)header, stats); (struct rtllib_probe_response *)header, stats);
break; break;
case RTLLIB_STYPE_PROBE_REQ: case RTLLIB_STYPE_PROBE_REQ:
RTLLIB_DEBUG_MGMT("received PROBE RESQUEST (%d)\n", RTLLIB_DEBUG_MGMT("received PROBE RESQUEST (%d)\n",
WLAN_FC_GET_STYPE(header->frame_ctl)); WLAN_FC_GET_STYPE(
le16_to_cpu(header->frame_ctl)));
RTLLIB_DEBUG_SCAN("Probe request\n"); RTLLIB_DEBUG_SCAN("Probe request\n");
if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) &&
((ieee->iw_mode == IW_MODE_ADHOC || ((ieee->iw_mode == IW_MODE_ADHOC ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment