diff options
author | Joe Perches <joe@perches.com> | 2012-06-04 08:44:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-06 12:31:33 -0400 |
commit | 2c208890c6d4e16076c6664137703ec813e8fa6c (patch) | |
tree | dd25049d7fdaf305679acc08f4b36fbcdbdb0213 /drivers/net/wireless/mwifiex/scan.c | |
parent | 6469933605a3ecdfa66b98160cde98ecd256cb3f (diff) |
wireless: Remove casts to same type
Adding casts of objects to the same type is unnecessary
and confusing for a human reader.
For example, this cast:
int y;
int *p = (int *)&y;
I used the coccinelle script below to find and remove these
unnecessary casts. I manually removed the conversions this
script produces of casts with __force, __iomem and __user.
@@
type T;
T *p;
@@
- (T *)p
+ p
Neatened the mwifiex_deauthenticate_infra function which
was doing odd things with array pointers and not using
is_zero_ether_addr.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/scan.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 74f045715723..8fa763fa629a 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c | |||
@@ -1014,14 +1014,12 @@ mwifiex_ret_802_11_scan_get_tlv_ptrs(struct mwifiex_adapter *adapter, | |||
1014 | case TLV_TYPE_TSFTIMESTAMP: | 1014 | case TLV_TYPE_TSFTIMESTAMP: |
1015 | dev_dbg(adapter->dev, "info: SCAN_RESP: TSF " | 1015 | dev_dbg(adapter->dev, "info: SCAN_RESP: TSF " |
1016 | "timestamp TLV, len = %d\n", tlv_len); | 1016 | "timestamp TLV, len = %d\n", tlv_len); |
1017 | *tlv_data = (struct mwifiex_ie_types_data *) | 1017 | *tlv_data = current_tlv; |
1018 | current_tlv; | ||
1019 | break; | 1018 | break; |
1020 | case TLV_TYPE_CHANNELBANDLIST: | 1019 | case TLV_TYPE_CHANNELBANDLIST: |
1021 | dev_dbg(adapter->dev, "info: SCAN_RESP: channel" | 1020 | dev_dbg(adapter->dev, "info: SCAN_RESP: channel" |
1022 | " band list TLV, len = %d\n", tlv_len); | 1021 | " band list TLV, len = %d\n", tlv_len); |
1023 | *tlv_data = (struct mwifiex_ie_types_data *) | 1022 | *tlv_data = current_tlv; |
1024 | current_tlv; | ||
1025 | break; | 1023 | break; |
1026 | default: | 1024 | default: |
1027 | dev_err(adapter->dev, | 1025 | dev_err(adapter->dev, |
@@ -1226,15 +1224,15 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, | |||
1226 | bss_entry->beacon_buf); | 1224 | bss_entry->beacon_buf); |
1227 | break; | 1225 | break; |
1228 | case WLAN_EID_BSS_COEX_2040: | 1226 | case WLAN_EID_BSS_COEX_2040: |
1229 | bss_entry->bcn_bss_co_2040 = (u8 *) (current_ptr + | 1227 | bss_entry->bcn_bss_co_2040 = current_ptr + |
1230 | sizeof(struct ieee_types_header)); | 1228 | sizeof(struct ieee_types_header); |
1231 | bss_entry->bss_co_2040_offset = (u16) (current_ptr + | 1229 | bss_entry->bss_co_2040_offset = (u16) (current_ptr + |
1232 | sizeof(struct ieee_types_header) - | 1230 | sizeof(struct ieee_types_header) - |
1233 | bss_entry->beacon_buf); | 1231 | bss_entry->beacon_buf); |
1234 | break; | 1232 | break; |
1235 | case WLAN_EID_EXT_CAPABILITY: | 1233 | case WLAN_EID_EXT_CAPABILITY: |
1236 | bss_entry->bcn_ext_cap = (u8 *) (current_ptr + | 1234 | bss_entry->bcn_ext_cap = current_ptr + |
1237 | sizeof(struct ieee_types_header)); | 1235 | sizeof(struct ieee_types_header); |
1238 | bss_entry->ext_cap_offset = (u16) (current_ptr + | 1236 | bss_entry->ext_cap_offset = (u16) (current_ptr + |
1239 | sizeof(struct ieee_types_header) - | 1237 | sizeof(struct ieee_types_header) - |
1240 | bss_entry->beacon_buf); | 1238 | bss_entry->beacon_buf); |
@@ -1683,8 +1681,7 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv, | |||
1683 | goto done; | 1681 | goto done; |
1684 | } | 1682 | } |
1685 | if (element_id == WLAN_EID_DS_PARAMS) { | 1683 | if (element_id == WLAN_EID_DS_PARAMS) { |
1686 | channel = *(u8 *) (current_ptr + | 1684 | channel = *(current_ptr + sizeof(struct ieee_types_header)); |
1687 | sizeof(struct ieee_types_header)); | ||
1688 | break; | 1685 | break; |
1689 | } | 1686 | } |
1690 | 1687 | ||
@@ -2010,12 +2007,11 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv) | |||
2010 | 2007 | ||
2011 | if (curr_bss->bcn_bss_co_2040) | 2008 | if (curr_bss->bcn_bss_co_2040) |
2012 | curr_bss->bcn_bss_co_2040 = | 2009 | curr_bss->bcn_bss_co_2040 = |
2013 | (u8 *) (curr_bss->beacon_buf + | 2010 | (curr_bss->beacon_buf + curr_bss->bss_co_2040_offset); |
2014 | curr_bss->bss_co_2040_offset); | ||
2015 | 2011 | ||
2016 | if (curr_bss->bcn_ext_cap) | 2012 | if (curr_bss->bcn_ext_cap) |
2017 | curr_bss->bcn_ext_cap = (u8 *) (curr_bss->beacon_buf + | 2013 | curr_bss->bcn_ext_cap = curr_bss->beacon_buf + |
2018 | curr_bss->ext_cap_offset); | 2014 | curr_bss->ext_cap_offset; |
2019 | } | 2015 | } |
2020 | 2016 | ||
2021 | /* | 2017 | /* |