linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: vt6655: `RFvWriteWakeProgSyn` variables rename
@ 2021-10-22  9:37 Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 1/5] staging: vt6655: Rename `ii` variable Karolina Drobnik
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-22  9:37 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel, Karolina Drobnik

This patch set is a preparation work for `RFvWriteWakeProgSyn`
refactoring. It includes removal of Hungarian notation in
local variables and function parameters and changing them
to use snake case.

Karolina Drobnik (5):
  staging: vt6655: Rename `ii` variable
  staging: vt6655: Rename `byInitCount` variable
  staging: vt6655: Rename `bySleepCount` variable
  staging: vt6655: Rename `uChannel` variable
  staging: vt6655: Rename `byRFType` variable

 drivers/staging/vt6655/rf.c | 60 ++++++++++++++++++-------------------
 drivers/staging/vt6655/rf.h |  2 +-
 2 files changed, 31 insertions(+), 31 deletions(-)

-- 
2.30.2


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

* [PATCH 1/5] staging: vt6655: Rename `ii` variable
  2021-10-22  9:37 [PATCH 0/5] staging: vt6655: `RFvWriteWakeProgSyn` variables rename Karolina Drobnik
@ 2021-10-22  9:37 ` Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 2/5] staging: vt6655: Rename `byInitCount` variable Karolina Drobnik
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-22  9:37 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel, Karolina Drobnik

Drop Hungarian notation in the loop counter `ii` in
`RFvWriteWakeProgSyn` function.

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
---
 drivers/staging/vt6655/rf.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 6bdacf8fbc27..7e441309dd9c 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -680,7 +680,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 			 u16 uChannel)
 {
 	void __iomem *iobase = priv->port_offset;
-	int   ii;
+	int i;
 	unsigned char byInitCount = 0;
 	unsigned char bySleepCount = 0;
 
@@ -698,12 +698,12 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 		if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
 			return false;
 
-		for (ii = 0; ii < CB_AL2230_INIT_SEQ; ii++)
-			MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), al2230_init_table[ii]);
+		for (i = 0; i < CB_AL2230_INIT_SEQ; i++)
+			MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al2230_init_table[i]);
 
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable0[uChannel - 1]);
-		ii++;
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL2230ChannelTable1[uChannel - 1]);
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL2230ChannelTable0[uChannel - 1]);
+		i++;
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL2230ChannelTable1[uChannel - 1]);
 		break;
 
 		/* Need to check, PLLON need to be low for channel setting */
@@ -715,18 +715,18 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 			return false;
 
 		if (uChannel <= CB_MAX_CHANNEL_24G) {
-			for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
-				MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTable[ii]);
+			for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
+				MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230InitTable[i]);
 		} else {
-			for (ii = 0; ii < CB_AL7230_INIT_SEQ; ii++)
-				MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230InitTableAMode[ii]);
+			for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
+				MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230InitTableAMode[i]);
 		}
 
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable0[uChannel - 1]);
-		ii++;
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable1[uChannel - 1]);
-		ii++;
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + ii), dwAL7230ChannelTable2[uChannel - 1]);
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable0[uChannel - 1]);
+		i++;
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable1[uChannel - 1]);
+		i++;
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable2[uChannel - 1]);
 		break;
 
 	case RF_NOTHING:
-- 
2.30.2


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

* [PATCH 2/5] staging: vt6655: Rename `byInitCount` variable
  2021-10-22  9:37 [PATCH 0/5] staging: vt6655: `RFvWriteWakeProgSyn` variables rename Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 1/5] staging: vt6655: Rename `ii` variable Karolina Drobnik
@ 2021-10-22  9:37 ` Karolina Drobnik
  2021-10-22 16:40   ` [Outreachy kernel] " Alison Schofield
  2021-10-22  9:37 ` [PATCH 3/5] staging: vt6655: Rename `bySleepCount` variable Karolina Drobnik
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-22  9:37 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel, Karolina Drobnik

Drop Hungarian notation in `byInitCount` variable in
`RFvWriteWakeProgSyn` function. Change it to use snake case.

Fix issue detected by checkpatch.pl:
  CHECK: Avoid CamelCase: <byInitCount>

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
---
 drivers/staging/vt6655/rf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 7e441309dd9c..36708af7d612 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -681,7 +681,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 {
 	void __iomem *iobase = priv->port_offset;
 	int i;
-	unsigned char byInitCount = 0;
+	unsigned char init_count = 0;
 	unsigned char bySleepCount = 0;
 
 	VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0);
