Skip to contentSkip to conversation

staging: vt6655: Fix coding style issues

PATCH Superseded Mamta Shukla 3 participants 8 messages Oct 5, 2018 – Oct 6, 2018 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover staging: vt6655: Fix coding style issues

Fix issues found using checkpatch.pl for vt6655 staging driver.

Mamta Shukla (4):
staging: vt6655: Add blank line after function/struct/union/enum declarations
staging: vt6655: Add spaces around '*'
staging: vt6655: Add spaces around '-'
staging: vt6655: Remove space after cast

 drivers/staging/vt6655/rxtx.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/4 staging: vt6655: Add blank line after function/struct/union/enum declarations

Add blank line after function/struct/union/enum declarations to fix checkpatch issue.
CHECK: Please use a blank line after function/struct/union/enum declarations

---
 drivers/staging/vt6655/rxtx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/vt6655/rxtx.c +1 -0
index 9c4a532..8ae9c68 100644
@@ -65,6 +65,7 @@
 	{RATE_12M, RATE_18M, RATE_24M, RATE_36M, RATE_48M}, /* fallback_rate0 */
 	{RATE_12M, RATE_12M, RATE_18M, RATE_24M, RATE_36M}, /* fallback_rate1 */
 };
+
 static const unsigned short wFB_Opt1[2][5] = {
 	{RATE_12M, RATE_18M, RATE_24M, RATE_24M, RATE_36M}, /* fallback_rate0 */
 	{RATE_6M,  RATE_6M,  RATE_12M, RATE_12M, RATE_18M}, /* fallback_rate1 */
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/4 staging: vt6655: Add spaces around '*'

In reply to Mamta Shukla

Add spaces around '*' to fix checkpatch issue.
CHECK: spaces preferred around that '*' (ctx:VxV)

---
 drivers/staging/vt6655/rxtx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/vt6655/rxtx.c +2 -2
index 8ae9c68..596d5f8 100644
@@ -213,12 +213,12 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 	} else if (byRTSRsvType == 3) { /* CTSTxRrvTime_ba, only in 2.4GHZ */
 		uCTSTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopCCKBasicRate);
 		uAckTime = BBuGetFrameTime(pDevice->byPreambleType, byPktType, 14, pDevice->byTopOFDMBasicRate);
-		uRrvTime = uCTSTime + uAckTime + uDataTime + 2*pDevice->uSIFS;
+		uRrvTime = uCTSTime + uAckTime + uDataTime + 2 * pDevice->uSIFS;
 		return cpu_to_le16((u16)uRrvTime);
 	}
 
 	/* RTSRrvTime */
-	uRrvTime = uRTSTime + uCTSTime + uAckTime + uDataTime + 3*pDevice->uSIFS;
+	uRrvTime = uRTSTime + uCTSTime + uAckTime + uDataTime + 3 * pDevice->uSIFS;
 	return cpu_to_le16((u16)uRrvTime);
 }
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/4 staging: vt6655: Add spaces around '-'

In reply to Mamta Shukla

Add spaces around '-' to fix checkpatch issue.
CHECK: spaces preferred around that '-' (ctx:VxV)

---
 drivers/staging/vt6655/rxtx.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/vt6655/rxtx.c +7 -7
index 596d5f8..1eb8cea 100644
@@ -241,7 +241,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 	bool bLastFrag = false;
 	unsigned int uAckTime = 0, uNextPktTime = 0;
 
-	if (uFragIdx == (uMACfragNum-1))
+	if (uFragIdx == (uMACfragNum - 1))
 		bLastFrag = true;
 
 	switch (byDurType) {
@@ -254,7 +254,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 				return 0;
 			}
 		} else {/* First Frag or Mid Frag */
-			if (uFragIdx == (uMACfragNum-2))
+			if (uFragIdx == (uMACfragNum - 2))
 				uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
 			else
 				uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
@@ -277,7 +277,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 				return 0;
 			}
 		} else {/* First Frag or Mid Frag */
-			if (uFragIdx == (uMACfragNum-2))
+			if (uFragIdx == (uMACfragNum - 2))
 				uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wRate, bNeedAck);
 			else
 				uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wRate, bNeedAck);
