public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: rtl8192e: Rename CamelCase variables and remove one from rtl_core.h
@ 2023-01-21 21:44 Philipp Hortmann
  2023-01-21 21:44 ` [PATCH 1/3] staging: rtl8192e: Remove unused variable bfirst_init Philipp Hortmann
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philipp Hortmann @ 2023-01-21 21:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Rename variables to avoid CamelCase which is not accepted by checkpatch.
Remove unused variable.

Tested with rtl8192e
Transferred this patch over wlan connection of rtl8192e

Can only be applied after the patch series from 20.01.2023.

Philipp Hortmann (3):
  staging: rtl8192e: Remove unused variable bfirst_init
  staging: rtl8192e: Rename eeprom_CustomerID, SwChnlStage and
    SwChnlStep
  staging: rtl8192e: Rename btxpower_trackin.., Slide_Beaco.. and
    Slide_B..

 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 16 ++++++++--------
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c |  8 ++++----
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c   |  6 ------
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h   | 13 ++++++-------
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c     | 10 +++++-----
 5 files changed, 23 insertions(+), 30 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] staging: rtl8192e: Remove unused variable bfirst_init
  2023-01-21 21:44 [PATCH 0/3] staging: rtl8192e: Rename CamelCase variables and remove one from rtl_core.h Philipp Hortmann
@ 2023-01-21 21:44 ` Philipp Hortmann
  2023-01-21 21:44 ` [PATCH 2/3] staging: rtl8192e: Rename eeprom_CustomerID, SwChnlStage and SwChnlStep Philipp Hortmann
  2023-01-21 21:45 ` [PATCH 3/3] staging: rtl8192e: Rename btxpower_trackin.., Slide_Beaco.. and Slide_B Philipp Hortmann
  2 siblings, 0 replies; 4+ messages in thread
From: Philipp Hortmann @ 2023-01-21 21:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

bfirst_init is six times set but never evaluated. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 ------
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 -
 2 files changed, 7 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 7a89381bae50..80450d46191c 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -692,16 +692,13 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
 	priv->rtllib->ieee_up = 1;
 
 	priv->up_first_time = 0;
-	priv->bfirst_init = true;
 	init_status = priv->ops->initialize_adapter(dev);
 	if (!init_status) {
 		netdev_err(dev, "%s(): Initialization failed!\n", __func__);
-		priv->bfirst_init = false;
 		return -1;
 	}
 
 	RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
-	priv->bfirst_init = false;
 
 	if (priv->polling_timer_on == 0)
 		rtl92e_check_rfctrl_gpio_timer(&priv->gpio_polling_timer);
@@ -837,7 +834,6 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
 	priv->blinked_ingpio = false;
 	priv->being_init_adapter = false;
 	priv->bdisable_nic = false;
-	priv->bfirst_init = false;
 	priv->txringcount = 64;
 	priv->rxbuffersize = 9100;
 	priv->rxringcount = MAX_RX_COUNT;
@@ -2423,7 +2419,6 @@ bool rtl92e_enable_nic(struct net_device *dev)
 		return false;
 	}
 
-	priv->bfirst_init = true;
 	init_status = priv->ops->initialize_adapter(dev);
 	if (!init_status) {
 		netdev_warn(dev, "%s(): Initialization failed!\n", __func__);
@@ -2431,7 +2426,6 @@ bool rtl92e_enable_nic(struct net_device *dev)
 		return false;
 	}
 	RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