@@ -693,9 +693,9 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 			return false;
 
 		 /* Init Reg + Channel Reg (2) */
-		byInitCount = CB_AL2230_INIT_SEQ + 2;
+		init_count = CB_AL2230_INIT_SEQ + 2;
 		bySleepCount = 0;
-		if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
+		if (init_count > (MISCFIFO_SYNDATASIZE - bySleepCount))
 			return false;
 
 		for (i = 0; i < CB_AL2230_INIT_SEQ; i++)
@@ -709,9 +709,9 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 		/* Need to check, PLLON need to be low for channel setting */
 	case RF_AIROHA7230:
 		 /* Init Reg + Channel Reg (3) */
-		byInitCount = CB_AL7230_INIT_SEQ + 3;
+		init_count = CB_AL7230_INIT_SEQ + 3;
 		bySleepCount = 0;
-		if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
+		if (init_count > (MISCFIFO_SYNDATASIZE - bySleepCount))
 			return false;
 
 		if (uChannel <= CB_MAX_CHANNEL_24G) {
@@ -736,7 +736,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 		return false;
 	}
 
-	MACvSetMISCFifo(priv, MISCFIFO_SYNINFO_IDX, (unsigned long)MAKEWORD(bySleepCount, byInitCount));
+	MACvSetMISCFifo(priv, MISCFIFO_SYNINFO_IDX, (unsigned long)MAKEWORD(bySleepCount, init_count));
 
 	return true;
 }
-- 
2.30.2


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

* [PATCH 3/5] staging: vt6655: Rename `bySleepCount` variable
  2021-10-22  9:37 [PATCH 0/5] staging: vt6655: `RFvWriteWakeProgSyn` variables rename Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 1/5] staging: vt6655: Rename `ii` variable Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 2/5] staging: vt6655: Rename `byInitCount` variable Karolina Drobnik
