diff options
author | Rajkumar Manoharan <rmanoharan@atheros.com> | 2011-04-25 06:26:17 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-26 15:50:31 -0400 |
commit | 0915cba394268e68b6a8242b15f8c7283453df43 (patch) | |
tree | 184498cf778c3feefd6b78d2856f082135e14f04 | |
parent | 334df731976ee4042c9bf18b2eec9c0a71f45389 (diff) |
mac80211: Fix warnings due to -Wunused-but-set-variable
These warnings are exposed by gcc 4.6.
net/mac80211/sta_info.c: In function 'sta_info_cleanup_expire_buffered':
net/mac80211/sta_info.c:590:32: warning: variable 'sdata' set but not used
net/mac80211/ibss.c: In function 'ieee80211_rx_mgmt_auth_ibss':
net/mac80211/ibss.c:43:34: warning: variable 'status_code' set but not used
net/mac80211/work.c: In function 'ieee80211_send_assoc':
net/mac80211/work.c:203:9: warning: variable 'len' set but not used
net/mac80211/tx.c: In function '__ieee80211_parse_tx_radiotap':
net/mac80211/tx.c:1039:35: warning: variable 'sband' set but not used
net/mac80211/mesh.c: In function 'ieee80211_mesh_rx_queued_mgmt':
net/mac80211/mesh.c:616:28: warning: variable 'ifmsh' set but not used
...
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/aes_ccm.c | 6 | ||||
-rw-r--r-- | net/mac80211/ibss.c | 7 | ||||
-rw-r--r-- | net/mac80211/mesh.c | 3 | ||||
-rw-r--r-- | net/mac80211/mesh_hwmp.c | 4 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 2 | ||||
-rw-r--r-- | net/mac80211/tx.c | 8 | ||||
-rw-r--r-- | net/mac80211/work.c | 6 |
7 files changed, 5 insertions, 31 deletions
diff --git a/net/mac80211/aes_ccm.c b/net/mac80211/aes_ccm.c index 4bd6ef0be380..b9b595c08112 100644 --- a/net/mac80211/aes_ccm.c +++ b/net/mac80211/aes_ccm.c | |||
@@ -54,13 +54,12 @@ void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *scratch, | |||
54 | u8 *cdata, u8 *mic) | 54 | u8 *cdata, u8 *mic) |
55 | { | 55 | { |
56 | int i, j, last_len, num_blocks; | 56 | int i, j, last_len, num_blocks; |
57 | u8 *pos, *cpos, *b, *s_0, *e, *b_0, *aad; | 57 | u8 *pos, *cpos, *b, *s_0, *e, *b_0; |
58 | 58 | ||
59 | b = scratch; | 59 | b = scratch; |
60 | s_0 = scratch + AES_BLOCK_LEN; | 60 | s_0 = scratch + AES_BLOCK_LEN; |
61 | e = scratch + 2 * AES_BLOCK_LEN; | 61 | e = scratch + 2 * AES_BLOCK_LEN; |
62 | b_0 = scratch + 3 * AES_BLOCK_LEN; | 62 | b_0 = scratch + 3 * AES_BLOCK_LEN; |
63 | aad = scratch + 4 * AES_BLOCK_LEN; | ||
64 | 63 | ||
65 | num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); | 64 | num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
66 | last_len = data_len % AES_BLOCK_LEN; | 65 | last_len = data_len % AES_BLOCK_LEN; |
@@ -94,13 +93,12 @@ int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch, | |||
94 | u8 *cdata, size_t data_len, u8 *mic, u8 *data) | 93 | u8 *cdata, size_t data_len, u8 *mic, u8 *data) |
95 | { | 94 | { |
96 | int i, j, last_len, num_blocks; | 95 | int i, j, last_len, num_blocks; |
97 | u8 *pos, *cpos, *b, *s_0, *a, *b_0, *aad; | 96 | u8 *pos, *cpos, *b, *s_0, *a, *b_0; |
98 | 97 | ||
99 | b = scratch; | 98 | b = scratch; |
100 | s_0 = scratch + AES_BLOCK_LEN; | 99 | s_0 = scratch + AES_BLOCK_LEN; |
101 | a = scratch + 2 * AES_BLOCK_LEN; | 100 | a = scratch + 2 * AES_BLOCK_LEN; |
102 | b_0 = scratch + 3 * AES_BLOCK_LEN; | 101 | b_0 = scratch + 3 * AES_BLOCK_LEN; |
103 | aad = scratch + 4 * AES_BLOCK_LEN; | ||
104 | 102 | ||
105 | num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); | 103 | num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN); |
106 | last_len = data_len % AES_BLOCK_LEN; | 104 | last_len = data_len % AES_BLOCK_LEN; |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 14883966374e..b81860c94698 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -40,7 +40,7 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata, | |||
40 | struct ieee80211_mgmt *mgmt, | 40 | struct ieee80211_mgmt *mgmt, |
41 | size_t len) | 41 | size_t len) |
42 | { | 42 | { |
43 | u16 auth_alg, auth_transaction, status_code; | 43 | u16 auth_alg, auth_transaction; |
44 | 44 | ||
45 | lockdep_assert_held(&sdata->u.ibss.mtx); | 45 | lockdep_assert_held(&sdata->u.ibss.mtx); |
46 | 46 | ||
@@ -49,7 +49,6 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata, | |||
49 | 49 | ||
50 | auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg); | 50 | auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg); |
51 | auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); | 51 | auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); |
52 | status_code = le16_to_cpu(mgmt->u.auth.status_code); | ||
53 | 52 | ||
54 | /* | 53 | /* |
55 | * IEEE 802.11 standard does not require authentication in IBSS | 54 | * IEEE 802.11 standard does not require authentication in IBSS |
@@ -527,8 +526,6 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata) | |||
527 | static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | 526 | static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) |
528 | { | 527 | { |
529 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; | 528 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; |
530 | struct ieee80211_local *local = sdata->local; | ||
531 | struct ieee80211_supported_band *sband; | ||
532 | u8 bssid[ETH_ALEN]; | 529 | u8 bssid[ETH_ALEN]; |
533 | u16 capability; | 530 | u16 capability; |
534 | int i; | 531 | int i; |
@@ -551,8 +548,6 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | |||
551 | printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n", | 548 | printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n", |
552 | sdata->name, bssid); | 549 | sdata->name, bssid); |
553 | 550 | ||
554 | sband = local->hw.wiphy->bands[ifibss->channel->band]; | ||
555 | |||
556 | capability = WLAN_CAPABILITY_IBSS; | 551 | capability = WLAN_CAPABILITY_IBSS; |
557 | 552 | ||
558 | if (ifibss->privacy) | 553 | if (ifibss->privacy) |
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 11207979e2e2..c1299e249541 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -613,12 +613,9 @@ void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
613 | struct sk_buff *skb) | 613 | struct sk_buff *skb) |
614 | { | 614 | { |
615 | struct ieee80211_rx_status *rx_status; | 615 | struct ieee80211_rx_status *rx_status; |
616 | struct ieee80211_if_mesh *ifmsh; | ||
617 | struct ieee80211_mgmt *mgmt; | 616 | struct ieee80211_mgmt *mgmt; |
618 | u16 stype; | 617 | u16 stype; |
619 | 618 | ||
620 | ifmsh = &sdata->u.mesh; | ||
621 | |||
622 | rx_status = IEEE80211_SKB_RXCB(skb); | 619 | rx_status = IEEE80211_SKB_RXCB(skb); |
623 | mgmt = (struct ieee80211_mgmt *) skb->data; | 620 | mgmt = (struct ieee80211_mgmt *) skb->data; |
624 | stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE; | 621 | stype = le16_to_cpu(mgmt->frame_control) & IEEE80211_FCTL_STYPE; |
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 5bf64d7112b3..e57f2e728cfe 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -633,7 +633,6 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, | |||
633 | struct mesh_path *mpath; | 633 | struct mesh_path *mpath; |
634 | u8 ttl; | 634 | u8 ttl; |
635 | u8 *ta, *target_addr; | 635 | u8 *ta, *target_addr; |
636 | u8 target_flags; | ||
637 | u32 target_sn; | 636 | u32 target_sn; |
638 | u16 target_rcode; | 637 | u16 target_rcode; |
639 | 638 | ||
@@ -644,7 +643,6 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata, | |||
644 | return; | 643 | return; |
645 | } | 644 | } |
646 | ttl--; | 645 | ttl--; |
647 | target_flags = PERR_IE_TARGET_FLAGS(perr_elem); | ||
648 | target_addr = PERR_IE_TARGET_ADDR(perr_elem); | 646 | target_addr = PERR_IE_TARGET_ADDR(perr_elem); |
649 | target_sn = PERR_IE_TARGET_SN(perr_elem); | 647 | target_sn = PERR_IE_TARGET_SN(perr_elem); |
650 | target_rcode = PERR_IE_TARGET_RCODE(perr_elem); | 648 | target_rcode = PERR_IE_TARGET_RCODE(perr_elem); |
@@ -675,12 +673,10 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata, | |||
675 | { | 673 | { |
676 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; | 674 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; |
677 | struct mesh_path *mpath; | 675 | struct mesh_path *mpath; |
678 | u8 *ta; | ||
679 | u8 ttl, flags, hopcount; | 676 | u8 ttl, flags, hopcount; |
680 | u8 *orig_addr; | 677 | u8 *orig_addr; |
681 | u32 orig_sn, metric; | 678 | u32 orig_sn, metric; |
682 | 679 | ||
683 | ta = mgmt->sa; | ||
684 | ttl = rann->rann_ttl; | 680 | ttl = rann->rann_ttl; |
685 | if (ttl <= 1) { | 681 | if (ttl <= 1) { |
686 | ifmsh->mshstats.dropped_frames_ttl++; | 682 | ifmsh->mshstats.dropped_frames_ttl++; |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 7c5c6da01bea..f05244dc773e 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -587,7 +587,6 @@ static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local, | |||
587 | { | 587 | { |
588 | unsigned long flags; | 588 | unsigned long flags; |
589 | struct sk_buff *skb; | 589 | struct sk_buff *skb; |
590 | struct ieee80211_sub_if_data *sdata; | ||
591 | 590 | ||
592 | if (skb_queue_empty(&sta->ps_tx_buf)) | 591 | if (skb_queue_empty(&sta->ps_tx_buf)) |
593 | return false; | 592 | return false; |
@@ -604,7 +603,6 @@ static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local, | |||
604 | if (!skb) | 603 | if (!skb) |
605 | break; | 604 | break; |
606 | 605 | ||
607 | sdata = sta->sdata; | ||
608 | local->total_ps_buffered--; | 606 | local->total_ps_buffered--; |
609 | #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG | 607 | #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG |
610 | printk(KERN_DEBUG "Buffered frame expired (STA %pM)\n", | 608 | printk(KERN_DEBUG "Buffered frame expired (STA %pM)\n", |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 17b10be31f55..a2043e405493 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1036,14 +1036,11 @@ static bool __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx, | |||
1036 | struct ieee80211_radiotap_iterator iterator; | 1036 | struct ieee80211_radiotap_iterator iterator; |
1037 | struct ieee80211_radiotap_header *rthdr = | 1037 | struct ieee80211_radiotap_header *rthdr = |
1038 | (struct ieee80211_radiotap_header *) skb->data; | 1038 | (struct ieee80211_radiotap_header *) skb->data; |
1039 | struct ieee80211_supported_band *sband; | ||
1040 | bool hw_frag; | 1039 | bool hw_frag; |
1041 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1040 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1042 | int ret = ieee80211_radiotap_iterator_init(&iterator, rthdr, skb->len, | 1041 | int ret = ieee80211_radiotap_iterator_init(&iterator, rthdr, skb->len, |
1043 | NULL); | 1042 | NULL); |
1044 | 1043 | ||
1045 | sband = tx->local->hw.wiphy->bands[tx->channel->band]; | ||
1046 | |||
1047 | info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; | 1044 | info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; |
1048 | tx->flags &= ~IEEE80211_TX_FRAGMENTED; | 1045 | tx->flags &= ~IEEE80211_TX_FRAGMENTED; |
1049 | 1046 | ||
@@ -1442,11 +1439,8 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata, | |||
1442 | struct ieee80211_tx_data tx; | 1439 | struct ieee80211_tx_data tx; |
1443 | ieee80211_tx_result res_prepare; | 1440 | ieee80211_tx_result res_prepare; |
1444 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 1441 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
1445 | u16 queue; | ||
1446 | bool result = true; | 1442 | bool result = true; |
1447 | 1443 | ||
1448 | queue = skb_get_queue_mapping(skb); | ||
1449 | |||
1450 | if (unlikely(skb->len < 10)) { | 1444 | if (unlikely(skb->len < 10)) { |
1451 | dev_kfree_skb(skb); | 1445 | dev_kfree_skb(skb); |
1452 | return true; | 1446 | return true; |
@@ -2485,7 +2479,6 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, | |||
2485 | { | 2479 | { |
2486 | struct ieee80211_local *local = hw_to_local(hw); | 2480 | struct ieee80211_local *local = hw_to_local(hw); |
2487 | struct sk_buff *skb = NULL; | 2481 | struct sk_buff *skb = NULL; |
2488 | struct sta_info *sta; | ||
2489 | struct ieee80211_tx_data tx; | 2482 | struct ieee80211_tx_data tx; |
2490 | struct ieee80211_sub_if_data *sdata; | 2483 | struct ieee80211_sub_if_data *sdata; |
2491 | struct ieee80211_if_ap *bss = NULL; | 2484 | struct ieee80211_if_ap *bss = NULL; |
@@ -2527,7 +2520,6 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, | |||
2527 | 2520 | ||
2528 | info = IEEE80211_SKB_CB(skb); | 2521 | info = IEEE80211_SKB_CB(skb); |
2529 | 2522 | ||
2530 | sta = tx.sta; | ||
2531 | tx.flags |= IEEE80211_TX_PS_BUFFERED; | 2523 | tx.flags |= IEEE80211_TX_PS_BUFFERED; |
2532 | tx.channel = local->hw.conf.channel; | 2524 | tx.channel = local->hw.conf.channel; |
2533 | info->band = tx.channel->band; | 2525 | info->band = tx.channel->band; |
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index e73c8cae036b..a94b312dbfac 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
@@ -198,9 +198,8 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | |||
198 | struct sk_buff *skb; | 198 | struct sk_buff *skb; |
199 | struct ieee80211_mgmt *mgmt; | 199 | struct ieee80211_mgmt *mgmt; |
200 | u8 *pos, qos_info; | 200 | u8 *pos, qos_info; |
201 | const u8 *ies; | ||
202 | size_t offset = 0, noffset; | 201 | size_t offset = 0, noffset; |
203 | int i, len, count, rates_len, supp_rates_len; | 202 | int i, count, rates_len, supp_rates_len; |
204 | u16 capab; | 203 | u16 capab; |
205 | struct ieee80211_supported_band *sband; | 204 | struct ieee80211_supported_band *sband; |
206 | u32 rates = 0; | 205 | u32 rates = 0; |
@@ -285,7 +284,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | |||
285 | } | 284 | } |
286 | 285 | ||
287 | /* SSID */ | 286 | /* SSID */ |
288 | ies = pos = skb_put(skb, 2 + wk->assoc.ssid_len); | 287 | pos = skb_put(skb, 2 + wk->assoc.ssid_len); |
289 | *pos++ = WLAN_EID_SSID; | 288 | *pos++ = WLAN_EID_SSID; |
290 | *pos++ = wk->assoc.ssid_len; | 289 | *pos++ = wk->assoc.ssid_len; |
291 | memcpy(pos, wk->assoc.ssid, wk->assoc.ssid_len); | 290 | memcpy(pos, wk->assoc.ssid, wk->assoc.ssid_len); |
@@ -295,7 +294,6 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | |||
295 | if (supp_rates_len > 8) | 294 | if (supp_rates_len > 8) |
296 | supp_rates_len = 8; | 295 | supp_rates_len = 8; |
297 | 296 | ||
298 | len = sband->n_bitrates; | ||
299 | pos = skb_put(skb, supp_rates_len + 2); | 297 | pos = skb_put(skb, supp_rates_len + 2); |
300 | *pos++ = WLAN_EID_SUPP_RATES; | 298 | *pos++ = WLAN_EID_SUPP_RATES; |
301 | *pos++ = supp_rates_len; | 299 | *pos++ = supp_rates_len; |