linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function
@ 2022-02-21 21:24 Philipp Hortmann
  2022-02-21 21:24 ` [PATCH v2 1/6] staging: vt6656: Fix CamelCase warnings in mac.h and mac.c Philipp Hortmann
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-02-21 21:24 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

Various checkpatch.pl fixes as liste below
Tested with device VNT6656G6A40
Transferred this patches over VNT6656G6A40

v2: Patch #1
    Changed EN_CFG_PKT_BURST_MO to EN_CFG_PKT_BURST_MD
    Patch #2
    Devided into three patches
    Patch #3
    Devided into two patches

Philipp Hortmann (6):
  staging: vt6656: Fix CamelCase warnings in mac.h and mac.c
  staging: vt6656: Add comment for locks
  staging: vt6656: Fix CamelCase warnings in macro
  staging: vt6656: Change macro to function and moved to better file
  staging: vt6656: Remove ftrace-like logging
  staging: vt6656: Remove unnecessary line breaks

 drivers/staging/vt6656/device.h | 11 ++---------
 drivers/staging/vt6656/mac.c    | 14 +++++++-------
 drivers/staging/vt6656/mac.h    | 22 +++++++++++-----------
 drivers/staging/vt6656/rxtx.c   |  8 ++------
 drivers/staging/vt6656/wcmd.c   | 13 +++++++++++--
 5 files changed, 33 insertions(+), 35 deletions(-)

-- 
2.25.1


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

* [PATCH v2 1/6] staging: vt6656: Fix CamelCase warnings in mac.h and mac.c
  2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
@ 2022-02-21 21:24 ` Philipp Hortmann
  2022-02-21 21:25 ` [PATCH v2 2/6] staging: vt6656: Add comment for locks Philipp Hortmann
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-02-21 21:24 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

This patch fixes the checkpatch.pl warnings like:
CHECK: Avoid CamelCase: <EnCFG_BBType_a>
175: FILE: drivers/staging/vt6656/mac.h:175:
+#define EnCFG_BBType_a		0x00
and affected places in mac.c

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1 -> V2: Changed EN_CFG_PKT_BURST_MO to EN_CFG_PKT_BURST_MD
---
 drivers/staging/vt6656/mac.c | 14 +++++++-------
 drivers/staging/vt6656/mac.h | 22 +++++++++++-----------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index 4f1f9b03a678..49430c0a99b8 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -39,7 +39,7 @@ int vnt_mac_set_bb_type(struct vnt_private *priv, u8 type)
 	u8 data[2];
 
 	data[0] = type;
-	data[1] = EnCFG_BBType_MASK;
+	data[1] = EN_CFG_BB_TYPE_MASK;
 
 	return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0,
 			       MESSAGE_REQUEST_MACREG,	ARRAY_SIZE(data),
@@ -120,8 +120,8 @@ int vnt_mac_enable_protect_mode(struct vnt_private *priv)
 {
 	u8 data[2];
 
-	data[0] = EnCFG_ProtectMd;
-	data[1] = EnCFG_ProtectMd;
+	data[0] = EN_CFG_PROTECT_MD;
+	data[1] = EN_CFG_PROTECT_MD;
 
 	return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0,
 			       MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
@@ -132,7 +132,7 @@ int vnt_mac_disable_protect_mode(struct vnt_private *priv)
 	u8 data[2];
 
 	data[0] = 0;
-	data[1] = EnCFG_ProtectMd;
+	data[1] = EN_CFG_PROTECT_MD;
 
 	return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0,
 			       MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
@@ -142,8 +142,8 @@ int vnt_mac_enable_barker_preamble_mode(struct vnt_private *priv)
 {
 	u8 data[2];
 
-	data[0] = EnCFG_BarkerPream;
-	data[1] = EnCFG_BarkerPream;
+	data[0] = EN_CFG_BARKER_PREAM;
+	data[1] = EN_CFG_BARKER_PREAM;
 
 	return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2,
 			       MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
@@ -154,7 +154,7 @@ int vnt_mac_disable_barker_preamble_mode(struct vnt_private *priv)
 	u8 data[2];
 
 	data[0] = 0;
-	data[1] = EnCFG_BarkerPream;
+	data[1] = EN_CFG_BARKER_PREAM;
 
 	return vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG2,
 			       MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h
index 05af9ca7d69c..0ac845bd3c5a 100644
--- a/drivers/staging/vt6656/mac.h
+++ b/drivers/staging/vt6656/mac.h
@@ -172,20 +172,20 @@
 #define TFTCTL_TSFCNTREN	BIT(0)
 
 /* Bits in the EnhanceCFG_0 register */
-#define EnCFG_BBType_a		0x00
-#define EnCFG_BBType_b		BIT(0)
-#define EnCFG_BBType_g		BIT(1)
-#define EnCFG_BBType_MASK	(EnCFG_BBType_b | EnCFG_BBType_g)
-#define EnCFG_ProtectMd		BIT(5)
+#define EN_CFG_BB_TYPE_A	0x00
+#define EN_CFG_BB_TYPE_B	BIT(0)
+#define EN_CFG_BB_TYPE_G	BIT(1)
+#define EN_CFG_BB_TYPE_MASK	(EN_CFG_BB_TYPE_B | EN_CFG_BB_TYPE_G)
+#define EN_CFG_PROTECT_MD	BIT(5)
 
 /* Bits in the EnhanceCFG_1 register */
-#define EnCFG_BcnSusInd		BIT(0)
-#define EnCFG_BcnSusClr		BIT(1)
+#define EN_CFG_BCN_SUS_IND	BIT(0)
+#define EN_CFG_BCN_SUS_CLR	BIT(1)
 
 /* Bits in the EnhanceCFG_2 register */
-#define EnCFG_NXTBTTCFPSTR	BIT(0)
-#define EnCFG_BarkerPream	BIT(1)
-#define EnCFG_PktBurstMode	BIT(2)
+#define EN_CFG_NXTBTTCFPSTR	BIT(0)
+#define EN_CFG_BARKER_PREAM	BIT(1)
+#define EN_CFG_PKT_BURST_MD	BIT(2)
 
 /* Bits in the CFG register */
 #define CFG_TKIPOPT		BIT(7)
@@ -333,7 +333,7 @@
 #define PKT_TYPE_ERROR_CRC	BIT(1)
 #define PKT_TYPE_BSSID		BIT(0)
 
-#define Default_BI              0x200
+#define DEFAULT_BI		0x200
 
 /* MiscFIFO Offset */
 #define MISCFIFO_KEYETRY0	32
-- 
2.25.1


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

* [PATCH v2 2/6] staging: vt6656: Add comment for locks
  2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
  2022-02-21 21:24 ` [PATCH v2 1/6] staging: vt6656: Fix CamelCase warnings in mac.h and mac.c Philipp Hortmann