@ 2021-10-22  9:37 ` Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 4/5] staging: vt6655: Rename `uChannel` variable Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 5/5] staging: vt6655: Rename `byRFType` variable Karolina Drobnik
  4 siblings, 0 replies; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-22  9:37 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel, Karolina Drobnik

Drop Hungarian notation in `bySleepCount` variable in
`RFvWriteWakeProgSyn` function. Change it to use snake case.

Fix issue detected by checkpatch.pl:
  CHECK: Avoid CamelCase: <bySleepCount>

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
---
 drivers/staging/vt6655/rf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 36708af7d612..a30ffacf720a 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -682,7 +682,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 	void __iomem *iobase = priv->port_offset;
 	int i;
 	unsigned char init_count = 0;
-	unsigned char bySleepCount = 0;
+	unsigned char sleep_count = 0;
 
 	VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0);
 	switch (byRFType) {
@@ -694,8 +694,8 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 
 		 /* Init Reg + Channel Reg (2) */
 		init_count = CB_AL2230_INIT_SEQ + 2;
-		bySleepCount = 0;
-		if (init_count > (MISCFIFO_SYNDATASIZE - bySleepCount))
+		sleep_count = 0;
+		if (init_count > (MISCFIFO_SYNDATASIZE - sleep_count))
 			return false;
 
 		for (i = 0; i < CB_AL2230_INIT_SEQ; i++)
@@ -710,8 +710,8 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 	case RF_AIROHA7230:
 		 /* Init Reg + Channel Reg (3) */
 		init_count = CB_AL7230_INIT_SEQ + 3;
-		bySleepCount = 0;
-		if (init_count > (MISCFIFO_SYNDATASIZE - bySleepCount))
+		sleep_count = 0;
+		if (init_count > (MISCFIFO_SYNDATASIZE - sleep_count))
 			return false;
 
 		if (uChannel <= CB_MAX_CHANNEL_24G) {
@@ -736,7 +736,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 		return false;
 	}
 
-	MACvSetMISCFifo(priv, MISCFIFO_SYNINFO_IDX, (unsigned long)MAKEWORD(bySleepCount, init_count));
+	MACvSetMISCFifo(priv, MISCFIFO_SYNINFO_IDX, (unsigned long)MAKEWORD(sleep_count, init_count));
 
 	return true;
 }
-- 
2.30.2


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

* [PATCH 4/5] staging: vt6655: Rename `uChannel` variable
  2021-10-22  9:37 [PATCH 0/5] staging: vt6655: `RFvWriteWakeProgSyn` variables rename Karolina Drobnik
                   ` (2 preceding siblings ...)
  2021-10-22  9:37 ` [PATCH 3/5] staging: vt6655: Rename `bySleepCount` variable Karolina Drobnik
@ 2021-10-22  9:37 ` Karolina Drobnik
  2021-10-22  9:37 ` [PATCH 5/5] staging: vt6655: Rename `byRFType` variable Karolina Drobnik
  4 siblings, 0 replies; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-22  9:37 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel, Karolina Drobnik

Drop Hungarian notation in `uChannel` variable in
`RFvWriteWakeProgSyn` function. Change it to use snake case.

Fix issue detected by checkpatch.pl:
  CHECK: Avoid CamelCase: <uChannel>

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
---
 drivers/staging/vt6655/rf.c | 18 +++++++++---------
 drivers/staging/vt6655/rf.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index a30ffacf720a..0dd91b0433f6 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -670,14 +670,14 @@ bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType,
  * Parameters:
  *  In:
  *      iobase      - I/O base address
- *      uChannel    - channel number
+ *      channel     - channel number
  *      bySleepCnt  - SleepProgSyn count
  *
  * Return Value: None.
  *
  */
 bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
-			 u16 uChannel)
+			 u16 channel)
 {
 	void __iomem *iobase = priv->port_offset;
 	int i;
@@ -689,7 +689,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 	case RF_AIROHA:
 	case RF_AL2230S:
 
-		if (uChannel > CB_MAX_CHANNEL_24G)
+		if (channel > CB_MAX_CHANNEL_24G)
 			return false;
 
 		 /* Init Reg + Channel Reg (2) */
@@ -701,9 +701,9 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 		for (i = 0; i < CB_AL2230_INIT_SEQ; i++)
 			MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), al2230_init_table[i]);
 
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL2230ChannelTable0[uChannel - 1]);
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL2230ChannelTable0[channel - 1]);
 		i++;
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL2230ChannelTable1[uChannel - 1]);
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL2230ChannelTable1[channel - 1]);
 		break;
 
 		/* Need to check, PLLON need to be low for channel setting */
@@ -714,7 +714,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 		if (init_count > (MISCFIFO_SYNDATASIZE - sleep_count))
 			return false;
 
-		if (uChannel <= CB_MAX_CHANNEL_24G) {
+		if (channel <= CB_MAX_CHANNEL_24G) {
 			for (i = 0; i < CB_AL7230_INIT_SEQ; i++)
 				MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230InitTable[i]);
 		} else {
@@ -722,11 +722,11 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 				MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230InitTableAMode[i]);
 		}
 
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable0[uChannel - 1]);
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable0[channel - 1]);
 		i++;
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable1[uChannel - 1]);
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable1[channel - 1]);
 		i++;
-		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable2[uChannel - 1]);
+		MACvSetMISCFifo(priv, (unsigned short)(MISCFIFO_SYNDATA_IDX + i), dwAL7230ChannelTable2[channel - 1]);
 		break;
 
 	case RF_NOTHING:
diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h
index d499aed45c9f..d3f2b8dd6afc 100644
--- a/drivers/staging/vt6655/rf.h
+++ b/drivers/staging/vt6655/rf.h
@@ -60,7 +60,7 @@
 bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData);
 bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType, u16 byChannel);
 bool RFbInit(struct vnt_private *priv);
-bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, u16 uChannel);
+bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, u16 channel);
 bool RFbSetPower(struct vnt_private *priv, unsigned int rate, u16 uCH);
 bool RFbRawSetPower(struct vnt_private *priv, unsigned char byPwr,
 		    unsigned int rate);
-- 
2.30.2


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

* [PATCH 5/5] staging: vt6655: Rename `byRFType` variable
  2021-10-22  9:37 [PATCH 0/5] staging: vt6655: `RFvWriteWakeProgSyn` variables rename Karolina Drobnik
                   ` (3 preceding siblings ...)
  2021-10-22  9:37 ` [PATCH 4/5] staging: vt6655: Rename `uChannel` variable Karolina Drobnik
@ 2021-10-22  9:37 ` Karolina Drobnik
  2021-10-22 14:26   ` [Outreachy kernel] " Praveen Kumar
  4 siblings, 1 reply; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-22  9:37 UTC (permalink / raw)
  To: outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel, Karolina Drobnik

Drop Hungarian notation in `byRFType` variable in
`RFvWriteWakeProgSyn` function. Change it to use snake case.

Fix issue detected by checkpatch.pl:
  CHECK: Avoid CamelCase: <byRFType>

Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
---
 drivers/staging/vt6655/rf.c | 4 ++--
 drivers/staging/vt6655/rf.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 0dd91b0433f6..3f57834901a6 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -676,7 +676,7 @@ bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType,
  * Return Value: None.
  *
  */
-bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
+bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
 			 u16 channel)
 {
 	void __iomem *iobase = priv->port_offset;
@@ -685,7 +685,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
 	unsigned char sleep_count = 0;
 
 	VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0);
-	switch (byRFType) {
+	switch (rf_type) {
 	case RF_AIROHA:
 	case RF_AL2230S:
 
diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h
index d3f2b8dd6afc..0939937d47a8 100644
--- a/drivers/staging/vt6655/rf.h
+++ b/drivers/staging/vt6655/rf.h
@@ -60,7 +60,7 @@
 bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData);
 bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType, u16 byChannel);
 bool RFbInit(struct vnt_private *priv);
-bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, u16 channel);
+bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type, u16 channel);
 bool RFbSetPower(struct vnt_private *priv, unsigned int rate, u16 uCH);
 bool RFbRawSetPower(struct vnt_private *priv, unsigned char byPwr,
 		    unsigned int rate);
-- 
2.30.2


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

* Re: [Outreachy kernel] [PATCH 5/5] staging: vt6655: Rename `byRFType` variable
  2021-10-22  9:37 ` [PATCH 5/5] staging: vt6655: Rename `byRFType` variable Karolina Drobnik
