Skip to contentSkip to conversation

staging: vt6655: Rename variables byCWMaxMin, bySlot, bySIFS, byDIFS and byEIFS

PATCH In review Gilbert Adikankwu 2 participants 7 messages Oct 21, 2023 – Oct 22, 2023 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: vt6655: Rename variables byCWMaxMin, bySlot, bySIFS, byDIFS and byEIFS

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

Gilbert Adikankwu (5):
staging: vt6655: Rename variable byCWMaxMin
staging: vt6655: Rename variable bySlot
staging: vt6655: Rename variable bySIFS
staging: vt6655: Rename variable byDIFS
staging: vt6655: Rename variable byEIFS

 drivers/staging/vt6655/card.c   | 72 ++++++++++++++++-----------------
 drivers/staging/vt6655/device.h | 10 ++---
 2 files changed, 41 insertions(+), 41 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/5 staging: vt6655: Rename variable byCWMaxMin

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

Fix checkpatch.pl error:
CHECK: Avoid CamelCase: <byCWMaxMin>

---
 drivers/staging/vt6655/card.c   | 16 ++++++++--------
 drivers/staging/vt6655/device.h |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/vt6655/card.c +8 -8
index bec39c72d540..08e50311f7ba 100644
@@ -184,7 +184,7 @@ static void s_vCalculateOFDMRParameter(unsigned char rate,
  */
 bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 {
-	unsigned char byCWMaxMin = 0;
+	unsigned char cw_max_min = 0;
 	unsigned char bySlot = 0;
 	unsigned char bySIFS = 0;
 	unsigned char byDIFS = 0;
@@ -197,14 +197,14 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		bySlot = C_SLOT_SHORT;
 		bySIFS = C_SIFS_A;
 		byDIFS = C_SIFS_A + 2 * C_SLOT_SHORT;
-		byCWMaxMin = 0xA4;
+		cw_max_min = 0xA4;
 	} else if (bb_type == BB_TYPE_11B) {
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11B);
 		bb_write_embedded(priv, 0x88, 0x02);
 		bySlot = C_SLOT_LONG;
 		bySIFS = C_SIFS_BG;
 		byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
-		byCWMaxMin = 0xA5;
+		cw_max_min = 0xA5;
 	} else { /* PK_TYPE_11GA & PK_TYPE_11GB */
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11G);
 		bb_write_embedded(priv, 0x88, 0x08);
@@ -218,11 +218,11 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 			byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
 		}
 
-		byCWMaxMin = 0xa4;
+		cw_max_min = 0xa4;
 
 		for (i = RATE_54M; i >= RATE_6M; i--) {
 			if (priv->basic_rates & ((u32)(0x1 << i))) {
-				byCWMaxMin |= 0x1;
+				cw_max_min |= 0x1;
 				break;
 			}
 		}
@@ -260,9 +260,9 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 
 		bb_set_short_slot_time(priv);
 	}
