[PATCHv2 07/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable pprevious_stats to prev_stats

From: RaphaÃl Beamonte
Date: Fri Sep 11 2015 - 03:31:40 EST


Rename variable to a shorter name to allow easier code refactoring
in following patch.

Signed-off-by: RaphaÃl Beamonte <raphael.beamonte@xxxxxxxxx>
---
drivers/staging/rtl8192u/r8192U_core.c | 84 +++++++++++++++++-----------------
1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index acb8f97..2a7d46d 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -4043,7 +4043,7 @@ static long rtl819x_translate_todbm(u8 signal_strength_index)
* and it will be reinitialized when returned from S3/S4.
*/
static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
- struct ieee80211_rx_stats *pprevious_stats,
+ struct ieee80211_rx_stats *prev_stats,
struct ieee80211_rx_stats *pcurrent_stats)
{
bool bcheck = false;
@@ -4069,7 +4069,7 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
pcurrent_stats->Seq_Num = seq;

/* Check whether we should take the previous packet into accounting */
- if (!pprevious_stats->bIsAMPDU) {
+ if (!prev_stats->bIsAMPDU) {
/* if previous packet is not aggregated packet */
bcheck = true;
}
@@ -4079,10 +4079,10 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
last_rssi = priv->stats.slide_signal_strength[slide_rssi_index];
priv->stats.slide_rssi_total -= last_rssi;
}
- priv->stats.slide_rssi_total += pprevious_stats->SignalStrength;
+ priv->stats.slide_rssi_total += prev_stats->SignalStrength;

priv->stats.slide_signal_strength[slide_rssi_index++] =
- pprevious_stats->SignalStrength;
+ prev_stats->SignalStrength;
if (slide_rssi_index >= PHY_RSSI_SLID_WIN_MAX)
slide_rssi_index = 0;

@@ -4092,8 +4092,8 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
pcurrent_stats->rssi = priv->stats.signal_strength;

/* If the previous packet does not match the criteria, neglect it */
- if (!pprevious_stats->bPacketMatchBSSID) {
- if (!pprevious_stats->bToSelfBA)
+ if (!prev_stats->bPacketMatchBSSID) {
+ if (!prev_stats->bToSelfBA)
return;
}

@@ -4102,7 +4102,7 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,


/* only rtl8190 supported
- * rtl8190_process_cck_rxpathsel(priv,pprevious_stats);
+ * rtl8190_process_cck_rxpathsel(priv,prev_stats);
*/

/* Check RSSI */
@@ -4114,8 +4114,8 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
/* <2> Showed on UI for engineering
* hardware does not provide rssi information for each rf path in CCK
*/
- if (!pprevious_stats->bIsCCK &&
- (pprevious_stats->bPacketToSelf || pprevious_stats->bToSelfBA)) {
+ if (!prev_stats->bIsCCK &&
+ (prev_stats->bPacketToSelf || prev_stats->bToSelfBA)) {
for (rfpath = RF90_PATH_A; rfpath < priv->NumTotalRFPath; rfpath++) {
if (!rtl8192_phy_CheckIsLegalRFPath(
priv->ieee80211->dev, rfpath))
@@ -4123,16 +4123,16 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,

if (priv->stats.rx_rssi_percentage[rfpath] == 0)
priv->stats.rx_rssi_percentage[rfpath] =
- pprevious_stats->RxMIMOSignalStrength[rfpath];
- if (pprevious_stats->RxMIMOSignalStrength[rfpath] > priv->stats.rx_rssi_percentage[rfpath]) {
+ prev_stats->RxMIMOSignalStrength[rfpath];
+ if (prev_stats->RxMIMOSignalStrength[rfpath] > priv->stats.rx_rssi_percentage[rfpath]) {
priv->stats.rx_rssi_percentage[rfpath] =
((priv->stats.rx_rssi_percentage[rfpath] * (Rx_Smooth_Factor - 1)) +
- (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor);
+ (prev_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor);
priv->stats.rx_rssi_percentage[rfpath] = priv->stats.rx_rssi_percentage[rfpath] + 1;
} else {
priv->stats.rx_rssi_percentage[rfpath] =
((priv->stats.rx_rssi_percentage[rfpath] * (Rx_Smooth_Factor - 1)) +
- (pprevious_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor);
+ (prev_stats->RxMIMOSignalStrength[rfpath])) / (Rx_Smooth_Factor);
}
RT_TRACE(COMP_DBG,
"priv->stats.rx_rssi_percentage[rfPath] = %d\n",
@@ -4143,57 +4143,57 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,

/* Check PWDB. */
RT_TRACE(COMP_RXDESC, "Smooth %s PWDB = %d\n",
- pprevious_stats->bIsCCK ? "CCK" : "OFDM",
- pprevious_stats->RxPWDBAll);
+ prev_stats->bIsCCK ? "CCK" : "OFDM",
+ prev_stats->RxPWDBAll);

- if (pprevious_stats->bPacketBeacon) {
+ if (prev_stats->bPacketBeacon) {
/* record the beacon pwdb to the sliding window. */
if (slide_beacon_adc_pwdb_statistics++ >= PHY_Beacon_RSSI_SLID_WIN_MAX) {
slide_beacon_adc_pwdb_statistics = PHY_Beacon_RSSI_SLID_WIN_MAX;
last_beacon_adc_pwdb = priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index];
priv->stats.Slide_Beacon_Total -= last_beacon_adc_pwdb;
}
- priv->stats.Slide_Beacon_Total += pprevious_stats->RxPWDBAll;
- priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = pprevious_stats->RxPWDBAll;
+ priv->stats.Slide_Beacon_Total += prev_stats->RxPWDBAll;
+ priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = prev_stats->RxPWDBAll;
slide_beacon_adc_pwdb_index++;
if (slide_beacon_adc_pwdb_index >= PHY_Beacon_RSSI_SLID_WIN_MAX)
slide_beacon_adc_pwdb_index = 0;
- pprevious_stats->RxPWDBAll = priv->stats.Slide_Beacon_Total / slide_beacon_adc_pwdb_statistics;
- if (pprevious_stats->RxPWDBAll >= 3)
- pprevious_stats->RxPWDBAll -= 3;
+ prev_stats->RxPWDBAll = priv->stats.Slide_Beacon_Total / slide_beacon_adc_pwdb_statistics;
+ if (prev_stats->RxPWDBAll >= 3)
+ prev_stats->RxPWDBAll -= 3;
}

RT_TRACE(COMP_RXDESC, "Smooth %s PWDB = %d\n",
- pprevious_stats->bIsCCK ? "CCK" : "OFDM",
- pprevious_stats->RxPWDBAll);
+ prev_stats->bIsCCK ? "CCK" : "OFDM",
+ prev_stats->RxPWDBAll);


- if (pprevious_stats->bPacketToSelf ||
- pprevious_stats->bPacketBeacon ||
- pprevious_stats->bToSelfBA) {
+ if (prev_stats->bPacketToSelf ||
+ prev_stats->bPacketBeacon ||
+ prev_stats->bToSelfBA) {
if (priv->undecorated_smoothed_pwdb < 0)
/* initialize */
priv->undecorated_smoothed_pwdb =
- pprevious_stats->RxPWDBAll;
- if (pprevious_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) {
+ prev_stats->RxPWDBAll;
+ if (prev_stats->RxPWDBAll > (u32)priv->undecorated_smoothed_pwdb) {
priv->undecorated_smoothed_pwdb =
(((priv->undecorated_smoothed_pwdb) * (Rx_Smooth_Factor - 1)) +
- (pprevious_stats->RxPWDBAll)) / (Rx_Smooth_Factor);
+ (prev_stats->RxPWDBAll)) / (Rx_Smooth_Factor);
priv->undecorated_smoothed_pwdb = priv->undecorated_smoothed_pwdb + 1;
} else {
priv->undecorated_smoothed_pwdb =
(((priv->undecorated_smoothed_pwdb) * (Rx_Smooth_Factor - 1)) +
- (pprevious_stats->RxPWDBAll)) / (Rx_Smooth_Factor);
+ (prev_stats->RxPWDBAll)) / (Rx_Smooth_Factor);
}

}

/* Check EVM */
/* record the general EVM to the sliding window. */
- if (pprevious_stats->SignalQuality) {
- if (pprevious_stats->bPacketToSelf ||
- pprevious_stats->bPacketBeacon ||
- pprevious_stats->bToSelfBA) {
+ if (prev_stats->SignalQuality) {
+ if (prev_stats->bPacketToSelf ||
+ prev_stats->bPacketBeacon ||
+ prev_stats->bToSelfBA) {
if (slide_evm_statistics++ >= PHY_RSSI_SLID_WIN_MAX) {
slide_evm_statistics = PHY_RSSI_SLID_WIN_MAX;
last_evm = priv->stats.slide_evm[slide_evm_index];
@@ -4201,10 +4201,10 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
}

priv->stats.slide_evm_total +=
- pprevious_stats->SignalQuality;
+ prev_stats->SignalQuality;

priv->stats.slide_evm[slide_evm_index++] =
- pprevious_stats->SignalQuality;
+ prev_stats->SignalQuality;
if (slide_evm_index >= PHY_RSSI_SLID_WIN_MAX)
slide_evm_index = 0;

@@ -4219,16 +4219,16 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
}

/* <2> Showed on UI for engineering */
- if (pprevious_stats->bPacketToSelf ||
- pprevious_stats->bPacketBeacon ||
- pprevious_stats->bToSelfBA) {
+ if (prev_stats->bPacketToSelf ||
+ prev_stats->bPacketBeacon ||
+ prev_stats->bToSelfBA) {
for (nspatial_stream = 0; nspatial_stream < 2; nspatial_stream++) { /* 2 spatial stream */
- if (pprevious_stats->RxMIMOSignalQuality[nspatial_stream] != -1) {
+ if (prev_stats->RxMIMOSignalQuality[nspatial_stream] != -1) {
if (priv->stats.rx_evm_percentage[nspatial_stream] == 0) /* initialize */
- priv->stats.rx_evm_percentage[nspatial_stream] = pprevious_stats->RxMIMOSignalQuality[nspatial_stream];
+ priv->stats.rx_evm_percentage[nspatial_stream] = prev_stats->RxMIMOSignalQuality[nspatial_stream];
priv->stats.rx_evm_percentage[nspatial_stream] =
((priv->stats.rx_evm_percentage[nspatial_stream] * (Rx_Smooth_Factor - 1)) +
- (pprevious_stats->RxMIMOSignalQuality[nspatial_stream] * 1)) / (Rx_Smooth_Factor);
+ (prev_stats->RxMIMOSignalQuality[nspatial_stream] * 1)) / (Rx_Smooth_Factor);
}
}
}
--
2.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/