@ 2022-02-21 21:25 ` Philipp Hortmann
  2022-02-21 21:25 ` [PATCH v2 3/6] staging: vt6656: Fix CamelCase warnings in macro Philipp Hortmann
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-02-21 21:25 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

This patch fixes the checkpatch.pl warnings like:
- CHECK: spinlock_t definition without comment

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1 -> V2: Devided patch into three patches
---
 drivers/staging/vt6656/device.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 8b6623a751f0..dda38c2a6f06 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -268,8 +268,8 @@ struct vnt_private {
 	u32 rx_buf_sz;
 	int mc_list_count;
 
-	spinlock_t lock;
-	struct mutex usb_lock;
+	spinlock_t lock;		/* prepare tx USB URB */
+	struct mutex usb_lock;		/* USB control messages */
 
 	unsigned long flags;
 
-- 
2.25.1


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

* [PATCH v2 3/6] staging: vt6656: Fix CamelCase warnings in macro
  2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
  2022-02-21 21:24 ` [PATCH v2 1/6] staging: vt6656: Fix CamelCase warnings in mac.h and mac.c Philipp Hortmann
  2022-02-21 21:25 ` [PATCH v2 2/6] staging: vt6656: Add comment for locks Philipp Hortmann
@ 2022-02-21 21:25 ` Philipp Hortmann
  2022-02-21 21:25 ` [PATCH v2 4/6] staging: vt6656: Change macro to function and moved to better file Philipp Hortmann
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-02-21 21:25 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

This patch fixes the checkpatch.pl warnings like:
- CHECK: Avoid CamelCase: <uVar>

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1 -> V2: Devided patch into three
---
 drivers/staging/vt6656/device.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index dda38c2a6f06..0ab2d60204e8 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -381,11 +381,11 @@ struct vnt_private {
 	struct ieee80211_low_level_stats low_stats;
 };
 
-#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) {	\
-	if ((uVar) >= ((uModulo) - 1))			\
-		(uVar) = 0;				\
+#define ADD_ONE_WITH_WRAP_AROUND(var, modulo) {	\
+	if ((var) >= ((modulo) - 1))			\
+		(var) = 0;				\
 	else						\
-		(uVar)++;				\
+		(var)++;				\
 }
 
 int vnt_init(struct vnt_private *priv);