-	if (priv->byCWMaxMin != byCWMaxMin) {
-		priv->byCWMaxMin = byCWMaxMin;
-		iowrite8(priv->byCWMaxMin, priv->port_offset + MAC_REG_CWMAXMIN0);
+	if (priv->cw_max_min != cw_max_min) {
+		priv->cw_max_min = cw_max_min;
+		iowrite8(priv->cw_max_min, priv->port_offset + MAC_REG_CWMAXMIN0);
 	}
 
 	priv->byPacketType = CARDbyGetPktType(priv);
drivers/staging/vt6655/device.h +1 -1
index 2b5f9bf6aa5d..8ff28e4e72a4 100644
@@ -185,7 +185,7 @@ struct vnt_private {
 	unsigned char byDIFS;
 	unsigned char byEIFS;
 	unsigned char bySlot;
-	unsigned char byCWMaxMin;
+	unsigned char cw_max_min;
 
 	u8		byBBType; /* 0:11A, 1:11B, 2:11G */
 	u8		byPacketType; /*
Signature · 1 line
2.34.1
#2 lore raw

PATCH 2/5 staging: vt6655: Rename variable bySlot

In reply to Gilbert Adikankwu

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

Fix checkpatch.pl error:
CHECK: Avoid CamelCase: <bySlot>

---
 drivers/staging/vt6655/card.c   | 16 ++++++++--------
 drivers/staging/vt6655/device.h |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/vt6655/card.c +8 -8
index 08e50311f7ba..b5a87837995f 100644
@@ -185,7 +185,7 @@ static void s_vCalculateOFDMRParameter(unsigned char rate,
 bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 {
 	unsigned char cw_max_min = 0;
-	unsigned char bySlot = 0;
+	unsigned char slot = 0;
 	unsigned char bySIFS = 0;
 	unsigned char byDIFS = 0;
 	int i;
@@ -194,14 +194,14 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 	if (bb_type == BB_TYPE_11A) {
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11A);
 		bb_write_embedded(priv, 0x88, 0x03);
-		bySlot = C_SLOT_SHORT;
+		slot = C_SLOT_SHORT;
 		bySIFS = C_SIFS_A;
 		byDIFS = C_SIFS_A + 2 * C_SLOT_SHORT;
 		cw_max_min = 0xA4;
 	} else if (bb_type == BB_TYPE_11B) {
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11B);
 		bb_write_embedded(priv, 0x88, 0x02);
-		bySlot = C_SLOT_LONG;
+		slot = C_SLOT_LONG;
 		bySIFS = C_SIFS_BG;
 		byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
 		cw_max_min = 0xA5;
@@ -211,10 +211,10 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		bySIFS = C_SIFS_BG;
 
 		if (priv->short_slot_time) {
-			bySlot = C_SLOT_SHORT;
+			slot = C_SLOT_SHORT;
 			byDIFS = C_SIFS_BG + 2 * C_SLOT_SHORT;
 		} else {
-			bySlot = C_SLOT_LONG;
+			slot = C_SLOT_LONG;
 			byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
 		}
 
@@ -254,9 +254,9 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		priv->byEIFS = C_EIFS;
 		iowrite8(priv->byEIFS, priv->port_offset + MAC_REG_EIFS);
 	}
-	if (priv->bySlot != bySlot) {
-		priv->bySlot = bySlot;
-		iowrite8(priv->bySlot, priv->port_offset + MAC_REG_SLOT);
+	if (priv->slot != slot) {
+		priv->slot = slot;
+		iowrite8(priv->slot, priv->port_offset + MAC_REG_SLOT);
 
 		bb_set_short_slot_time(priv);
 	}
drivers/staging/vt6655/device.h +1 -1
index 8ff28e4e72a4..a63a8ddb7ff1 100644
@@ -184,7 +184,7 @@ struct vnt_private {
 	unsigned char bySIFS;
 	unsigned char byDIFS;
 	unsigned char byEIFS;
-	unsigned char bySlot;
+	unsigned char slot;
 	unsigned char cw_max_min;
 
 	u8		byBBType; /* 0:11A, 1:11B, 2:11G */
Signature · 1 line
2.34.1
#3 lore raw

PATCH 3/5 staging: vt6655: Rename variable bySIFS

In reply to Gilbert Adikankwu

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

Fix checkpatch.pl error:
CHECK: Avoid CamelCase: <bySIFS>

---
 drivers/staging/vt6655/card.c   | 16 ++++++++--------
 drivers/staging/vt6655/device.h |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/staging/vt6655/card.c +8 -8
index b5a87837995f..48e571badfb1 100644
@@ -186,7 +186,7 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 {
 	unsigned char cw_max_min = 0;
 	unsigned char slot = 0;
-	unsigned char bySIFS = 0;
+	unsigned char sifs = 0;
 	unsigned char byDIFS = 0;
 	int i;
 
@@ -195,20 +195,20 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11A);
 		bb_write_embedded(priv, 0x88, 0x03);
 		slot = C_SLOT_SHORT;
-		bySIFS = C_SIFS_A;
+		sifs = C_SIFS_A;
 		byDIFS = C_SIFS_A + 2 * C_SLOT_SHORT;
 		cw_max_min = 0xA4;
 	} else if (bb_type == BB_TYPE_11B) {
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11B);
 		bb_write_embedded(priv, 0x88, 0x02);
 		slot = C_SLOT_LONG;
-		bySIFS = C_SIFS_BG;
+		sifs = C_SIFS_BG;
 		byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
 		cw_max_min = 0xA5;
 	} else { /* PK_TYPE_11GA & PK_TYPE_11GB */
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11G);
 		bb_write_embedded(priv, 0x88, 0x08);