-	priv->bfirst_init = false;
 
 	rtl92e_irq_enable(dev);
 	priv->bdisable_nic = false;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 59049ad349e0..e0f4a3b444ee 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -298,7 +298,6 @@ struct r8192_priv {
 	struct pci_dev *pdev;
 	struct pci_dev *bridge_pdev;
 
-	bool		bfirst_init;
 	bool		bfirst_after_down;
 	bool		being_init_adapter;
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] staging: rtl8192e: Rename eeprom_CustomerID, SwChnlStage and SwChnlStep
  2023-01-21 21:44 [PATCH 0/3] staging: rtl8192e: Rename CamelCase variables and remove one from rtl_core.h Philipp Hortmann
  2023-01-21 21:44 ` [PATCH 1/3] staging: rtl8192e: Remove unused variable bfirst_init Philipp Hortmann
@ 2023-01-21 21:44 ` Philipp Hortmann
  2023-01-21 21:45 ` [PATCH 3/3] staging: rtl8192e: Rename btxpower_trackin.., Slide_Beaco.. and Slide_B Philipp Hortmann
  2 siblings, 0 replies; 4+ messages in thread
From: Philipp Hortmann @ 2023-01-21 21:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Rename variable eeprom_CustomerID to eeprom_customer_id, SwChnlStage to
sw_chnl_stage and SwChnlStep to sw_chnl_step to avoid CamelCase which is
not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 6 +++---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 8 ++++----
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h   | 6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index b721bb72007d..6c570582479d 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -303,7 +303,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
 
 		usValue = rtl92e_eeprom_read(dev,
 					     (EEPROM_Customer_ID >> 1)) >> 8;
-		priv->eeprom_CustomerID = usValue & 0xff;
+		priv->eeprom_customer_id = usValue & 0xff;
 		usValue = rtl92e_eeprom_read(dev,
 					     EEPROM_ICVersion_ChannelPlan>>1);
 		priv->eeprom_chnl_plan = usValue&0xff;
@@ -327,7 +327,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
 		priv->card_8192_version = VERSION_8190_BD;
 		priv->eeprom_vid = 0;
 		priv->eeprom_did = 0;
-		priv->eeprom_CustomerID = 0;
+		priv->eeprom_customer_id = 0;
 		priv->eeprom_chnl_plan = 0;
 	}
 
@@ -449,7 +449,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
 	if (priv->eeprom_vid == 0x1186 &&  priv->eeprom_did == 0x3304)
 		priv->customer_id =  RT_CID_DLINK;
 
-	switch (priv->eeprom_CustomerID) {
+	switch (priv->eeprom_customer_id) {
 	case EEPROM_CID_DEFAULT:
 		priv->customer_id = RT_CID_DEFAULT;
 		break;
diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 95a21859c7e0..ca10a14c63b4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -907,8 +907,8 @@ static void _rtl92e_phy_switch_channel(struct net_device *dev, u8 channel)
 	u32 delay = 0;
 
 	while (!_rtl92e_phy_switch_channel_step(dev, channel,
-						&priv->SwChnlStage,
-						&priv->SwChnlStep, &delay)) {
+						&priv->sw_chnl_stage,
+						&priv->sw_chnl_step, &delay)) {
 		if (delay > 0)
 			msleep(delay);
 		if (!priv->up)
@@ -971,8 +971,8 @@ u8 rtl92e_set_channel(struct net_device *dev, u8 channel)
 
 	priv->chan = channel;
 
-	priv->SwChnlStage = 0;
-	priv->SwChnlStep = 0;
+	priv->sw_chnl_stage = 0;
+	priv->sw_chnl_step = 0;
 
 	if (priv->up)
 		_rtl92e_phy_switch_channel_work_item(dev);
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index e0f4a3b444ee..55a68bbe3861 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -417,7 +417,7 @@ struct r8192_priv {
 	short	epromtype;
 	u16 eeprom_vid;
 	u16 eeprom_did;
-	u8 eeprom_CustomerID;
+	u8 eeprom_customer_id;
 	u16 eeprom_chnl_plan;
 
 	u8 eeprom_tx_pwr_level_cck[14];
@@ -432,8 +432,8 @@ struct r8192_priv {
 	u8 thermal_meter[2];
 
 	u8 sw_chnl_in_progress;
-	u8 SwChnlStage;
-	u8 SwChnlStep;
+	u8 sw_chnl_stage;
+	u8 sw_chnl_step;
 	u8 set_bw_mode_in_progress;
 
 	u8 n_cur_40mhz_prime_sc;
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] staging: rtl8192e: Rename btxpower_trackin.., Slide_Beaco.. and Slide_B..
  2023-01-21 21:44 [PATCH 0/3] staging: rtl8192e: Rename CamelCase variables and remove one from rtl_core.h Philipp Hortmann
  2023-01-21 21:44 ` [PATCH 1/3] staging: rtl8192e: Remove unused variable bfirst_init Philipp Hortmann
  2023-01-21 21:44 ` [PATCH 2/3] staging: rtl8192e: Rename eeprom_CustomerID, SwChnlStage and SwChnlStep Philipp Hortmann
@ 2023-01-21 21:45 ` Philipp Hortmann
  2 siblings, 0 replies; 4+ messages in thread
From: Philipp Hortmann @ 2023-01-21 21:45 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-staging, linux-kernel

Rename variable btxpower_trackingInit to tx_pwr_tracking_init,
Slide_Beacon_pwdb to slide_beacon_pwdb and Slide_Beacon_Total to
slide_beacon_total to avoid CamelCase which is not accepted by
checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 10 +++++-----
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h   |  6 +++---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c     | 10 +++++-----
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index 6c570582479d..9260d308e68b 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -1574,17 +1574,17 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
 		    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
+			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 -= last_beacon_adc_pwdb;
 		}