-- 
2.25.1


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

* [PATCH v2 4/6] staging: vt6656: Change macro to function and moved to better file
  2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
                   ` (2 preceding siblings ...)
  2022-02-21 21:25 ` [PATCH v2 3/6] staging: vt6656: Fix CamelCase warnings in macro Philipp Hortmann
@ 2022-02-21 21:25 ` Philipp Hortmann
  2022-02-21 21:25 ` [PATCH v2 5/6] staging: vt6656: Remove ftrace-like logging Philipp Hortmann
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-02-21 21:25 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

This patch fixes the checkpatch.pl warning like:
- CHECK: Macro argument reuse 'uVar' - possible side-effects?
Moved the only twice used function to the file where it is used.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1 -> V2: Devided patch into three
---
 drivers/staging/vt6656/device.h |  7 -------
 drivers/staging/vt6656/wcmd.c   | 13 +++++++++++--
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 0ab2d60204e8..ca974d61d3f4 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -381,13 +381,6 @@ struct vnt_private {
 	struct ieee80211_low_level_stats low_stats;
 };
 
-#define ADD_ONE_WITH_WRAP_AROUND(var, modulo) {	\
-	if ((var) >= ((modulo) - 1))			\
-		(var) = 0;				\
-	else						\
-		(var)++;				\
-}
-
 int vnt_init(struct vnt_private *priv);
 
 #endif
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index e8ee2fbee76c..14b8aa587119 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -31,6 +31,15 @@ static void vnt_cmd_timer_wait(struct vnt_private *priv, unsigned long msecs)
 	schedule_delayed_work(&priv->run_command_work, msecs_to_jiffies(msecs));
 }
 
