Skip to contentSkip to conversation

staging: vt6655f: rxtx: code style - Fix Lines should not end with a '('

PATCH Superseded Aliya Rahmani 3 participants 4 messages Apr 15, 2022 Staging

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 staging: vt6655f: rxtx: code style - Fix Lines should not end with a '('

Code style warnings reported by checkpatch.
Improve the layout of a function header:
*Put the first parameter immediately after the '(' and align the other parameters underneath it.

---
v1->v2 changes: Put static and void on a single line.

v2->v3->v4 changes: Rework commit description.

---
 drivers/staging/vt6655/rxtx.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)
drivers/staging/vt6655/rxtx.c +10 -13
index 53506e242a96..01dc83b2f4bc 100644
@@ -567,19 +567,16 @@ s_uFillDataHead(
 	return buf->duration;
 }
 
-static
-void
-s_vFillRTSHead(
-	struct vnt_private *pDevice,
-	unsigned char byPktType,
-	void *pvRTS,
-	unsigned int cbFrameLength,
-	bool bNeedAck,
-	bool bDisCRC,
-	struct ieee80211_hdr *hdr,
-	unsigned short wCurrentRate,
-	unsigned char byFBOption
-)
+static void
+s_vFillRTSHead(struct vnt_private *pDevice,
+		unsigned char byPktType,
+		void *pvRTS,
+		unsigned int cbFrameLength,
+		bool bNeedAck,
+		bool bDisCRC,
+		struct ieee80211_hdr *hdr,
+		unsigned short wCurrentRate,
+		unsigned char byFBOption)
 {
 	unsigned int uRTSFrameLen = 20;
 
Signature · 1 line
2.25.1
#1 lore raw

Hi Aliya,

I think that the subject of your patch can be reduced a bit. For example, why don't you remove that "code style -"?

Quoted 4 lines · On venerdì 15 aprile 2022 07:19:01 CEST Aliya Rahmani wrote:

Code style warnings reported by checkpatch.
Improve the layout of a function header:
*Put the first parameter immediately after the '(' and align the other parameters underneath it.

You are doing two different things. Please only one logical change per patch. Furthermore, why that "*" before "Put"?

drivers/staging/vt6655/

Quoted 12 lines

---
v1->v2 changes: Put static and void on a single line.

v2->v3->v4 changes: Rework commit description.

---
 drivers/staging/vt6655/rxtx.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)
drivers/staging/vt6655/ renamed from drivers/staging/vt6655/rxtx.c +0 -0

rxtx.c

Quoted 11 lines

index 53506e242a96..01dc83b2f4bc 100644

drivers/staging/vt6655/rxtx.c +0 -4
@@ -567,19 +567,16 @@ s_uFillDataHead(
 	return buf->duration;
 }
 