-		priv->stats.Slide_Beacon_Total += prev_st->RxPWDBAll;
-		priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] =
+		priv->stats.slide_beacon_total += prev_st->RxPWDBAll;
+		priv->stats.slide_beacon_pwdb[slide_beacon_adc_pwdb_index] =
 							 prev_st->RxPWDBAll;
 		slide_beacon_adc_pwdb_index++;
 		if (slide_beacon_adc_pwdb_index >= PHY_Beacon_RSSI_SLID_WIN_MAX)
 			slide_beacon_adc_pwdb_index = 0;
-		prev_st->RxPWDBAll = priv->stats.Slide_Beacon_Total /
+		prev_st->RxPWDBAll = priv->stats.slide_beacon_total /
 				     slide_beacon_adc_pwdb_statistics;
 		if (prev_st->RxPWDBAll >= 3)
 			prev_st->RxPWDBAll -= 3;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
index 55a68bbe3861..983bc663a570 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h
@@ -229,8 +229,8 @@ struct rt_stats {
 	u8 rx_rssi_percentage[4];
 	u8 rx_evm_percentage[2];
 	long rxSNRdB[4];
-	u32 Slide_Beacon_pwdb[100];
-	u32 Slide_Beacon_Total;
+	u32 slide_beacon_pwdb[100];
+	u32 slide_beacon_total;
 	u32	CurrentShowTxate;
 };
 
@@ -481,7 +481,7 @@ struct r8192_priv {
 	bool		bcck_in_ch14;
 
 	u8		txpower_count;
-	bool		btxpower_trackingInit;
+	bool		tx_pwr_tracking_init;
 
 	u8		ofdm_index[2];
 	u8		cck_index;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
index ba92dab682ec..79f993ab7cee 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
@@ -768,7 +768,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 	u8 tmpOFDMindex, tmpCCKindex, tmpCCK20Mindex, tmpCCK40Mindex, tmpval;
 	int i = 0, CCKSwingNeedUpdate = 0;
 
-	if (!priv->btxpower_trackingInit) {
+	if (!priv->tx_pwr_tracking_init) {
 		tmpRegA = rtl92e_get_bb_reg(dev, rOFDM0_XATxIQImbalance,
 					    bMaskDWord);
 		for (i = 0; i < OFDM_Table_Length; i++) {
@@ -783,7 +783,7 @@ static void _rtl92e_dm_tx_power_tracking_cb_thermal(struct net_device *dev)
 				break;
 			}
 		}
-		priv->btxpower_trackingInit = true;
+		priv->tx_pwr_tracking_init = true;
 		return;
 	}
 
@@ -868,7 +868,7 @@ static void _rtl92e_dm_initialize_tx_power_tracking_tssi(struct net_device *dev)
 
 	priv->btxpower_tracking = true;
 	priv->txpower_count       = 0;
-	priv->btxpower_trackingInit = false;
+	priv->tx_pwr_tracking_init = false;
 
 }
 
@@ -882,7 +882,7 @@ static void _rtl92e_dm_init_tx_power_tracking_thermal(struct net_device *dev)
 	else
 		priv->btxpower_tracking = false;
 	priv->txpower_count       = 0;
-	priv->btxpower_trackingInit = false;
+	priv->tx_pwr_tracking_init = false;
 }
 
 void rtl92e_dm_init_txpower_tracking(struct net_device *dev)
@@ -1073,7 +1073,7 @@ void rtl92e_dm_restore_state(struct net_device *dev)
 		ratr_value &= ~(RATE_ALL_OFDM_2SS);
 	rtl92e_writel(dev, RATR0, ratr_value);
 	rtl92e_writeb(dev, UFWP, 1);
-	if (priv->btxpower_trackingInit && priv->btxpower_tracking)
+	if (priv->tx_pwr_tracking_init && priv->btxpower_tracking)
 		_rtl92e_dm_tx_power_reset_recovery(dev);
 
 	_rtl92e_dm_bb_initialgain_restore(dev);
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-21 21:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-21 21:44 [PATCH 0/3] staging: rtl8192e: Rename CamelCase variables and remove one from rtl_core.h Philipp Hortmann
2023-01-21 21:44 ` [PATCH 1/3] staging: rtl8192e: Remove unused variable bfirst_init Philipp Hortmann
2023-01-21 21:44 ` [PATCH 2/3] staging: rtl8192e: Rename eeprom_CustomerID, SwChnlStage and SwChnlStep Philipp Hortmann
2023-01-21 21:45 ` [PATCH 3/3] staging: rtl8192e: Rename btxpower_trackin.., Slide_Beaco.. and Slide_B Philipp Hortmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox