Skip to contentSkip to conversation

staging: vt6655: Fix checkpatch issues

PATCH In review Namrata A Shettar 2 participants 11 messages Sep 18, 2016 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: vt6655: Fix checkpatch issues

Fix multiple checkpatch issues in vt6655 driver files.

Changes in v2:
- Subject line and commit log messages

Namrata A Shettar (4):
staging: vt6655: device_main: Replace NULL comparison with !x
staging: vt6655: device_main: Replace explicit NULL comparison
staging: vt6655: card: Break multiple assignments
staging: vt6655: device_main: Break up multiple assignments

 drivers/staging/vt6655/card.c        | 6 ++++--
 drivers/staging/vt6655/device_main.c | 7 ++++---
 2 files changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/4 staging: vt6655: device_main: Replace NULL comparison with !x

Replace NULL comparison to resolve checkpatch issue.
- x == NULL => !x

---
 drivers/staging/vt6655/device_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +1 -1
index ed12b5c..62418c2 100644
@@ -477,7 +477,7 @@ static bool device_init_rings(struct vnt_private *priv)
 					     CB_MAX_BUF_SIZE,
 					     &priv->tx_bufs_dma0,
 					     GFP_ATOMIC);
-	if (priv->tx0_bufs == NULL) {
+	if (!priv->tx0_bufs) {
 		dev_err(&priv->pcid->dev, "allocate buf dma memory failed\n");
 
 		dma_free_coherent(&priv->pcid->dev,
Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 2/4 staging: vt6655: device_main: Replace explicit NULL comparison

In reply to Namrata A Shettar

Replace NULL comparison to resolve checkpatch issue.
- x == NULL => !x

---
 drivers/staging/vt6655/device_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +1 -1
index 62418c2..f109eea 100644
@@ -735,7 +735,7 @@ static bool device_alloc_rx_buf(struct vnt_private *priv,
 	struct vnt_rd_info *rd_info = rd->rd_info;
 
 	rd_info->skb = dev_alloc_skb((int)priv->rx_buf_sz);
-	if (rd_info->skb == NULL)
+	if (!rd_info->skb)
 		return false;
 
 	rd_info->skb_dma =
Signature · 1 line
2.7.4
#3 lore raw

PATCH v2 3/4 staging: vt6655: card: Break multiple assignments

In reply to Namrata A Shettar

Break multiple assignments on same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/card.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/vt6655/card.c +4 -2
index afb1e8b..00e7858 100644
@@ -528,8 +528,10 @@ CARDvSafeResetTx(
 	struct vnt_tx_desc *pCurrTD;
 
 	/* initialize TD index */
-	priv->apTailTD[0] = priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+        priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
+	priv->apTailTD[0] = priv->apCurrTD[0];
+        priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+	priv->apTailTD[1] = priv->apCurrTD[1];
 
 	for (uu = 0; uu < TYPE_MAXTD; uu++)
 		priv->iTDUsed[uu] = 0;
Signature · 1 line
2.7.4
#4 lore raw

Re: [PATCH v2 3/4] staging: vt6655: card: Break multiple assignments

Quoted 12 lines · Namrata A Shettar

Break multiple assignments on same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/card.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/vt6655/card.c +0 -0
index afb1e8b..00e7858 100644

drivers/staging/vt6655/card.c CARDvSafeResetTx( · line 534

Quoted 9 lines
drivers/staging/vt6655/card.c +4 -2
@@ -528,8 +528,10 @@ CARDvSafeResetTx(
 	struct vnt_tx_desc *pCurrTD;
 
 	/* initialize TD index */
-	priv->apTailTD[0] = priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+        priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
+	priv->apTailTD[0] = priv->apCurrTD[0];
+        priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+	priv->apTailTD[1] = priv->apCurrTD[1];

Does that look correct to you?

(hint, odd indentation)

And really, the original code is fine, I would recommend just leaving this alone, it makes more sense as-is, don't you think?

thanks,

greg k-h

#5 lore raw

Re: [PATCH v2 3/4] staging: vt6655: card: Break multiple assignments

Quoted 25 lines · Greg Kroah-Hartman
Quoted 12 lines · Namrata A Shettar

Break multiple assignments on same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/card.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/vt6655/card.c +0 -0
index afb1e8b..00e7858 100644

drivers/staging/vt6655/card.c CARDvSafeResetTx( · line 534

Quoted 9 lines
drivers/staging/vt6655/card.c +4 -2
@@ -528,8 +528,10 @@ CARDvSafeResetTx(
 	struct vnt_tx_desc *pCurrTD;
 
 	/* initialize TD index */
-	priv->apTailTD[0] = priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+        priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
+	priv->apTailTD[0] = priv->apCurrTD[0];
+        priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+	priv->apTailTD[1] = priv->apCurrTD[1];

Does that look correct to you?

Quoted 8 lines

(hint, odd indentation)

And really, the original code is fine, I would recommend just leaving this alone, it makes more sense as-is, don't you think?

thanks,

greg k-h

Does this hold true for any multiple assignments warning by running checkpatch.pl? or is it only for the change that has been made here?

thanks,

namrata

#6 lore raw

Re: [Outreachy kernel] Re: [PATCH v2 3/4] staging: vt6655: card: Break multiple assignments

Quoted 31 lines · Namrata A Shettar
Quoted 30 lines · Greg Kroah-Hartman
Quoted 12 lines · Namrata A Shettar

Break multiple assignments on same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/card.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/vt6655/card.c +0 -0
index afb1e8b..00e7858 100644

drivers/staging/vt6655/card.c CARDvSafeResetTx( · line 534

Quoted 9 lines
drivers/staging/vt6655/card.c +4 -2
@@ -528,8 +528,10 @@ CARDvSafeResetTx(
 	struct vnt_tx_desc *pCurrTD;
 
 	/* initialize TD index */
-	priv->apTailTD[0] = priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+        priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
+	priv->apTailTD[0] = priv->apCurrTD[0];
+        priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+	priv->apTailTD[1] = priv->apCurrTD[1];

Does that look correct to you?

(hint, odd indentation)

And really, the original code is fine, I would recommend just leaving this alone, it makes more sense as-is, don't you think?

Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

Does this hold true for any multiple assignments warning by running checkpatch.pl? or is it only for the change that has been made here?

Use your best judgement :)

#7 lore raw

Re: [Outreachy kernel] Re: [PATCH v2 3/4] staging: vt6655: card: Break multiple assignments

Quoted 32 lines · Greg Kroah-Hartman
Quoted 31 lines · Namrata A Shettar
Quoted 30 lines · Greg Kroah-Hartman
Quoted 12 lines · Namrata A Shettar

Break multiple assignments on same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/card.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/staging/vt6655/card.c +0 -0
index afb1e8b..00e7858 100644

drivers/staging/vt6655/card.c CARDvSafeResetTx( · line 534

Quoted 9 lines
drivers/staging/vt6655/card.c +4 -2
@@ -528,8 +528,10 @@ CARDvSafeResetTx(
 	struct vnt_tx_desc *pCurrTD;
 
 	/* initialize TD index */
-	priv->apTailTD[0] = priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+        priv->apCurrTD[0] = &(priv->apTD0Rings[0]);
+	priv->apTailTD[0] = priv->apCurrTD[0];
+        priv->apCurrTD[1] = &(priv->apTD1Rings[0]);
+	priv->apTailTD[1] = priv->apCurrTD[1];

Does that look correct to you?

(hint, odd indentation)

And really, the original code is fine, I would recommend just leaving this alone, it makes more sense as-is, don't you think?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

Does this hold true for any multiple assignments warning by running checkpatch.pl? or is it only for the change that has been made here?

Use your best judgement :)

Alright! Thanks :)

#8 lore raw

PATCH v2 4/4 staging: vt6655: device_main: Break up multiple assignments

In reply to Namrata A Shettar

Break up multiple assignments on the same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +2 -1
index f109eea..86532ca 100644
@@ -669,7 +669,8 @@ static void device_init_td1_ring(struct vnt_private *priv)
 
 	if (i > 0)
 		priv->apTD1Rings[i-1].next_desc = cpu_to_le32(priv->td1_pool_dma);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &priv->apTD1Rings[0];
+	 priv->apCurrTD[1] = &priv->apTD1Rings[0];
+	 priv->apTailTD[1] = priv->apCurrTD[1];
 }
 
 static void device_free_td0_ring(struct vnt_private *priv)
Signature · 1 line
2.7.4
#9 lore raw

Re: [PATCH v2 4/4] staging: vt6655: device_main: Break up multiple assignments

Quoted 13 lines · Namrata A Shettar

Break up multiple assignments on the same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +0 -0
index f109eea..86532ca 100644

drivers/staging/vt6655/device_main.c static void device_init_td1_ring(struct vnt_private *priv) · line 673

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
@@ -669,7 +669,8 @@ static void device_init_td1_ring(struct vnt_private *priv)
 
 	if (i > 0)
 		priv->apTD1Rings[i-1].next_desc = cpu_to_le32(priv->td1_pool_dma);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &priv->apTD1Rings[0];
+	 priv->apCurrTD[1] = &priv->apTD1Rings[0];
+	 priv->apTailTD[1] = priv->apCurrTD[1];

Same problem here, please be careful with your indentation, always run your patches through checkpatch.pl before sending them out so that people don't have to remind you to run your patches through checkpatch.pl before sending them out.

thanks,

greg k-h

#10 lore raw

Re: [PATCH v2 4/4] staging: vt6655: device_main: Break up multiple assignments

Quoted 26 lines · Greg Kroah-Hartman
Quoted 13 lines · Namrata A Shettar

Break up multiple assignments on the same line to resolve checkpatch issue.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +0 -0
index f109eea..86532ca 100644

drivers/staging/vt6655/device_main.c static void device_init_td1_ring(struct vnt_private *priv) · line 673

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
@@ -669,7 +669,8 @@ static void device_init_td1_ring(struct vnt_private *priv)
 
 	if (i > 0)
 		priv->apTD1Rings[i-1].next_desc = cpu_to_le32(priv->td1_pool_dma);
-	priv->apTailTD[1] = priv->apCurrTD[1] = &priv->apTD1Rings[0];
+	 priv->apCurrTD[1] = &priv->apTD1Rings[0];
+	 priv->apTailTD[1] = priv->apCurrTD[1];

Same problem here, please be careful with your indentation, always run your patches through checkpatch.pl before sending them out so that people don't have to remind you to run your patches through checkpatch.pl before sending them out.

Quoted 3 lines

thanks,

greg k-h

Really sorry for that :/ Will be more careful the next time around.

thanks,

namrata