-		bySIFS = C_SIFS_BG;
+		sifs = C_SIFS_BG;
 
 		if (priv->short_slot_time) {
 			slot = C_SLOT_SHORT;
@@ -233,7 +233,7 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		 * bcs TX_PE will reserve 3 us hardware's processing
 		 * time here is 2 us.
 		 */
-		bySIFS -= 3;
+		sifs -= 3;
 		byDIFS -= 3;
 		/*
 		 * TX_PE will reserve 3 us for MAX2829 A mode only, it is for
@@ -242,9 +242,9 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		 */
 	}
 
-	if (priv->bySIFS != bySIFS) {
-		priv->bySIFS = bySIFS;
-		iowrite8(priv->bySIFS, priv->port_offset + MAC_REG_SIFS);
+	if (priv->sifs != sifs) {
+		priv->sifs = sifs;
+		iowrite8(priv->sifs, priv->port_offset + MAC_REG_SIFS);
 	}
 	if (priv->byDIFS != byDIFS) {
 		priv->byDIFS = byDIFS;
drivers/staging/vt6655/device.h +1 -1
index a63a8ddb7ff1..e6669c5f0b8b 100644
@@ -181,7 +181,7 @@ struct vnt_private {
 	unsigned int	uCwMin;   /* Current CwMin */
 	unsigned int	uCwMax;   /* CwMax is fixed on 1023. */
 	/* PHY parameter */
-	unsigned char bySIFS;
+	unsigned char sifs;
 	unsigned char byDIFS;
 	unsigned char byEIFS;
 	unsigned char slot;
Signature · 1 line
2.34.1
#4 lore raw

PATCH 4/5 staging: vt6655: Rename variable byDIFS

In reply to Gilbert Adikankwu

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

Fix checkpatch.pl error:
CHECK: Avoid CamelCase: <byDIFS>

---
 drivers/staging/vt6655/card.c   | 18 +++++++++---------
 drivers/staging/vt6655/device.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6655/card.c +9 -9
index 48e571badfb1..9c8648ea96be 100644
@@ -187,7 +187,7 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 	unsigned char cw_max_min = 0;
 	unsigned char slot = 0;
 	unsigned char sifs = 0;
-	unsigned char byDIFS = 0;
+	unsigned char difs = 0;
 	int i;
 
 	/* Set SIFS, DIFS, EIFS, SlotTime, CwMin */
@@ -196,14 +196,14 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		bb_write_embedded(priv, 0x88, 0x03);
 		slot = C_SLOT_SHORT;
 		sifs = C_SIFS_A;
-		byDIFS = C_SIFS_A + 2 * C_SLOT_SHORT;
+		difs = C_SIFS_A + 2 * C_SLOT_SHORT;
 		cw_max_min = 0xA4;
 	} else if (bb_type == BB_TYPE_11B) {
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11B);
 		bb_write_embedded(priv, 0x88, 0x02);
 		slot = C_SLOT_LONG;
 		sifs = C_SIFS_BG;
-		byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
+		difs = C_SIFS_BG + 2 * C_SLOT_LONG;
 		cw_max_min = 0xA5;
 	} else { /* PK_TYPE_11GA & PK_TYPE_11GB */
 		vt6655_mac_set_bb_type(priv->port_offset, BB_TYPE_11G);
@@ -212,10 +212,10 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 
 		if (priv->short_slot_time) {
 			slot = C_SLOT_SHORT;
-			byDIFS = C_SIFS_BG + 2 * C_SLOT_SHORT;
+			difs = C_SIFS_BG + 2 * C_SLOT_SHORT;
 		} else {
 			slot = C_SLOT_LONG;
-			byDIFS = C_SIFS_BG + 2 * C_SLOT_LONG;
+			difs = C_SIFS_BG + 2 * C_SLOT_LONG;
 		}
 
 		cw_max_min = 0xa4;
@@ -234,7 +234,7 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		 * time here is 2 us.
 		 */
 		sifs -= 3;
-		byDIFS -= 3;
+		difs -= 3;
 		/*
 		 * TX_PE will reserve 3 us for MAX2829 A mode only, it is for
 		 * better TX throughput; MAC will need 2 us to process, so the
@@ -246,9 +246,9 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		priv->sifs = sifs;
 		iowrite8(priv->sifs, priv->port_offset + MAC_REG_SIFS);
 	}
-	if (priv->byDIFS != byDIFS) {
-		priv->byDIFS = byDIFS;
-		iowrite8(priv->byDIFS, priv->port_offset + MAC_REG_DIFS);
+	if (priv->difs != difs) {
+		priv->difs = difs;
+		iowrite8(priv->difs, priv->port_offset + MAC_REG_DIFS);
 	}
 	if (priv->byEIFS != C_EIFS) {
 		priv->byEIFS = C_EIFS;
drivers/staging/vt6655/device.h +1 -1
index e6669c5f0b8b..264bb056c80c 100644
@@ -182,7 +182,7 @@ struct vnt_private {
 	unsigned int	uCwMax;   /* CwMax is fixed on 1023. */
 	/* PHY parameter */
 	unsigned char sifs;
-	unsigned char byDIFS;
+	unsigned char difs;
 	unsigned char byEIFS;
 	unsigned char slot;
 	unsigned char cw_max_min;
Signature · 1 line
2.34.1
#5 lore raw

PATCH 5/5 staging: vt6655: Rename variable byEIFS

In reply to Gilbert Adikankwu

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

Fix checkpatch.pl error:
CHECK: Avoid CamelCase: <byEIFS>

---
 drivers/staging/vt6655/card.c   | 6 +++---
 drivers/staging/vt6655/device.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/vt6655/card.c +3 -3
index 9c8648ea96be..079fd01c6780 100644
@@ -250,9 +250,9 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
 		priv->difs = difs;
 		iowrite8(priv->difs, priv->port_offset + MAC_REG_DIFS);
 	}
-	if (priv->byEIFS != C_EIFS) {
-		priv->byEIFS = C_EIFS;
-		iowrite8(priv->byEIFS, priv->port_offset + MAC_REG_EIFS);
+	if (priv->eifs != C_EIFS) {
+		priv->eifs = C_EIFS;
+		iowrite8(priv->eifs, priv->port_offset + MAC_REG_EIFS);
 	}
 	if (priv->slot != slot) {
 		priv->slot = slot;
drivers/staging/vt6655/device.h +1 -1
index 264bb056c80c..7773b19a5788 100644
@@ -183,7 +183,7 @@ struct vnt_private {
 	/* PHY parameter */
 	unsigned char sifs;
 	unsigned char difs;
-	unsigned char byEIFS;
+	unsigned char eifs;
 	unsigned char slot;
 	unsigned char cw_max_min;
 
Signature · 1 line
2.34.1
Tested-by on the v1 series
#6 lore raw
In reply to Gilbert Adikankwu
Quoted 10 lines · Gilbert Adikankwu

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

Gilbert Adikankwu (5):
staging: vt6655: Rename variable byCWMaxMin
staging: vt6655: Rename variable bySlot
staging: vt6655: Rename variable bySIFS
staging: vt6655: Rename variable byDIFS
staging: vt6655: Rename variable byEIFS

Quoted 4 lines
  drivers/staging/vt6655/card.c   | 72 ++++++++++++++++-----------------
  drivers/staging/vt6655/device.h | 10 ++---
  2 files changed, 41 insertions(+), 41 deletions(-)