2011-04-25 10:26:23

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 1/5] wireless: Fix warnings due to -Wunused-but-set-variable

These warnings are exposed by gcc 4.6.
net/wireless/reg.c: In function 'freq_reg_info_regd':
net/wireless/reg.c:675:38: warning: variable 'pr' set but not used
[-Wunused-but-set-variable]
net/wireless/lib80211_crypt_wep.c: In function 'lib80211_wep_build_iv':
net/wireless/lib80211_crypt_wep.c:99:12: warning: variable 'len' set but
not used [-Wunused-but-set-variable]

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
net/wireless/lib80211_crypt_wep.c | 3 +--
net/wireless/reg.c | 2 --
2 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/net/wireless/lib80211_crypt_wep.c b/net/wireless/lib80211_crypt_wep.c
index e2e8887..2f265e0 100644
--- a/net/wireless/lib80211_crypt_wep.c
+++ b/net/wireless/lib80211_crypt_wep.c
@@ -96,13 +96,12 @@ static int lib80211_wep_build_iv(struct sk_buff *skb, int hdr_len,
u8 *key, int keylen, void *priv)
{
struct lib80211_wep_data *wep = priv;
- u32 klen, len;
+ u32 klen;
u8 *pos;

if (skb_headroom(skb) < 4 || skb->len < hdr_len)
return -1;

- len = skb->len - hdr_len;
pos = skb_push(skb, 4);
memmove(pos, pos + 4, hdr_len);
pos += hdr_len;
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 58d6995..2642d18 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -672,11 +672,9 @@ static int freq_reg_info_regd(struct wiphy *wiphy,
for (i = 0; i < regd->n_reg_rules; i++) {
const struct ieee80211_reg_rule *rr;
const struct ieee80211_freq_range *fr = NULL;
- const struct ieee80211_power_rule *pr = NULL;

rr = &regd->reg_rules[i];
fr = &rr->freq_range;
- pr = &rr->power_rule;

/*
* We only need to know if one frequency rule was
--
1.7.4.4



2011-04-26 20:00:49

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 4/5] ath9k_htc: Fix warnings due to -Wunused-but-set-variable

On Mon, Apr 25, 2011 at 03:56:19PM +0530, Rajkumar Manoharan wrote:
> These warnings are exposed by gcc 4.6.
> drivers/net/wireless/ath/ath9k/htc_drv_txrx.c: In function
> 'ath9k_htc_tx_process':
> drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:449:35: warning: variable
> 'sband' set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/htc_drv_beacon.c: In function
> 'ath9k_htc_beacon_config_sta':
> drivers/net/wireless/ath/ath9k/htc_drv_main.c: In function
> 'ath9k_htc_stop':
> drivers/net/wireless/ath/ath9k/htc_drv_main.c:967:6: warning: variable
> 'ret' set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/htc_drv_main.c: In function
> 'ath9k_htc_remove_interface':
> drivers/net/wireless/ath/ath9k/htc_drv_gpio.c: In function
> 'ath_btcoex_period_work':
> drivers/net/wireless/ath/ath9k/htc_drv_gpio.c:67:6: warning: variable
> 'ret' set but not used [-Wunused-but-set-variable
> ...
>
> Signed-off-by: Rajkumar Manoharan <[email protected]>

This doesn't seem to apply -- what tree are you using?

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-04-25 10:26:40

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 4/5] ath9k_htc: Fix warnings due to -Wunused-but-set-variable

These warnings are exposed by gcc 4.6.
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c: In function
'ath9k_htc_tx_process':
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:449:35: warning: variable
'sband' set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c: In function
'ath9k_htc_beacon_config_sta':
drivers/net/wireless/ath/ath9k/htc_drv_main.c: In function
'ath9k_htc_stop':
drivers/net/wireless/ath/ath9k/htc_drv_main.c:967:6: warning: variable
'ret' set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/htc_drv_main.c: In function
'ath9k_htc_remove_interface':
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c: In function
'ath_btcoex_period_work':
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c:67:6: warning: variable
'ret' set but not used [-Wunused-but-set-variable
...

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c | 6 ++++++
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 2 ++
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 8 +++++++-
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | 2 --
4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
index a157107..ce6f0b5 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
@@ -181,6 +181,8 @@ static void ath9k_htc_beacon_config_sta(struct ath9k_htc_priv *priv,
imask |= ATH9K_INT_BMISS;
htc_imask = cpu_to_be32(imask);
WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask);
+ if (ret)
+ ath_err(common, "Failed to enable interrupts %s\n", __func__);
}

static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv,
@@ -237,6 +239,8 @@ static void ath9k_htc_beacon_config_ap(struct ath9k_htc_priv *priv,
priv->cur_beacon_conf.bmiss_cnt = 0;
htc_imask = cpu_to_be32(imask);
WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask);
+ if (ret)
+ ath_err(common, "Failed to enable interrupts %s\n", __func__);
}

static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,
@@ -284,6 +288,8 @@ static void ath9k_htc_beacon_config_adhoc(struct ath9k_htc_priv *priv,
priv->cur_beacon_conf.bmiss_cnt = 0;
htc_imask = cpu_to_be32(imask);
WMI_CMD_BUF(WMI_ENABLE_INTR_CMDID, &htc_imask);
+ if (ret)
+ ath_err(common, "Failed to enable interrupts %s\n", __func__);
}

void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
index dc0b33d..fc669c9 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
@@ -74,6 +74,8 @@ static void ath_btcoex_period_work(struct work_struct *work)
aggr = priv->op_flags & OP_BT_PRIORITY_DETECTED;

WMI_CMD_BUF(WMI_AGGR_LIMIT_CMD, &aggr);
+ if (ret)
+ ath_err(common, "Failed to set aggregate limit\n");

ath9k_cmn_btcoex_bt_stomp(common, is_btscan ? ATH_BTCOEX_STOMP_ALL :
btcoex->bt_stomp_type);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 4de3864..3aa996e 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -332,6 +332,8 @@ static void __ath9k_htc_remove_monitor_interface(struct ath9k_htc_priv *priv)
memcpy(&hvif.myaddr, common->macaddr, ETH_ALEN);
hvif.index = priv->mon_vif_idx;
WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif);
+ if (ret)
+ ath_err(common, "Unable to remove monitor interface\n");
priv->nvifs--;
priv->vif_slot &= ~(1 << priv->mon_vif_idx);
}
@@ -1008,7 +1010,9 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
if (priv->ah->is_monitoring)
ath9k_htc_remove_monitor_interface(priv);

- ath9k_hw_phy_disable(ah);
+ ret = ath9k_hw_phy_disable(ah);
+ if (ret)
+ ath_err(common, "Unable to disable PHY\n");
ath9k_hw_disable(ah);
ath9k_htc_ps_restore(priv);
ath9k_htc_setpower(priv, ATH9K_PM_FULL_SLEEP);
@@ -1135,6 +1139,8 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw,
memcpy(&hvif.myaddr, vif->addr, ETH_ALEN);
hvif.index = avp->index;
WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif);
+ if (ret)
+ ath_err(common, "Failed to remove interface %d\n", hvif.index);
priv->nvifs--;
priv->vif_slot &= ~(1 << avp->index);

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 723a3a9..a898dac 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -446,7 +446,6 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv,
struct ieee80211_tx_info *tx_info;
struct ieee80211_tx_rate *rate;
struct ieee80211_conf *cur_conf = &priv->hw->conf;
- struct ieee80211_supported_band *sband;
bool txok;
int slot;

@@ -461,7 +460,6 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv,
tx_info = IEEE80211_SKB_CB(skb);
vif = tx_info->control.vif;
rate = &tx_info->status.rates[0];
- sband = priv->hw->wiphy->bands[cur_conf->channel->band];

memset(&tx_info->status, 0, sizeof(tx_info->status));

--
1.7.4.4


2011-04-26 20:00:49

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH 5/5] ath9k_hw: Fix warnings due to -Wunused-but-set-variable

On Mon, Apr 25, 2011 at 03:56:20PM +0530, Rajkumar Manoharan wrote:
> These warnings are exposed by gcc 4.6.
> drivers/net/wireless/ath/ath9k/hw.c: In function
> 'ath9k_hw_fill_cap_info':
> drivers/net/wireless/ath/ath9k/hw.c:1796:6: warning: variable 'capField'
> set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/ar9003_phy.c: In function
> 'ar9003_hw_process_ini':
> drivers/net/wireless/ath/ath9k/ar9003_phy.c:602:18: warning: variable
> 'freqIndex' set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/eeprom_9287.c: In function
> 'ath9k_hw_set_ar9287_power_cal_table':
> drivers/net/wireless/ath/ath9k/eeprom_9287.c:322:10: warning: variable
> 'modalIdx' set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/ar9003_eeprom.c: In function
> 'ar9300_compress_decision':
> drivers/net/wireless/ath/ath9k/ar9003_eeprom.c:3220:6: warning: variable
> 'dptr' set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Rajkumar Manoharan <[email protected]>

This doesn't seem to apply either...

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-04-25 10:26:29

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 2/5] 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 <[email protected]>
---
net/mac80211/aes_ccm.c | 6 ++----
net/mac80211/ibss.c | 7 +------
net/mac80211/mesh.c | 3 ---
net/mac80211/mesh_hwmp.c | 4 ----
net/mac80211/sta_info.c | 2 --
net/mac80211/tx.c | 8 --------
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 4bd6ef0..b9b595c 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,
u8 *cdata, u8 *mic)
{
int i, j, last_len, num_blocks;
- u8 *pos, *cpos, *b, *s_0, *e, *b_0, *aad;
+ u8 *pos, *cpos, *b, *s_0, *e, *b_0;

b = scratch;
s_0 = scratch + AES_BLOCK_LEN;
e = scratch + 2 * AES_BLOCK_LEN;
b_0 = scratch + 3 * AES_BLOCK_LEN;
- aad = scratch + 4 * AES_BLOCK_LEN;

num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN);
last_len = data_len % AES_BLOCK_LEN;
@@ -94,13 +93,12 @@ int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *scratch,
u8 *cdata, size_t data_len, u8 *mic, u8 *data)
{
int i, j, last_len, num_blocks;
- u8 *pos, *cpos, *b, *s_0, *a, *b_0, *aad;
+ u8 *pos, *cpos, *b, *s_0, *a, *b_0;

b = scratch;
s_0 = scratch + AES_BLOCK_LEN;
a = scratch + 2 * AES_BLOCK_LEN;
b_0 = scratch + 3 * AES_BLOCK_LEN;
- aad = scratch + 4 * AES_BLOCK_LEN;

num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_LEN);
last_len = data_len % AES_BLOCK_LEN;
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 1488396..b81860c 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,
struct ieee80211_mgmt *mgmt,
size_t len)
{
- u16 auth_alg, auth_transaction, status_code;
+ u16 auth_alg, auth_transaction;

lockdep_assert_held(&sdata->u.ibss.mtx);

@@ -49,7 +49,6 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,

auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg);
auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction);
- status_code = le16_to_cpu(mgmt->u.auth.status_code);

/*
* 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)
static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
- struct ieee80211_local *local = sdata->local;
- struct ieee80211_supported_band *sband;
u8 bssid[ETH_ALEN];
u16 capability;
int i;
@@ -551,8 +548,6 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n",
sdata->name, bssid);

- sband = local->hw.wiphy->bands[ifibss->channel->band];
-
capability = WLAN_CAPABILITY_IBSS;

if (ifibss->privacy)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 1120797..c1299e2 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,
struct sk_buff *skb)
{
struct ieee80211_rx_status *rx_status;
- struct ieee80211_if_mesh *ifmsh;
struct ieee80211_mgmt *mgmt;
u16 stype;

- ifmsh = &sdata->u.mesh;
-
rx_status = IEEE80211_SKB_RXCB(skb);
mgmt = (struct ieee80211_mgmt *) skb->data;
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 5bf64d7..e57f2e7 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,
struct mesh_path *mpath;
u8 ttl;
u8 *ta, *target_addr;
- u8 target_flags;
u32 target_sn;
u16 target_rcode;

@@ -644,7 +643,6 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata,
return;
}
ttl--;
- target_flags = PERR_IE_TARGET_FLAGS(perr_elem);
target_addr = PERR_IE_TARGET_ADDR(perr_elem);
target_sn = PERR_IE_TARGET_SN(perr_elem);
target_rcode = PERR_IE_TARGET_RCODE(perr_elem);
@@ -675,12 +673,10 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
struct mesh_path *mpath;
- u8 *ta;
u8 ttl, flags, hopcount;
u8 *orig_addr;
u32 orig_sn, metric;

- ta = mgmt->sa;
ttl = rann->rann_ttl;
if (ttl <= 1) {
ifmsh->mshstats.dropped_frames_ttl++;
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index a03d8a3..d9e6e81 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,
{
unsigned long flags;
struct sk_buff *skb;
- struct ieee80211_sub_if_data *sdata;

if (skb_queue_empty(&sta->ps_tx_buf))
return false;
@@ -604,7 +603,6 @@ static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
if (!skb)
break;

- sdata = sta->sdata;
local->total_ps_buffered--;
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
printk(KERN_DEBUG "Buffered frame expired (STA %pM)\n",
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 17b10be..a2043e4 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,
struct ieee80211_radiotap_iterator iterator;
struct ieee80211_radiotap_header *rthdr =
(struct ieee80211_radiotap_header *) skb->data;
- struct ieee80211_supported_band *sband;
bool hw_frag;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
int ret = ieee80211_radiotap_iterator_init(&iterator, rthdr, skb->len,
NULL);

- sband = tx->local->hw.wiphy->bands[tx->channel->band];
-
info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
tx->flags &= ~IEEE80211_TX_FRAGMENTED;

@@ -1442,11 +1439,8 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,
struct ieee80211_tx_data tx;
ieee80211_tx_result res_prepare;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- u16 queue;
bool result = true;

- queue = skb_get_queue_mapping(skb);
-
if (unlikely(skb->len < 10)) {
dev_kfree_skb(skb);
return true;
@@ -2485,7 +2479,6 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw,
{
struct ieee80211_local *local = hw_to_local(hw);
struct sk_buff *skb = NULL;
- struct sta_info *sta;
struct ieee80211_tx_data tx;
struct ieee80211_sub_if_data *sdata;
struct ieee80211_if_ap *bss = NULL;
@@ -2527,7 +2520,6 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw,

info = IEEE80211_SKB_CB(skb);

- sta = tx.sta;
tx.flags |= IEEE80211_TX_PS_BUFFERED;
tx.channel = local->hw.conf.channel;
info->band = tx.channel->band;
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index e73c8ca..a94b312 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,
struct sk_buff *skb;
struct ieee80211_mgmt *mgmt;
u8 *pos, qos_info;
- const u8 *ies;
size_t offset = 0, noffset;
- int i, len, count, rates_len, supp_rates_len;
+ int i, count, rates_len, supp_rates_len;
u16 capab;
struct ieee80211_supported_band *sband;
u32 rates = 0;
@@ -285,7 +284,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
}

/* SSID */
- ies = pos = skb_put(skb, 2 + wk->assoc.ssid_len);
+ pos = skb_put(skb, 2 + wk->assoc.ssid_len);
*pos++ = WLAN_EID_SSID;
*pos++ = wk->assoc.ssid_len;
memcpy(pos, wk->assoc.ssid, wk->assoc.ssid_len);
@@ -295,7 +294,6 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
if (supp_rates_len > 8)
supp_rates_len = 8;

- len = sband->n_bitrates;
pos = skb_put(skb, supp_rates_len + 2);
*pos++ = WLAN_EID_SUPP_RATES;
*pos++ = supp_rates_len;
--
1.7.4.4


2011-04-27 04:52:06

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 4/5] ath9k_htc: Fix warnings due to -Wunused-but-set-variable

On Wed, Apr 27, 2011 at 01:15:56AM +0530, John W. Linville wrote:
> On Mon, Apr 25, 2011 at 03:56:19PM +0530, Rajkumar Manoharan wrote:
> > These warnings are exposed by gcc 4.6.
> > drivers/net/wireless/ath/ath9k/htc_drv_txrx.c: In function
> > 'ath9k_htc_tx_process':
> > drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:449:35: warning: variable
> > 'sband' set but not used [-Wunused-but-set-variable]
> > drivers/net/wireless/ath/ath9k/htc_drv_beacon.c: In function
> > 'ath9k_htc_beacon_config_sta':
> > drivers/net/wireless/ath/ath9k/htc_drv_main.c: In function
> > 'ath9k_htc_stop':
> > drivers/net/wireless/ath/ath9k/htc_drv_main.c:967:6: warning: variable
> > 'ret' set but not used [-Wunused-but-set-variable]
> > drivers/net/wireless/ath/ath9k/htc_drv_main.c: In function
> > 'ath9k_htc_remove_interface':
> > drivers/net/wireless/ath/ath9k/htc_drv_gpio.c: In function
> > 'ath_btcoex_period_work':
> > drivers/net/wireless/ath/ath9k/htc_drv_gpio.c:67:6: warning: variable
> > 'ret' set but not used [-Wunused-but-set-variable
> > ...
> >
> > Signed-off-by: Rajkumar Manoharan <[email protected]>
>
> This doesn't seem to apply -- what tree are you using?
>
These warnings were already addressed. Please drop this patch
and "ath9k_hw: Fix warnings due to -Wunused-but-set-variable"
Sorry for the inconvenience.

--
Rajkumar

2011-04-25 10:57:57

by Sujith

[permalink] [raw]
Subject: [PATCH 3/5] ath9k: Fix warnings due to -Wunused-but-set-variable

Rajkumar Manoharan wrote:
> These warnings are exposed by gcc 4.6.
> drivers/net/wireless/ath/ath9k/recv.c: In function 'ath_ant_comb_scan':
> drivers/net/wireless/ath/ath9k/recv.c:1342:21: warning: variable
> 'curr_bias' set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/rc.c: In function 'ath_rc_update_ht':
> drivers/net/wireless/ath/ath9k/rc.c:1020:7: warning: variable
> 'state_change' set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/ani.c: In function 'ath9k_hw_ani_init':
> drivers/net/wireless/ath/ath9k/ani.c:903:37: warning: variable
> 'entry_cck' set but not used [-Wunused-but-set-variable]
> drivers/net/wireless/ath/ath9k/ani.c:902:38: warning: variable
> 'entry_ofdm' set but not used [-Wunused-but-set-variable]
>

http://marc.info/?l=linux-wireless&m=130327729324100&w=2

Sujith

2011-04-25 12:21:23

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH 3/5] ath9k: Fix warnings due to -Wunused-but-set-variable

On Mon, Apr 25, 2011 at 04:30:32PM +0530, Sujith wrote:
> Rajkumar Manoharan wrote:
> > These warnings are exposed by gcc 4.6.
> > drivers/net/wireless/ath/ath9k/recv.c: In function 'ath_ant_comb_scan':
> > drivers/net/wireless/ath/ath9k/recv.c:1342:21: warning: variable
> > 'curr_bias' set but not used [-Wunused-but-set-variable]
> > drivers/net/wireless/ath/ath9k/rc.c: In function 'ath_rc_update_ht':
> > drivers/net/wireless/ath/ath9k/rc.c:1020:7: warning: variable
> > 'state_change' set but not used [-Wunused-but-set-variable]
> > drivers/net/wireless/ath/ath9k/ani.c: In function 'ath9k_hw_ani_init':
> > drivers/net/wireless/ath/ath9k/ani.c:903:37: warning: variable
> > 'entry_cck' set but not used [-Wunused-but-set-variable]
> > drivers/net/wireless/ath/ath9k/ani.c:902:38: warning: variable
> > 'entry_ofdm' set but not used [-Wunused-but-set-variable]
> >
>
> http://marc.info/?l=linux-wireless&m=130327729324100&w=2
>
John,

Warnings in ath9k were already address by Sujith.
Please drop ath9k related warning patches.

--
Rajkumar

2011-04-25 10:26:48

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 5/5] ath9k_hw: Fix warnings due to -Wunused-but-set-variable

These warnings are exposed by gcc 4.6.
drivers/net/wireless/ath/ath9k/hw.c: In function
'ath9k_hw_fill_cap_info':
drivers/net/wireless/ath/ath9k/hw.c:1796:6: warning: variable 'capField'
set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/ar9003_phy.c: In function
'ar9003_hw_process_ini':
drivers/net/wireless/ath/ath9k/ar9003_phy.c:602:18: warning: variable
'freqIndex' set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/eeprom_9287.c: In function
'ath9k_hw_set_ar9287_power_cal_table':
drivers/net/wireless/ath/ath9k/eeprom_9287.c:322:10: warning: variable
'modalIdx' set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c: In function
'ar9300_compress_decision':
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c:3220:6: warning: variable
'dptr' set but not used [-Wunused-but-set-variable]

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 5 +----
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 6 +-----
drivers/net/wireless/ath/ath9k/eeprom_9287.c | 3 +--
drivers/net/wireless/ath/ath9k/hw.c | 4 +---
4 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 6eadf97..e826480 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3217,7 +3217,6 @@ static int ar9300_compress_decision(struct ath_hw *ah,
u8 *word, int length, int mdata_size)
{
struct ath_common *common = ath9k_hw_common(ah);
- u8 *dptr;
const struct ar9300_eeprom *eep = NULL;

switch (code) {
@@ -3234,9 +3233,7 @@ static int ar9300_compress_decision(struct ath_hw *ah,
it, length);
break;
case _CompressBlock:
- if (reference == 0) {
- dptr = mptr;
- } else {
+ if (reference != 0) {
eep = ar9003_eeprom_struct_find_by_id(reference);
if (eep == NULL) {
ath_dbg(common, ATH_DBG_EEPROM,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index 1bc33f5..3113aa8 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -599,29 +599,25 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
unsigned int regWrites = 0, i;
struct ieee80211_channel *channel = chan->chan;
- u32 modesIndex, freqIndex;
+ u32 modesIndex;

switch (chan->chanmode) {
case CHANNEL_A:
case CHANNEL_A_HT20:
modesIndex = 1;
- freqIndex = 1;
break;
case CHANNEL_A_HT40PLUS:
case CHANNEL_A_HT40MINUS:
modesIndex = 2;
- freqIndex = 1;
break;
case CHANNEL_G:
case CHANNEL_G_HT20:
case CHANNEL_B:
modesIndex = 4;
- freqIndex = 2;
break;
case CHANNEL_G_HT40PLUS:
case CHANNEL_G_HT40MINUS:
modesIndex = 3;
- freqIndex = 2;
break;

default:
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index 1357975..b87db47 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -319,10 +319,9 @@ static void ath9k_hw_set_ar9287_power_cal_table(struct ath_hw *ah,
u16 numXpdGain, xpdMask;
u16 xpdGainValues[AR5416_NUM_PD_GAINS] = {0, 0, 0, 0};
u32 reg32, regOffset, regChainOffset, regval;
- int16_t modalIdx, diff = 0;
+ int16_t diff = 0;
struct ar9287_eeprom *pEepData = &ah->eeprom.map9287;

- modalIdx = IS_CHAN_2GHZ(chan) ? 1 : 0;
xpdMask = pEepData->modalHeader.xpdGain;

if ((pEepData->baseEepHeader.version & AR9287_EEP_VER_MINOR_MASK) >=
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 045abd5..7a9d4a4 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1793,7 +1793,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
struct ath_common *common = ath9k_hw_common(ah);
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;

- u16 capField = 0, eeval;
+ u16 eeval;
u8 ant_div_ctl1, tx_chainmask, rx_chainmask;

eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_0);
@@ -1804,8 +1804,6 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
eeval |= AR9285_RDEXT_DEFAULT;
regulatory->current_rd_ext = eeval;

- capField = ah->eep_ops->get_eeprom(ah, EEP_OP_CAP);
-
if (ah->opmode != NL80211_IFTYPE_AP &&
ah->hw_version.subvendorid == AR_SUBVENDOR_ID_NEW_A) {
if (regulatory->current_rd == 0x64 ||
--
1.7.4.4


2011-04-25 10:26:35

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH 3/5] ath9k: Fix warnings due to -Wunused-but-set-variable

These warnings are exposed by gcc 4.6.
drivers/net/wireless/ath/ath9k/recv.c: In function 'ath_ant_comb_scan':
drivers/net/wireless/ath/ath9k/recv.c:1342:21: warning: variable
'curr_bias' set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/rc.c: In function 'ath_rc_update_ht':
drivers/net/wireless/ath/ath9k/rc.c:1020:7: warning: variable
'state_change' set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/ani.c: In function 'ath9k_hw_ani_init':
drivers/net/wireless/ath/ath9k/ani.c:903:37: warning: variable
'entry_cck' set but not used [-Wunused-but-set-variable]
drivers/net/wireless/ath/ath9k/ani.c:902:38: warning: variable
'entry_ofdm' set but not used [-Wunused-but-set-variable]

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ani.c | 6 ------
drivers/net/wireless/ath/ath9k/rc.c | 12 +++++-------
drivers/net/wireless/ath/ath9k/recv.c | 3 +--
3 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ani.c b/drivers/net/wireless/ath/ath9k/ani.c
index 2e31c77..5a1f4f5 100644
--- a/drivers/net/wireless/ath/ath9k/ani.c
+++ b/drivers/net/wireless/ath/ath9k/ani.c
@@ -899,12 +899,6 @@ void ath9k_hw_ani_init(struct ath_hw *ah)
* check here default level should not modify INI setting.
*/
if (use_new_ani(ah)) {
- const struct ani_ofdm_level_entry *entry_ofdm;
- const struct ani_cck_level_entry *entry_cck;
-
- entry_ofdm = &ofdm_level_table[ATH9K_ANI_OFDM_DEF_LEVEL];
- entry_cck = &cck_level_table[ATH9K_ANI_CCK_DEF_LEVEL];
-
ah->aniperiod = ATH9K_ANI_PERIOD_NEW;
ah->config.ani_poll_interval = ATH9K_ANI_POLLINTERVAL_NEW;
} else {
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 1809409..8a45906 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -854,14 +854,13 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
ath_rc_rate_set_rtscts(sc, rate_table, tx_info);
}

-static bool ath_rc_update_per(struct ath_softc *sc,
+static void ath_rc_update_per(struct ath_softc *sc,
const struct ath_rate_table *rate_table,
struct ath_rate_priv *ath_rc_priv,
struct ieee80211_tx_info *tx_info,
int tx_rate, int xretries, int retries,
u32 now_msec)
{
- bool state_change = false;
int count, n_bad_frames;
u8 last_per;
static const u32 nretry_to_per_lookup[10] = {
@@ -993,7 +992,7 @@ static bool ath_rc_update_per(struct ath_softc *sc,
}
}

- return state_change;
+ return;
}

static void ath_debug_stat_retries(struct ath_rate_priv *rc, int rix,
@@ -1017,7 +1016,6 @@ static void ath_rc_update_ht(struct ath_softc *sc,
u32 now_msec = jiffies_to_msecs(jiffies);
int rate;
u8 last_per;
- bool state_change = false;
const struct ath_rate_table *rate_table = ath_rc_priv->rate_table;
int size = ath_rc_priv->rate_table_size;

@@ -1027,9 +1025,9 @@ static void ath_rc_update_ht(struct ath_softc *sc,
last_per = ath_rc_priv->per[tx_rate];

/* Update PER first */
- state_change = ath_rc_update_per(sc, rate_table, ath_rc_priv,
- tx_info, tx_rate, xretries,
- retries, now_msec);
+ ath_rc_update_per(sc, rate_table, ath_rc_priv,
+ tx_info, tx_rate, xretries,
+ retries, now_msec);

/*
* If this rate looks bad (high PER) then stop using it for
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index f69dcdf..abb9cd6 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -1339,7 +1339,7 @@ static void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
struct ath_hw_antcomb_conf div_ant_conf;
struct ath_ant_comb *antcomb = &sc->ant_comb;
int alt_ratio = 0, alt_rssi_avg = 0, main_rssi_avg = 0, curr_alt_set;
- int curr_main_set, curr_bias;
+ int curr_main_set;
int main_rssi = rs->rs_rssi_ctl0;
int alt_rssi = rs->rs_rssi_ctl1;
int rx_ant_conf, main_ant_conf;
@@ -1393,7 +1393,6 @@ static void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs)
ath9k_hw_antdiv_comb_conf_get(sc->sc_ah, &div_ant_conf);
curr_alt_set = div_ant_conf.alt_lna_conf;
curr_main_set = div_ant_conf.main_lna_conf;
- curr_bias = div_ant_conf.fast_div_bias;

antcomb->count++;

--
1.7.4.4