+static u32 add_one_with_wrap_around(u32 var, u8 modulo)
+{
+	if (var >= (modulo - 1))
+		var = 0;
+	else
+		var++;
+	return var;
+}
+
 static int vnt_cmd_complete(struct vnt_private *priv)
 {
 	priv->command_state = WLAN_CMD_IDLE;
@@ -42,7 +51,7 @@ static int vnt_cmd_complete(struct vnt_private *priv)
 
 	priv->command = priv->cmd_queue[priv->cmd_dequeue_idx];
 
-	ADD_ONE_WITH_WRAP_AROUND(priv->cmd_dequeue_idx, CMD_Q_SIZE);
+	priv->cmd_dequeue_idx = add_one_with_wrap_around(priv->cmd_dequeue_idx, CMD_Q_SIZE);
 	priv->free_cmd_queue++;
 	priv->cmd_running = true;
 
@@ -157,7 +166,7 @@ int vnt_schedule_command(struct vnt_private *priv, enum vnt_cmd command)
 
 	priv->cmd_queue[priv->cmd_enqueue_idx] = command;
 
-	ADD_ONE_WITH_WRAP_AROUND(priv->cmd_enqueue_idx, CMD_Q_SIZE);
+	priv->cmd_enqueue_idx = add_one_with_wrap_around(priv->cmd_enqueue_idx, CMD_Q_SIZE);
 	priv->free_cmd_queue--;
 
 	if (!priv->cmd_running)
-- 
2.25.1


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

* [PATCH v2 5/6] staging: vt6656: Remove ftrace-like logging
  2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
                   ` (3 preceding siblings ...)
  2022-02-21 21:25 ` [PATCH v2 4/6] staging: vt6656: Change macro to function and moved to better file Philipp Hortmann
@ 2022-02-21 21:25 ` Philipp Hortmann
  2022-02-21 21:25 ` [PATCH v2 6/6] staging: vt6656: Remove unnecessary line breaks Philipp Hortmann
  2022-02-22  5:26 ` [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Dan Carpenter
  6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-02-21 21:25 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

This patch fixes the checkpatch.pl warning like:
WARNING: Unnecessary ftrace-like logging - prefer using ftrace

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1 -> V2: Devided patch into two
---
 drivers/staging/vt6656/rxtx.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index a31947f2620d..5839b34b2e93 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -58,8 +58,6 @@ static struct vnt_usb_send_context
 	struct vnt_usb_send_context *context = NULL;
 	int ii;
 
-	dev_dbg(&priv->usb->dev, "%s\n", __func__);
-
 	for (ii = 0; ii < priv->num_tx_context; ii++) {
 		if (!priv->tx_context[ii])
 			return NULL;
-- 
2.25.1


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

* [PATCH v2 6/6] staging: vt6656: Remove unnecessary line breaks
  2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
                   ` (4 preceding siblings ...)
  2022-02-21 21:25 ` [PATCH v2 5/6] staging: vt6656: Remove ftrace-like logging Philipp Hortmann
@ 2022-02-21 21:25 ` Philipp Hortmann
  2022-02-22  5:26 ` [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Dan Carpenter
  6 siblings, 0 replies; 8+ messages in thread
From: Philipp Hortmann @ 2022-02-21 21:25 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

This patch fixes the checkpatch.pl warning like:
CHECK: Lines should not end with a '('

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
V1 -> V2: Devided patch into two
---
 drivers/staging/vt6656/rxtx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 5839b34b2e93..4d29f8ebb393 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -353,10 +353,8 @@ static bool vnt_fill_txkey(struct vnt_tx_buffer *tx_buffer, struct sk_buff *skb)
 		ether_addr_copy(mic_hdr->addr2, hdr->addr2);
 		ether_addr_copy(mic_hdr->addr3, hdr->addr3);
 
-		mic_hdr->frame_control = cpu_to_le16(
-			le16_to_cpu(hdr->frame_control) & 0xc78f);
-		mic_hdr->seq_ctrl = cpu_to_le16(
-				le16_to_cpu(hdr->seq_ctrl) & 0xf);
+		mic_hdr->frame_control = cpu_to_le16(le16_to_cpu(hdr->frame_control) & 0xc78f);
+		mic_hdr->seq_ctrl = cpu_to_le16(le16_to_cpu(hdr->seq_ctrl) & 0xf);
 
 		if (ieee80211_has_a4(hdr->frame_control))
 			ether_addr_copy(mic_hdr->addr4, hdr->addr4);
-- 
2.25.1


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

* Re: [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function
  2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
                   ` (5 preceding siblings ...)
  2022-02-21 21:25 ` [PATCH v2 6/6] staging: vt6656: Remove unnecessary line breaks Philipp Hortmann
@ 2022-02-22  5:26 ` Dan Carpenter
  6 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2022-02-22  5:26 UTC (permalink / raw)
  To: Philipp Hortmann
  Cc: Forest Bond, Greg Kroah-Hartman, linux-staging, linux-kernel

On Mon, Feb 21, 2022 at 10:24:52PM +0100, Philipp Hortmann wrote:
> Various checkpatch.pl fixes as liste below
> Tested with device VNT6656G6A40
> Transferred this patches over VNT6656G6A40
> 
> v2: Patch #1
>     Changed EN_CFG_PKT_BURST_MO to EN_CFG_PKT_BURST_MD
>     Patch #2
>     Devided into three patches
>     Patch #3
>     Devided into two patches

Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

The one thing per patch rule is slightly complicated and different
maintainers have slightly different lines that they draw.  You could
have merged patches 3 and 4 together and it would have been fine.  But
what you sent is also fine.

regards,
dan carpenter


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

end of thread, other threads:[~2022-02-22  5:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 21:24 [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Philipp Hortmann
2022-02-21 21:24 ` [PATCH v2 1/6] staging: vt6656: Fix CamelCase warnings in mac.h and mac.c Philipp Hortmann
2022-02-21 21:25 ` [PATCH v2 2/6] staging: vt6656: Add comment for locks Philipp Hortmann
2022-02-21 21:25 ` [PATCH v2 3/6] staging: vt6656: Fix CamelCase warnings in macro Philipp Hortmann
2022-02-21 21:25 ` [PATCH v2 4/6] staging: vt6656: Change macro to function and moved to better file Philipp Hortmann
2022-02-21 21:25 ` [PATCH v2 5/6] staging: vt6656: Remove ftrace-like logging Philipp Hortmann
2022-02-21 21:25 ` [PATCH v2 6/6] staging: vt6656: Remove unnecessary line breaks Philipp Hortmann
2022-02-22  5:26 ` [PATCH v2 0/6] staging: vt6656: Fix CamelCase, add comments, change macro to function Dan Carpenter

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).