@ 2021-10-22 14:26   ` Praveen Kumar
  2021-10-22 15:58     ` Karolina Drobnik
  0 siblings, 1 reply; 10+ messages in thread
From: Praveen Kumar @ 2021-10-22 14:26 UTC (permalink / raw)
  To: Karolina Drobnik, outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel

On 22-10-2021 15:07, Karolina Drobnik wrote:
> Drop Hungarian notation in `byRFType` variable in
> `RFvWriteWakeProgSyn` function. Change it to use snake case.
> 
> Fix issue detected by checkpatch.pl:
>   CHECK: Avoid CamelCase: <byRFType>
> 
> Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
> ---
>  drivers/staging/vt6655/rf.c | 4 ++--
>  drivers/staging/vt6655/rf.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
> index 0dd91b0433f6..3f57834901a6 100644
> --- a/drivers/staging/vt6655/rf.c
> +++ b/drivers/staging/vt6655/rf.c
> @@ -676,7 +676,7 @@ bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType,
>   * Return Value: None.
>   *
>   */
> -bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
> +bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type,
>  			 u16 channel)
>  {
>  	void __iomem *iobase = priv->port_offset;
> @@ -685,7 +685,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
>  	unsigned char sleep_count = 0;
>  
>  	VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0);
> -	switch (byRFType) {
> +	switch (rf_type) {
>  	case RF_AIROHA:
>  	case RF_AL2230S:
>  
> diff --git a/drivers/staging/vt6655/rf.h b/drivers/staging/vt6655/rf.h
> index d3f2b8dd6afc..0939937d47a8 100644
> --- a/drivers/staging/vt6655/rf.h
> +++ b/drivers/staging/vt6655/rf.h
> @@ -60,7 +60,7 @@
>  bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData);
>  bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType, u16 byChannel);

IMO, probably we can sync RFbSelectChannel as well with similar notation in another patch.

>  bool RFbInit(struct vnt_private *priv);
> -bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, u16 channel);
> +bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char rf_type, u16 channel);
>  bool RFbSetPower(struct vnt_private *priv, unsigned int rate, u16 uCH);
>  bool RFbRawSetPower(struct vnt_private *priv, unsigned char byPwr,
>  		    unsigned int rate);
> 

