Skip to contentSkip to conversation

staging: vt6655: Break multiple assignments in one line

PATCH In review Marcos Antonio de Jesus Filho 3 participants 3 messages Oct 25, 2020 – Oct 27, 2020 Staging

lore
Share & tools
lore
#1 lore raw
In reply to Marcos Antonio de Jesus Filho
Quoted 15 lines · Marcos Antonio de Jesus Filho

The kernel coding style disencourage multiple assignments in one line. Split this multiple assignments in one line into single assignments in multiple lines following this recommendation. Issue found by checkpatch.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +0 -0
index 09ab6d6f2429..ec73b4ac82e6 100644

drivers/staging/vt6655/device_main.c static int device_init_td0_ring(struct vnt_private *priv) · line 674

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
@@ -670,7 +670,8 @@ static int device_init_td0_ring(struct vnt_private *priv)
 
 	if (i > 0)
 		priv->apTD0Rings[i - 1].next_desc = cpu_to_le32(priv->td0_pool_dma);
-	priv->apTailTD[0] = priv->apCurrTD[0] = &priv->apTD0Rings[0];
+	priv->apCurrTD[0] = &priv->apTD0Rings[0];
+	priv->apTailTD[0] = priv->apCurrTD[0];

The original here is fine, you can ignore this checkpatch warning here.

thanks,

greg k-h

#0 lore raw

PATCH 1/1 staging: vt6655: Break multiple assignments in one line

The kernel coding style disencourage multiple assignments in one line. Split this multiple assignments in one line into single assignments in multiple lines following this recommendation. Issue found by checkpatch.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +2 -1
index 09ab6d6f2429..ec73b4ac82e6 100644
@@ -670,7 +670,8 @@ static int device_init_td0_ring(struct vnt_private *priv)
 
 	if (i > 0)
 		priv->apTD0Rings[i - 1].next_desc = cpu_to_le32(priv->td0_pool_dma);
-	priv->apTailTD[0] = priv->apCurrTD[0] = &priv->apTD0Rings[0];
+	priv->apCurrTD[0] = &priv->apTD0Rings[0];
+	priv->apTailTD[0] = priv->apCurrTD[0];
 
 	return 0;
 
Signature · 1 line
2.28.0
#2 lore raw
Quoted 15 lines · Marcos Antonio de Jesus Filho

The kernel coding style disencourage multiple assignments in one line. Split this multiple assignments in one line into single assignments in multiple lines following this recommendation. Issue found by checkpatch.

---
 drivers/staging/vt6655/device_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/vt6655/device_main.c +0 -0
index 09ab6d6f2429..ec73b4ac82e6 100644

drivers/staging/vt6655/device_main.c static int device_init_td0_ring(struct vnt_private *priv) · line 674

Quoted 6 lines
drivers/staging/vt6655/device_main.c +2 -1
@@ -670,7 +670,8 @@ static int device_init_td0_ring(struct vnt_private *priv)
 
 	if (i > 0)
 		priv->apTD0Rings[i - 1].next_desc = cpu_to_le32(priv->td0_pool_dma);
-	priv->apTailTD[0] = priv->apCurrTD[0] = &priv->apTD0Rings[0];
+	priv->apCurrTD[0] = &priv->apTD0Rings[0];
+	priv->apTailTD[0] = priv->apCurrTD[0];

I think this was already tried and Greg already expressed the opinion that in this case the code is ok as it.

It might have something to do with the fact that all of the elements have about the same size, which makes it a bit easier to see what is going on.

julia

Quoted 11 lines
drivers/staging/vt6655/device_main.c +0 -1
 	return 0;
 
--

2.28.0

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20201025032331.GA9095%40Zangetsu.