-static
-void
-s_vFillRTSHead(
-	struct vnt_private *pDevice,

drivers/staging/vt6655/rxtx.c s_uFillDataHead( · line 570

Quoted 10 lines
drivers/staging/vt6655/rxtx.c +1 -9
-	unsigned char byPktType,
-	void *pvRTS,
-	unsigned int cbFrameLength,
-	bool bNeedAck,
-	bool bDisCRC,
-	struct ieee80211_hdr *hdr,
-	unsigned short wCurrentRate,
-	unsigned char byFBOption
-)
+static void

Why storage class and function type are on a separate line? Is it a special convention for this driver?

Quoted 14 lines
drivers/staging/vt6655/rxtx.c +9 -0
+s_vFillRTSHead(struct vnt_private *pDevice,
+		unsigned char byPktType,
+		void *pvRTS,
+		unsigned int cbFrameLength,
+		bool bNeedAck,
+		bool bDisCRC,
+		struct ieee80211_hdr *hdr,
+		unsigned short wCurrentRate,
+		unsigned char byFBOption)
 {
 	unsigned int uRTSFrameLen = 20;
 
Signature · 1 line
2.25.1

Thanks,

Fabio M. De Francesco

#2 lore raw
Quoted 5 lines · Fabio M. De Francesco

Hi Aliya,

I think that the subject of your patch can be reduced a bit. For example, why don't you remove that "code style -"?

Quoted 8 lines
Quoted 4 lines · On venerdì 15 aprile 2022 07:19:01 CEST Aliya Rahmani wrote:

Code style warnings reported by checkpatch.
Improve the layout of a function header:
*Put the first parameter immediately after the '(' and align the other parameters underneath it.

You are doing two different things. Please only one logical change per patch. Furthermore, why that "*" before "Put"?

I think that fixing up a function header could be considered to be one thing?

But the subject line should reflect the complete one thing.

julia

Quoted 61 lines

drivers/staging/vt6655/

Quoted 13 lines

---
v1->v2 changes: Put static and void on a single line.

v2->v3->v4 changes: Rework commit description.

---
 drivers/staging/vt6655/rxtx.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)
drivers/staging/vt6655/ renamed from drivers/staging/vt6655/rxtx.c +0 -0

rxtx.c

Quoted 11 lines

index 53506e242a96..01dc83b2f4bc 100644

drivers/staging/vt6655/rxtx.c +0 -4
@@ -567,19 +567,16 @@ s_uFillDataHead(
 	return buf->duration;
 }
 
-static
-void
-s_vFillRTSHead(
-	struct vnt_private *pDevice,

drivers/staging/vt6655/rxtx.c s_uFillDataHead( · line 570

Quoted 10 lines
drivers/staging/vt6655/rxtx.c +1 -9
-	unsigned char byPktType,
-	void *pvRTS,
-	unsigned int cbFrameLength,
-	bool bNeedAck,
-	bool bDisCRC,
-	struct ieee80211_hdr *hdr,
-	unsigned short wCurrentRate,
-	unsigned char byFBOption
-)
+static void

Why storage class and function type are on a separate line? Is it a special convention for this driver?

Quoted 13 lines
drivers/staging/vt6655/rxtx.c +9 -1
+s_vFillRTSHead(struct vnt_private *pDevice,
+		unsigned char byPktType,
+		void *pvRTS,
+		unsigned int cbFrameLength,
+		bool bNeedAck,
+		bool bDisCRC,
+		struct ieee80211_hdr *hdr,
+		unsigned short wCurrentRate,
+		unsigned char byFBOption)
 {
 	unsigned int uRTSFrameLen = 20;
 
--
Quoted 1 line

2.25.1

Thanks,

Fabio M. De Francesco

#3 lore raw
In reply to Aliya Rahmani
Quoted 4 lines · Aliya Rahmani

Code style warnings reported by checkpatch.
Improve the layout of a function header:
*Put the first parameter immediately after the '(' and align the other parameters underneath it.

The subject line should cover the whole patch, not just part of it.

Similarly, I guess checkpatch just warned about the (, not about the whole thing.

The log message should mention about static void.

There should be no * in front of "Put".

julia

Quoted 50 lines

---
v1->v2 changes: Put static and void on a single line.

v2->v3->v4 changes: Rework commit description.

---
 drivers/staging/vt6655/rxtx.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)
drivers/staging/vt6655/rxtx.c +10 -14
index 53506e242a96..01dc83b2f4bc 100644
@@ -567,19 +567,16 @@ s_uFillDataHead(
 	return buf->duration;
 }
 
-static
-void
-s_vFillRTSHead(
-	struct vnt_private *pDevice,
-	unsigned char byPktType,
-	void *pvRTS,
-	unsigned int cbFrameLength,
-	bool bNeedAck,
-	bool bDisCRC,
-	struct ieee80211_hdr *hdr,
-	unsigned short wCurrentRate,
-	unsigned char byFBOption
-)
+static void
+s_vFillRTSHead(struct vnt_private *pDevice,
+		unsigned char byPktType,
+		void *pvRTS,
+		unsigned int cbFrameLength,
+		bool bNeedAck,
+		bool bDisCRC,
+		struct ieee80211_hdr *hdr,
+		unsigned short wCurrentRate,
+		unsigned char byFBOption)
 {
 	unsigned int uRTSFrameLen = 20;
 
--

2.25.1