Regards,

~Praveen.

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

* Re: [Outreachy kernel] [PATCH 5/5] staging: vt6655: Rename `byRFType` variable
  2021-10-22 14:26   ` [Outreachy kernel] " Praveen Kumar
@ 2021-10-22 15:58     ` Karolina Drobnik
  0 siblings, 0 replies; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-22 15:58 UTC (permalink / raw)
  To: Praveen Kumar, outreachy-kernel
  Cc: gregkh, forest, linux-staging, linux-kernel

Hi Praveen,

Thanks for taking a look at my patch.

On Fri, 2021-10-22 at 19:56 +0530, Praveen Kumar wrote:
> IMO, probably we can sync RFbSelectChannel as well with similar
> notation in another patch.
> 
> >  bool RFbInit(struct vnt_private *priv);
> > -bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char
> > byRFType, u16 channel);
> > +bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char
> > rf_type, u16 channel);
> >  bool RFbSetPower(struct vnt_private *priv, unsigned int rate, u16
> > uCH);
> >  bool RFbRawSetPower(struct vnt_private *priv, unsigned char byPwr,
> >                     unsigned int rate);

That's a good idea. I plan to clean up `RFvWriteWakeProgSyn` completely
first and then I can move on to this one.


Thanks,
Karolina



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

* Re: [Outreachy kernel] [PATCH 2/5] staging: vt6655: Rename `byInitCount` variable
  2021-10-22  9:37 ` [PATCH 2/5] staging: vt6655: Rename `byInitCount` variable Karolina Drobnik
@ 2021-10-22 16:40   ` Alison Schofield
  2021-10-25  9:38     ` Karolina Drobnik
  0 siblings, 1 reply; 10+ messages in thread
From: Alison Schofield @ 2021-10-22 16:40 UTC (permalink / raw)
  To: Karolina Drobnik
  Cc: outreachy-kernel, gregkh, forest, linux-staging, linux-kernel

On Fri, Oct 22, 2021 at 10:37:15AM +0100, Karolina Drobnik wrote:
> Drop Hungarian notation in `byInitCount` variable in
> `RFvWriteWakeProgSyn` function. Change it to use snake case.
> 
> Fix issue detected by checkpatch.pl:
>   CHECK: Avoid CamelCase: <byInitCount>

Hi Karolina,

This comment is for all the patches.

Commit msg:
We've got plenty of space on that line, how about:
"Rename byInitCount init_count"

(I say this because when someone searches by the oneliners it's
nice to give as many keywords as possible - within the line limit)


Commit log:
The log (why this patch is important) seems to be saying that
snake case is the fix for Hungarian notation. I don't think that
is completely true. Snake case avoids the camel case of Hungarian
notation, but we are also dropping the type descriptor which is
another signature of Hungarian notation.

Perhaps this would be more direct:

To align with the kernel coding style, remove the type from
the variable name and do not use CamelCase.

Reported by checkpatch.pl:
	CHECK: Avoid CamelCase: <byInitCount>

(Not for the log, but a ref if you don't have:
https://www.kernel.org/doc/html/v4.10/process/coding-style.html)

Alison

> 
> Signed-off-by: Karolina Drobnik <karolinadrobnik@gmail.com>
> ---
>  drivers/staging/vt6655/rf.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
> index 7e441309dd9c..36708af7d612 100644
> --- a/drivers/staging/vt6655/rf.c
> +++ b/drivers/staging/vt6655/rf.c
> @@ -681,7 +681,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
>  {
>  	void __iomem *iobase = priv->port_offset;
>  	int i;
> -	unsigned char byInitCount = 0;
> +	unsigned char init_count = 0;
>  	unsigned char bySleepCount = 0;
>  
>  	VNSvOutPortW(iobase + MAC_REG_MISCFFNDEX, 0);
> @@ -693,9 +693,9 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
>  			return false;
>  
>  		 /* Init Reg + Channel Reg (2) */
> -		byInitCount = CB_AL2230_INIT_SEQ + 2;
> +		init_count = CB_AL2230_INIT_SEQ + 2;
>  		bySleepCount = 0;
> -		if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
> +		if (init_count > (MISCFIFO_SYNDATASIZE - bySleepCount))
>  			return false;
>  
>  		for (i = 0; i < CB_AL2230_INIT_SEQ; i++)
> @@ -709,9 +709,9 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
>  		/* Need to check, PLLON need to be low for channel setting */
>  	case RF_AIROHA7230:
>  		 /* Init Reg + Channel Reg (3) */
> -		byInitCount = CB_AL7230_INIT_SEQ + 3;
> +		init_count = CB_AL7230_INIT_SEQ + 3;
>  		bySleepCount = 0;
> -		if (byInitCount > (MISCFIFO_SYNDATASIZE - bySleepCount))
> +		if (init_count > (MISCFIFO_SYNDATASIZE - bySleepCount))
>  			return false;
>  
>  		if (uChannel <= CB_MAX_CHANNEL_24G) {
> @@ -736,7 +736,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType,
>  		return false;
>  	}
>  
> -	MACvSetMISCFifo(priv, MISCFIFO_SYNINFO_IDX, (unsigned long)MAKEWORD(bySleepCount, byInitCount));
> +	MACvSetMISCFifo(priv, MISCFIFO_SYNINFO_IDX, (unsigned long)MAKEWORD(bySleepCount, init_count));
>  
>  	return true;
>  }
> -- 
> 2.30.2
> 
> -- 
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/53430b1183324f6a715999792a15df2ea6a3e206.1634826774.git.karolinadrobnik%40gmail.com.

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

* Re: [Outreachy kernel] [PATCH 2/5] staging: vt6655: Rename `byInitCount` variable
  2021-10-22 16:40   ` [Outreachy kernel] " Alison Schofield
