mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Raphaël Beamonte" <raphael.beamonte@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Raphaël Beamonte" <raphael.beamonte@gmail.com>,
	"Cristina Opriceana" <cristina.opriceana@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCHv3 06/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable pprevious_stats to prev_stats
Date: Sun, 20 Sep 2015 13:14:18 -0400	[thread overview]
Message-ID: <0422a93cee650211b5fa925e3ec62ffab0732da0.1442769012.git.raphael.beamonte@gmail.com> (raw)
In-Reply-To: <cover.1442769012.git.raphael.beamonte@gmail.com>
In-Reply-To: <cover.1442769012.git.raphael.beamonte@gmail.com>

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

Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com>
---
 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 7314e2f..1fd51ab 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -3993,7 +3993,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;
@@ -4019,7 +4019,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;
 	}
@@ -4029,10 +4029,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;
 
@@ -4042,8 +4042,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;
 	}
 
@@ -4052,7 +4052,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 */
@@ -4064,8 +4064,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))
@@ -4073,16 +4073,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",
@@ -4093,57 +4093,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];
@@ -4151,10 +4151,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;
 
@@ -4169,16 +4169,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


  parent reply	other threads:[~2015-09-20 17:16 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11  7:29 [PATCHv2 00/16] staging: rtl8192u: code clean up Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 01/16] staging: rtl8192u: r8192U_core: fix comments lines over 80 characters Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 02/16] staging: rtl8192u: r8192U_core: add line breaks to keep lines under " Raphaël Beamonte
2015-09-17  4:55   ` Greg Kroah-Hartman
2015-09-11  7:29 ` [PATCHv2 03/16] staging: rtl8192u: r8192U_core: add temporary variables " Raphaël Beamonte
2015-09-17  4:57   ` Greg Kroah-Hartman
2015-09-17  5:06     ` Raphaël Beamonte
2015-09-17  5:18       ` Greg Kroah-Hartman
2015-09-17 18:26         ` Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 04/16] staging: rtl8192u: r8192U_core: reverse conditions to get " Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 05/16] staging: rtl8192u: r8192U_core: rtl8192_adapter_start: reorganize function Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 06/16] staging: rtl8192u: r8192U_core: rtl8192_read_eeprom_info: " Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 07/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable pprevious_stats to prev_stats Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 08/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_index to sb_index Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 09/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_statistics to sb_stats Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 10/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: remove unneeded variable Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 11/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable rfpath to rfp Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 12/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: reorganize function Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 13/16] staging: rtl8192u: r8192U_core: rtl8192_tx: replace some inline conditions Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 14/16] staging: rtl8192u: r8192U_core: rtl8192_ioctl: reorganize function Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 15/16] staging: rtl8192u: r8192U_core: replace else { if() {} } by else if () {} Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 16/16] staging: rtl8192u: remove all code framed by symbol TO_DO_LIST Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 00/15] staging: rtl8192u: code clean up Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 01/15] staging: rtl8192u: r8192U_core: add line breaks to keep lines under 80 characters Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 02/15] staging: rtl8192u: r8192U_core: add temporary variables " Raphaël Beamonte
2015-09-21  2:16   ` Greg Kroah-Hartman
2015-09-21 16:31     ` Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 03/15] staging: rtl8192u: r8192U_core: reverse conditions to get " Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 04/15] staging: rtl8192u: r8192U_core: rtl8192_adapter_start: reorganize function Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 05/15] staging: rtl8192u: r8192U_core: rtl8192_read_eeprom_info: " Raphaël Beamonte
2015-09-20 17:14 ` Raphaël Beamonte [this message]
2015-09-20 17:14 ` [PATCHv3 07/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_index to sb_index Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 08/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_statistics to sb_stats Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 09/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: remove unneeded variable Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 10/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable rfpath to rfp Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 11/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: reorganize function Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 12/15] staging: rtl8192u: r8192U_core: rtl8192_tx: replace some inline conditions Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 13/15] staging: rtl8192u: r8192U_core: rtl8192_ioctl: reorganize function Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 14/15] staging: rtl8192u: r8192U_core: replace else { if() {} } by else if () {} Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 15/15] staging: rtl8192u: remove all code framed by symbol TO_DO_LIST Raphaël Beamonte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0422a93cee650211b5fa925e3ec62ffab0732da0.1442769012.git.raphael.beamonte@gmail.com \
    --to=raphael.beamonte@gmail.com \
    --cc=cristina.opriceana@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®