@@ -306,7 +306,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 				else if (wRate > RATE_54M)
 					wRate = RATE_54M;
 
-				if (uFragIdx == (uMACfragNum-2))
+				if (uFragIdx == (uMACfragNum - 2))
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt0[FB_RATE0][wRate-RATE_18M], bNeedAck);
 				else
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE0][wRate-RATE_18M], bNeedAck);
@@ -317,7 +317,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 				else if (wRate > RATE_54M)
 					wRate = RATE_54M;
 
-				if (uFragIdx == (uMACfragNum-2))
+				if (uFragIdx == (uMACfragNum - 2))
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt1[FB_RATE0][wRate-RATE_18M], bNeedAck);
 				else
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE0][wRate-RATE_18M], bNeedAck);
@@ -347,7 +347,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 				else if (wRate > RATE_54M)
 					wRate = RATE_54M;
 
-				if (uFragIdx == (uMACfragNum-2))
+				if (uFragIdx == (uMACfragNum - 2))
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt0[FB_RATE1][wRate-RATE_18M], bNeedAck);
 				else
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt0[FB_RATE1][wRate-RATE_18M], bNeedAck);
@@ -358,7 +358,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 				else if (wRate > RATE_54M)
 					wRate = RATE_54M;
 
-				if (uFragIdx == (uMACfragNum-2))
+				if (uFragIdx == (uMACfragNum - 2))
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbLastFragmentSize, wFB_Opt1[FB_RATE1][wRate-RATE_18M], bNeedAck);
 				else
 					uNextPktTime = s_uGetTxRsvTime(pDevice, byPktType, cbFrameLength, wFB_Opt1[FB_RATE1][wRate-RATE_18M], bNeedAck);
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/4 staging: vt6655: Remove space after cast

In reply to Mamta Shukla

Remove space after cast to fix checkpatch issue.
CHECK: No space is necessary after a cast

---
 drivers/staging/vt6655/rxtx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/vt6655/rxtx.c +5 -5
index 1eb8cea..a7c1e46 100644
@@ -1094,7 +1094,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 							sizeof(struct vnt_tx_datahead_g);
 			} else { /* RTS_needless */
 				pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
-				pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
+				pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
 				pvRTS = NULL;
 				pvCTS = (void *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
 				pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize +
@@ -1106,7 +1106,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 			/* Auto Fall Back */
 			if (bRTS) {/* RTS_need */
 				pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
-				pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts));
+				pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts));
 				pvRTS = (void *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) + cbMICHDR);
 				pvCTS = NULL;
 				pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_rts) +
@@ -1115,7 +1115,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 					cbMICHDR + sizeof(struct vnt_rts_g_fb) + sizeof(struct vnt_tx_datahead_g_fb);
 			} else { /* RTS_needless */
 				pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
-				pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
+				pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts));
 				pvRTS = NULL;
 				pvCTS = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) + cbMICHDR);
 				pvTxDataHd = (void  *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_cts) +