@ 2021-10-25  9:38     ` Karolina Drobnik
  0 siblings, 0 replies; 10+ messages in thread
From: Karolina Drobnik @ 2021-10-25  9:38 UTC (permalink / raw)
  To: Alison Schofield
  Cc: outreachy-kernel, gregkh, forest, linux-staging, linux-kernel

Hi Alison,

On Fri, 2021-10-22 at 09:40 -0700, Alison Schofield wrote:
> On Fri, Oct 22, 2021 at 10:37:15AM +0100, Karolina Drobnik wrote:
> > Drop Hungarian notation in `byInitCount` variable in
> > `RFvWriteWakeProgSyn` function. Change it to use snake case.
> > 
> > Fix issue detected by checkpatch.pl:
> >   CHECK: Avoid CamelCase: <byInitCount>
> 
> Hi Karolina,
> 
> This comment is for all the patches.
> 
> Commit msg:
> We've got plenty of space on that line, how about:
> "Rename byInitCount init_count"
> 
> (I say this because when someone searches by the oneliners it's
> nice to give as many keywords as possible - within the line limit)

Ok, will do my best to include it in my upcoming patchset.

> Commit log:
> The log (why this patch is important) seems to be saying that
> snake case is the fix for Hungarian notation. I don't think that
> is completely true. Snake case avoids the camel case of Hungarian
> notation, but we are also dropping the type descriptor which is
> another signature of Hungarian notation.
> 
> Perhaps this would be more direct:
> 
> To align with the kernel coding style, remove the type from
> the variable name and do not use CamelCase.

Ok, I'll use this format from now on.


Thanks,
Karolina


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

end of thread, other threads:[~2021-10-25  9:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22  9:37 [PATCH 0/5] staging: vt6655: `RFvWriteWakeProgSyn` variables rename Karolina Drobnik
2021-10-22  9:37 ` [PATCH 1/5] staging: vt6655: Rename `ii` variable Karolina Drobnik
2021-10-22  9:37 ` [PATCH 2/5] staging: vt6655: Rename `byInitCount` variable Karolina Drobnik
2021-10-22 16:40   ` [Outreachy kernel] " Alison Schofield
2021-10-25  9:38     ` Karolina Drobnik
2021-10-22  9:37 ` [PATCH 3/5] staging: vt6655: Rename `bySleepCount` variable Karolina Drobnik
2021-10-22  9:37 ` [PATCH 4/5] staging: vt6655: Rename `uChannel` variable Karolina Drobnik
2021-10-22  9:37 ` [PATCH 5/5] staging: vt6655: Rename `byRFType` variable Karolina Drobnik
2021-10-22 14:26   ` [Outreachy kernel] " Praveen Kumar
2021-10-22 15:58     ` Karolina Drobnik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).