minstrel_ht: Remove unused function parameters
PATCH 1/1 minstrel_ht: Remove unused function parameters
Remove unused function parameters in the following functions:minstrel_calc_rate_ewma()minstrel_ht_calc_tp()minstrel_aggr_check()minstrel_ht_set_rate()
--- net/mac80211/rc80211_minstrel_ht.c | 26 ++++++++++++-------------- 1 files changed, 12 insertions(+), 14 deletions(-)
net/mac80211/rc80211_minstrel_ht.c +12 -14
@@ -130,7 +130,7 @@ minstrel_get_ratestats(struct minstrel_ht_sta *mi, int index)* Recalculate success probabilities and counters for a rate using EWMA */ static void -minstrel_calc_rate_ewma (struct minstrel_priv *mp,struct minstrel_rate_stats *mr) +minstrel_calc_rate_ewma (struct minstrel_rate_stats *mr) {if (unlikely (mr->attempts >0 )) { mr->sample_skipped =0 ;
@@ -156,8 +156,7 @@ minstrel_calc_rate_ewma(struct minstrel_priv *mp, struct minstrel_rate_stats *mr* the expected number of retransmissions and their expected length */ static void -minstrel_ht_calc_tp (struct minstrel_priv *mp,struct minstrel_ht_sta *mi, -int group,int rate) +minstrel_ht_calc_tp (struct minstrel_ht_sta *mi,int group,int rate) {struct minstrel_rate_stats *mr;unsigned int usecs;
@@ -226,8 +225,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) mr = &mg->rates[i]; mr->retry_updated = false; index =MCS_GROUP_RATES * group + i; -minstrel_calc_rate_ewma (mp, mr); -minstrel_ht_calc_tp (mp, mi, group, i); +minstrel_calc_rate_ewma (mr); +minstrel_ht_calc_tp (mi, group, i);if (!mr->cur_tp)continue ;
@@ -357,7 +356,7 @@ minstrel_downgrade_rate(struct minstrel_ht_sta *mi, unsigned int *idx, }static void -minstrel_aggr_check (struct minstrel_priv *mp,struct ieee80211_sta *pubsta,struct sk_buff *skb) +minstrel_aggr_check (struct ieee80211_sta *pubsta,struct sk_buff *skb) {struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
@@ -455,7 +454,7 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,if (time_after (jiffies, mi->stats_update + (mp->update_interval /2 *HZ ) /1000 )) {minstrel_ht_update_stats (mp, mi);if (!(info->flags &IEEE80211_TX_CTL_AMPDU )) -minstrel_aggr_check (mp, sta, skb); +minstrel_aggr_check (sta, skb); } }
@@ -515,7 +514,6 @@ minstrel_calc_retransmit(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,static void minstrel_ht_set_rate (struct minstrel_priv *mp,struct minstrel_ht_sta *mi,struct ieee80211_tx_rate *rate,int index, -struct ieee80211_tx_rate_control *txrc,bool sample,bool rtscts) {const struct mcs_group *group = &minstrel_mcs_groups[index /MCS_GROUP_RATES ];
@@ -628,11 +626,11 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,if (sample_idx >=0 ) { sample = true;minstrel_ht_set_rate (mp, mi, &ar[0 ], sample_idx, - txrc, true, false); + true, false); info->flags |=IEEE80211_TX_CTL_RATE_CTRL_PROBE ; }else {minstrel_ht_set_rate (mp, mi, &ar[0 ], mi->max_tp_rate, - txrc, false, false); + false, false); }if (mp->hw->max_rates >=3 ) {
@@ -643,13 +641,13 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,*/ if (sample_idx >=0 )minstrel_ht_set_rate (mp, mi, &ar[1 ], mi->max_tp_rate, - txrc, false, false); + false, false);else minstrel_ht_set_rate (mp, mi, &ar[1 ], mi->max_tp_rate2, - txrc, false, true); + false, true);minstrel_ht_set_rate (mp, mi, &ar[2 ], mi->max_prob_rate, - txrc, false, !sample); + false, !sample); ar[3 ].count =0 ; ar[3 ].idx =-1 ;
@@ -660,7 +658,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,* max_tp_rate -> max_prob_rate by default. */ minstrel_ht_set_rate (mp, mi, &ar[1 ], mi->max_prob_rate, - txrc, false, !sample); + false, !sample); ar[2 ].count =0 ; ar[2 ].idx =-1 ;
Signature · 1 line
1.7.7.1
It was kind of my hope that one day minstrel would export a useful API and statistics to other subsystems - like sysfs, tc or the upper parts of the network stack, and snmp.
Perhap you could add functionality rather than remove the potential for such?
Quoted 119 lines · Patrick Kelle
Remove unused function parameters in the following functions:
minstrel_calc_rate_ewma()minstrel_ht_calc_tp()minstrel_aggr_check()minstrel_ht_set_rate()Signed-off-by Patrick Kelle <[email protected]>---
net/mac80211/rc80211_minstrel_ht.c | 26 ++++++++++++--------------1 files changed, 12 insertions(+), 14 deletions(-)net/mac80211/rc80211_minstrel_ht.c +0
-0@@ -130,7 +130,7 @@ minstrel_get_ratestats(struct minstrel_ht_sta *mi, int index)* Recalculate success probabilities and counters for a rate using EWMA */ static void
net/mac80211/rc80211_minstrel_ht.c +1
-1-minstrel_calc_rate_ewma(struct minstrel_priv *mp, struct minstrel_rate_stats *mr) +minstrel_calc_rate_ewma(struct minstrel_rate_stats *mr){
if (unlikely(mr->attempts > 0)) {
mr->sample_skipped = 0;net/mac80211/rc80211_minstrel_ht.c +0
-0@@ -156,8 +156,7 @@ minstrel_calc_rate_ewma(struct minstrel_priv *mp, struct minstrel_rate_stats *mr* the expected number of retransmissions and their expected length */ static void
net/mac80211/rc80211_minstrel_ht.c +1
-2-minstrel_ht_calc_tp(struct minstrel_priv *mp, struct minstrel_ht_sta *mi, - int group, int rate) +minstrel_ht_calc_tp(struct minstrel_ht_sta *mi, int group, int rate){
structminstrel_rate_stats*mr;
unsigned int usecs;net/mac80211/rc80211_minstrel_ht.c +2
-2@@ -226,8 +225,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) mr = &mg->rates[i]; mr->retry_updated = false; index = MCS_GROUP_RATES * group + i; - minstrel_calc_rate_ewma(mp, mr); - minstrel_ht_calc_tp(mp, mi, group, i); + minstrel_calc_rate_ewma(mr); + minstrel_ht_calc_tp(mi, group, i); if (!mr->cur_tp) continue;@@ -357,7 +356,7 @@ minstrel_downgrade_rate(struct minstrel_ht_sta *mi, unsigned int *idx, }static void
net/mac80211/rc80211_minstrel_ht.c +1
-1-minstrel_aggr_check(struct minstrel_priv *mp, struct ieee80211_sta *pubsta, struct sk_buff *skb) +minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb){
structieee80211_hdr*hdr = (structieee80211_hdr*)skb->data; structsta_info*sta =container_of(pubsta, struct sta_info, sta);net/mac80211/rc80211_minstrel_ht.c +1
-1@@ -455,7 +454,7 @@ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband, if (time_after(jiffies, mi->stats_update + (mp->update_interval / 2 * HZ) / 1000)) { minstrel_ht_update_stats(mp, mi); if (!(info->flags & IEEE80211_TX_CTL_AMPDU)) - minstrel_aggr_check(mp, sta, skb); + minstrel_aggr_check(sta, skb); } }@@ -515,7 +514,6 @@ minstrel_calc_retransmit(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,static void
minstrel_ht_set_rate(structminstrel_priv*mp, structminstrel_ht_sta*mi, structieee80211_tx_rate*rate, int index,
- structieee80211_tx_rate_control*txrc,
bool sample, bool rtscts)
{
const structmcs_group*group = &minstrel_mcs_groups[index /MCS_GROUP_RATES];net/mac80211/rc80211_minstrel_ht.c +3
-3@@ -628,11 +626,11 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, if (sample_idx >= 0) { sample = true; minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, - txrc, true, false); + true, false); info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; } else { minstrel_ht_set_rate(mp, mi, &ar[0], mi->max_tp_rate, - txrc, false, false); + false, false); } if (mp->hw->max_rates >= 3) {@@ -643,13 +641,13 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,*/ if (sample_idx >= 0) minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_tp_rate, - txrc, false, false); + false, false);else
minstrel_ht_set_rate(mp, mi, &ar[1],mi->max_tp_rate2,
- txrc, false, true);
+ false, true);minstrel_ht_set_rate(mp, mi, &ar[2],
mi->max_prob_rate,
- txrc, false, !sample);
+ false, !sample);ar[3].count = 0;
ar[3].idx = -1;net/mac80211/rc80211_minstrel_ht.c +1
-2@@ -660,7 +658,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,* max_tp_rate -> max_prob_rate by default. */ minstrel_ht_set_rate(mp, mi, &ar[1], mi->max_prob_rate, - txrc, false, !sample); + false, !sample); ar[2].count = 0; ar[2].idx = -1; --1.7.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 5 lines
Dave Täht SKYPE: davetaht US Tel: 1-239-829-5608 FR Tel: 0638645374 http://www.bufferbloat.net
Johannes Berg
maintainerQuoted 3 lines · Dave Taht
It was kind of my hope that one day minstrel would export a useful API and statistics to other subsystems - like sysfs, tc or the upper parts of the network stack, and snmp.
I think that doesn't make a lot of sense -- it should be done at a more abstract level.
johannes
Quoted 7 lines · Johannes Berg
Quoted 3 lines · Dave Taht
It was kind of my hope that one day minstrel would export a useful API and statistics to other subsystems - like sysfs, tc or the upper parts of the network stack, and snmp.
I think that doesn't make a lot of sense -- it should be done at a more abstract level.
what was the intent of parameter being removed in this patch series, originally, then?
Quoted 3 lines
johannes
Signature · 5 lines
Dave Täht SKYPE: davetaht US Tel: 1-239-829-5608 FR Tel: 0638645374 http://www.bufferbloat.net
Quoted 2 lines · Dave Taht
what was the intent of parameter being removed in this patch series, originally, then?
Removing _unused_ function parameters from internal minstrel_ht functions looks like a useful cleanup to me :) and might even help the compiler to generate better code ...
Helmut