Skip to contentSkip to conversation

: staging: vt6655: Rename variable bUpdateBBVGA, byCurrentCh, byCurPwr and byBBPreEDRSSI

PATCH New Gilbert Adikankwu 1 participant 5 messages Oct 17, 2023 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover : staging: vt6655: Rename variable bUpdateBBVGA, byCurrentCh, byCurPwr and byBBPreEDRSSI

Make the variable names adhere to Linux kernel coding style and fix checkpatch.pl errors.

v1 -> v2:

        fix error reported here [here](https://lore.kernel.org/outreachy/[email protected]/T/#m12a562e40fc6c250f6989b252c7e121435c48bc2)
        reword the commit messages as suggested [here](https://lore.kernel.org/outreachy/[email protected]/T/#m9051ff56ac0248bbcad371c82e23cc22cefb2a23)

Gilbert Adikankwu (4):
staging: vt6655: Rename variable bUpdateBBVGA
staging: vt6655: Rename variable byCurrentCh
staging: vt6655: Rename variable byCurPwr
staging: vt6655: Rename variable byBBPreEDRSSI

 drivers/staging/vt6655/baseband.c    |  2 +-
 drivers/staging/vt6655/channel.c     | 18 +++++++++---------
 drivers/staging/vt6655/device.h      |  8 ++++----
 drivers/staging/vt6655/device_main.c |  8 ++++----
 drivers/staging/vt6655/dpc.c         |  2 +-
 drivers/staging/vt6655/rf.c          |  4 ++--
 6 files changed, 21 insertions(+), 21 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/4 staging: vt6655: Rename variable bUpdateBBVGA

Remove bool Type encoding "b" from variable name and replace camelcase with snakecase.

Mute checkpatch.pl error:

CHECK: Avoid CamelCase: <bUpdateBBVGA>

---
 drivers/staging/vt6655/baseband.c    | 2 +-
 drivers/staging/vt6655/channel.c     | 2 +-
 drivers/staging/vt6655/device.h      | 2 +-
 drivers/staging/vt6655/device_main.c | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/vt6655/baseband.c +1 -1
index 7d47b266b87e..f7824396c5ff 100644
@@ -2087,7 +2087,7 @@ bool bb_vt3253_init(struct vnt_private *priv)
 		/* {{ RobertYu: 20050104 */
 	} else {
 		/* No VGA Table now */
-		priv->bUpdateBBVGA = false;
+		priv->update_bbvga = false;
 		priv->bbvga[0] = 0x1C;
 	}
 
drivers/staging/vt6655/channel.c +1 -1
index 6ac7d470c041..c11bc2dbc356 100644
@@ -86,7 +86,7 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
 		return ret;
 
 	/* Set VGA to max sensitivity */
-	if (priv->bUpdateBBVGA &&
+	if (priv->update_bbvga &&
 	    priv->bbvga_current != priv->bbvga[0]) {
 		priv->bbvga_current = priv->bbvga[0];
 
drivers/staging/vt6655/device.h +1 -1
index 68bfadacfa7c..b166d296b82d 100644
@@ -246,7 +246,7 @@ struct vnt_private {
 	unsigned char byAutoFBCtrl;
 
 	/* For Update BaseBand VGA Gain Offset */
-	bool bUpdateBBVGA;
+	bool update_bbvga;
 	unsigned int	uBBVGADiffCount;
 	unsigned char bbvga_new;
 	unsigned char bbvga_current;
drivers/staging/vt6655/device_main.c +3 -3
index b08fcf7e6edc..b654fc24d725 100644
@@ -179,7 +179,7 @@ device_set_options(struct vnt_private *priv)
 	priv->byBBType = priv->opts.bbp_type;
 	priv->byPacketType = priv->byBBType;
 	priv->byAutoFBCtrl = AUTO_FB_0;
-	priv->bUpdateBBVGA = true;
+	priv->update_bbvga = true;
 	priv->preamble_type = 0;
 
 	pr_debug(" byShortRetryLimit= %d\n", (int)priv->byShortRetryLimit);
@@ -423,7 +423,7 @@ static void device_init_registers(struct vnt_private *priv)
 	/* initialize BBP registers */
 	bb_vt3253_init(priv);
 
-	if (priv->bUpdateBBVGA) {
+	if (priv->update_bbvga) {
 		priv->bbvga_current = priv->bbvga[0];
 		priv->bbvga_new = priv->bbvga_current;
 		bb_set_vga_gain_offset(priv, priv->bbvga[0]);
@@ -1040,7 +1040,7 @@ static void vnt_check_bb_vga(struct vnt_private *priv)
 	long dbm;
 	int i;
 
-	if (!priv->bUpdateBBVGA)
+	if (!priv->update_bbvga)
 		return;
 
 	if (priv->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL)
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/4 staging: vt6655: Rename variable byCurrentCh

In reply to Gilbert Adikankwu

Remove byte Type encoding "by" from variable name and replace camelcase with snakecase.

Mute checkpatch.pl error:

CHECK: Avoid CamelCase: <byCurrentCh>

---
 drivers/staging/vt6655/channel.c | 12 ++++++------
 drivers/staging/vt6655/device.h  |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/vt6655/channel.c +6 -6
index c11bc2dbc356..7b864136a0a8 100644
@@ -82,7 +82,7 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
 {
 	bool ret = true;
 
-	if (priv->byCurrentCh == ch->hw_value)
+	if (priv->current_ch == ch->hw_value)
 		return ret;
 
 	/* Set VGA to max sensitivity */
@@ -100,7 +100,7 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
 	 * it is for better TX throughput
 	 */
 
-	priv->byCurrentCh = ch->hw_value;
+	priv->current_ch = ch->hw_value;
 	ret &= RFbSelectChannel(priv, priv->rf_type,
 				ch->hw_value);
 
@@ -117,9 +117,9 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
 
 		/* set HW default power register */
 		VT6655_MAC_SELECT_PAGE1(priv->port_offset);
-		RFbSetPower(priv, RATE_1M, priv->byCurrentCh);
+		RFbSetPower(priv, RATE_1M, priv->current_ch);
 		iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWRCCK);
-		RFbSetPower(priv, RATE_6M, priv->byCurrentCh);
+		RFbSetPower(priv, RATE_6M, priv->current_ch);
 		iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWROFDM);
 		VT6655_MAC_SELECT_PAGE0(priv->port_offset);
 
@@ -127,9 +127,9 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
 	}
 
 	if (priv->byBBType == BB_TYPE_11B)
-		RFbSetPower(priv, RATE_1M, priv->byCurrentCh);
+		RFbSetPower(priv, RATE_1M, priv->current_ch);
 	else
-		RFbSetPower(priv, RATE_6M, priv->byCurrentCh);
+		RFbSetPower(priv, RATE_6M, priv->current_ch);
 
 	return ret;
 }
drivers/staging/vt6655/device.h +1 -1
index b166d296b82d..b3ac6237010b 100644
@@ -239,7 +239,7 @@ struct vnt_private {
 	bool bIsBeaconBufReadySet;
 	unsigned int	cbBeaconBufReadySetCnt;
 	bool bFixRate;
-	u16 byCurrentCh;
+	u16 current_ch;
 
 	bool bAES;
 
Signature · 1 line
2.34.1
#3 lore raw

PATCH v2 3/4 staging: vt6655: Rename variable byCurPwr

In reply to Gilbert Adikankwu

Remove byte Type encoding "by" from variable name and replace camelcase with snakecase

Mute checkpatch.pl error:

CHECK: Avoid CamelCase: <byCurPwr>

---
 drivers/staging/vt6655/channel.c     | 4 ++--
 drivers/staging/vt6655/device.h      | 2 +-
 drivers/staging/vt6655/device_main.c | 2 +-
 drivers/staging/vt6655/rf.c          | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/vt6655/channel.c +2 -2
index 7b864136a0a8..771c1364b0f0 100644
@@ -118,9 +118,9 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
 		/* set HW default power register */
 		VT6655_MAC_SELECT_PAGE1(priv->port_offset);
 		RFbSetPower(priv, RATE_1M, priv->current_ch);
-		iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWRCCK);
+		iowrite8(priv->cur_pwr, priv->port_offset + MAC_REG_PWRCCK);
 		RFbSetPower(priv, RATE_6M, priv->current_ch);
-		iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWROFDM);
+		iowrite8(priv->cur_pwr, priv->port_offset + MAC_REG_PWROFDM);
 		VT6655_MAC_SELECT_PAGE0(priv->port_offset);
 
 		spin_unlock_irqrestore(&priv->lock, flags);
drivers/staging/vt6655/device.h +1 -1
index b3ac6237010b..6df1694d556b 100644
@@ -264,7 +264,7 @@ struct vnt_private {
 	/* For RF Power table */
 	unsigned char byCCKPwr;
 	unsigned char byOFDMPwrG;
-	unsigned char byCurPwr;
+	unsigned char cur_pwr;
 	char	 byCurPwrdBm;
 	unsigned char abyCCKPwrTbl[CB_MAX_CHANNEL_24G + 1];
 	unsigned char abyOFDMPwrTbl[CB_MAX_CHANNEL + 1];
drivers/staging/vt6655/device_main.c +1 -1
index b654fc24d725..2152c6850e61 100644
@@ -359,7 +359,7 @@ static void device_init_registers(struct vnt_private *priv)
 	RFbInit(priv);
 
 	/* Get Desire Power Value */
-	priv->byCurPwr = 0xFF;
+	priv->cur_pwr = 0xFF;
 	priv->byCCKPwr = SROMbyReadEmbedded(priv->port_offset, EEP_OFS_PWR_CCK);
 	priv->byOFDMPwrG = SROMbyReadEmbedded(priv->port_offset,
 					      EEP_OFS_PWR_OFDMG);
drivers/staging/vt6655/rf.c +2 -2
index bf9a10563b12..d319ec21c97b 100644
@@ -438,12 +438,12 @@ bool RFbSetPower(struct vnt_private *priv, unsigned int rate, u16 uCH)
 		break;
 	}
 
-	if (priv->byCurPwr == byPwr)
+	if (priv->cur_pwr == byPwr)
 		return true;
 
 	ret = RFbRawSetPower(priv, byPwr, rate);
 	if (ret)
-		priv->byCurPwr = byPwr;
+		priv->cur_pwr = byPwr;
 
 	return ret;
 }
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 4/4 staging: vt6655: Rename variable byBBPreEDRSSI

In reply to Gilbert Adikankwu

Remove byte Type encoding "by" from variable name and replace camelcase with snakecase.

Mute checkpatch error:

CHECK: Avoid CamelCase: <byBBPreEDRSSI>

---
 drivers/staging/vt6655/device.h | 2 +-
 drivers/staging/vt6655/dpc.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6655/device.h +1 -1
index 6df1694d556b..2b5f9bf6aa5d 100644
@@ -253,7 +253,7 @@ struct vnt_private {
 	unsigned char bbvga[BB_VGA_LEVEL];
 	long                    dbm_threshold[BB_VGA_LEVEL];
 
-	unsigned char byBBPreEDRSSI;
+	unsigned char bb_pre_edrssi;
 	unsigned char byBBPreEDIndex;
 
 	unsigned long dwDiagRefCount;
drivers/staging/vt6655/dpc.c +1 -1
index c6ed3537f439..7ada188e2048 100644
@@ -79,7 +79,7 @@ static bool vnt_rx_data(struct vnt_private *priv, struct sk_buff *skb,
 
 	RFvRSSITodBm(priv, *rssi, &rx_dbm);
 
-	priv->byBBPreEDRSSI = (u8)rx_dbm + 1;
+	priv->bb_pre_edrssi = (u8)rx_dbm + 1;
 	priv->current_rssi = *rssi;
 
 	skb_pull(skb, 4);
Signature · 1 line
2.34.1