@@ -1129,7 +1129,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 		if (byFBOption == AUTO_FB_NONE) {
 			if (bRTS) {
 				pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
-				pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
+				pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
 				pvRTS = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
 				pvCTS = NULL;
 				pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize +
@@ -1138,7 +1138,7 @@ static __le16 vnt_rxtx_rsvtime_le16(struct vnt_private *priv, u8 pkt_type,
 					cbMICHDR + sizeof(struct vnt_rts_ab) + sizeof(struct vnt_tx_datahead_ab);
 			} else { /* RTS_needless, need MICHDR */
 				pvRrvTime = (void *)(pbyTxBufferAddr + wTxBufSize);
-				pMICHDR = (struct vnt_mic_hdr *) (pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
+				pMICHDR = (struct vnt_mic_hdr *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab));
 				pvRTS = NULL;
 				pvCTS = NULL;
 				pvTxDataHd = (void *)(pbyTxBufferAddr + wTxBufSize + sizeof(struct vnt_rrv_time_ab) + cbMICHDR);
Signature · 1 line
1.9.1
#5 lore raw
In reply to Mamta Shukla
Quoted 10 lines · Mamta Shukla

Fix issues found using checkpatch.pl for vt6655 staging driver.

Mamta Shukla (4):
staging: vt6655: Add blank line after function/struct/union/enum declarations
staging: vt6655: Add spaces around '*'
staging: vt6655: Add spaces around '-'
staging: vt6655: Remove space after cast

 drivers/staging/vt6655/rxtx.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

Don't put a cover letter for these checkpatch changes. It doesn't convey any additional info about the patch series and therefore isn't required.

Also, adding spaces could be squashed into a single patch.

Just remember these for future..

Otherwise, ACK for whole series!

Signature · 4 lines
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology
#6 lore raw
Quoted 10 lines · Himanshu Jha
Quoted 8 lines · Mamta Shukla

Fix issues found using checkpatch.pl for vt6655 staging driver.

Mamta Shukla (4):
staging: vt6655: Add blank line after function/struct/union/enum declarations
staging: vt6655: Add spaces around '*'
staging: vt6655: Add spaces around '-'
staging: vt6655: Remove space after cast

Quoted 6 lines
Quoted 2 lines
 drivers/staging/vt6655/rxtx.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

Don't put a cover letter for these checkpatch changes. It doesn't convey any additional info about the patch series and therefore isn't required.

Himanshu, we recommend to use cover letter even for cleanup patches for Outreachy applicants because it helps them to practice and understand how patch series works. So, I would still prefer to have it.

Mamta, I think in this case you can probably put what sort of checkpatch.pl issues your patch series is handling rather than just saying that it is fixing checkpatch.pl issues.

Quoted 1 line

Also, adding spaces could be squashed into a single patch.

I agree.

Quoted 16 lines

Just remember these for future..

Otherwise, ACK for whole series!

--
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

--
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 [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20181005181050.GC30924%40himanshu-Vostro-3559.
For more options, visit https://groups.google.com/d/optout.

#7 lore raw
Quoted 24 lines · Vaishali Thakkar
Quoted 6 lines · Himanshu Jha
Quoted 4 lines · Mamta Shukla

Fix issues found using checkpatch.pl for vt6655 staging driver.

Mamta Shukla (4):
staging: vt6655: Add blank line after function/struct/union/enum

declarations

Quoted 14 lines
Quoted 6 lines

staging: vt6655: Add spaces around '*'
staging: vt6655: Add spaces around '-'
staging: vt6655: Remove space after cast

 drivers/staging/vt6655/rxtx.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

Don't put a cover letter for these checkpatch changes. It doesn't convey any additional info about the patch series and therefore isn't required.

Himanshu, we recommend to use cover letter even for cleanup patches for Outreachy applicants because it helps them to practice and understand how patch series works. So, I would still prefer to have it.

Quoted 11 lines
Quoted 1 line

Mamta, I think in this case you can probably put what sort of

checkpatch.pl

Quoted 1 line

issues your patch series is handling rather than just saying that it is

fixing

Quoted 1 line

checkpatch.pl <http://checkpatch.pl> issues.

I will add required description in cover letter.

Quoted 1 line
Quoted 1 line

Also, adding spaces could be squashed into a single patch.

I will merge PATCH 2 and PATCH 3 and will send revised version of this patch series.

Quoted 24 lines
Quoted 7 lines

I agree.

Just remember these for future..

Otherwise, ACK for whole series!

Quoted 8 lines

--
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

--
You received this message because you are subscribed to the Google

Groups "outreachy-kernel" group.

Quoted 1 line

To unsubscribe from this group and stop receiving emails from it, send

an email to [email protected].

Quoted 2 lines

To post to this group, send email to [email protected]. To view this discussion on the web visit

https://groups.google.com/d/msgid/outreachy-kernel/20181005181050.GC30924%40himanshu-Vostro-3559
.

Quoted 1 line

For more options, visit https://groups.google.com/d/optout.

Signature · 5 lines
Mamta Shukla
Pune Institute  of Computer Technology
Pune
m: 9158516957
e : [email protected]