Skip to contentSkip to conversation

Staging: fsl-dpaa2: ethernet: dpaa2-eth.c: Multiple assignments should be avoided.

PATCH In review Srishti Sharma 2 participants 3 messages Aug 19, 2017 – Aug 20, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: fsl-dpaa2: ethernet: dpaa2-eth.c: Multiple assignments should be avoided.

Fixed a check reported by checkpatch.pl to avoid multiple assignments in a single statement.

---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +2 -1
index 26017fe..75e3366 100644
@@ -1636,7 +1636,8 @@ static void set_fq_affinity(struct dpaa2_eth_priv *priv)
 	 * This may well change at runtime, either through irqbalance or
 	 * through direct user intervention.
 	 */
-	rx_cpu = txc_cpu = cpumask_first(&priv->dpio_cpumask);
+	rx_cpu = cpumask_first(&priv->dpio_cpumask);
+	txc_cpu = cpumask_first(&priv->dpio_cpumask);
 
 	for (i = 0; i < priv->num_fqs; i++) {
 		fq = &priv->fq[i];

--
2.7.4

maintainer
#1 lore raw
Quoted 1 line · Srishti Sharma

Fixed a check reported by checkpatch.pl to avoid multiple assignments in a single statement.

Always wrap your changelog text at 72 columns please.

Quoted 11 lines
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +0 -0
index 26017fe..75e3366 100644

drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c static void set_fq_affinity(struct dpaa2_eth_priv *priv) · line 1640

Quoted 6 lines
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +2 -1
@@ -1636,7 +1636,8 @@ static void set_fq_affinity(struct dpaa2_eth_priv *priv)
 	 * This may well change at runtime, either through irqbalance or
 	 * through direct user intervention.
 	 */
-	rx_cpu = txc_cpu = cpumask_first(&priv->dpio_cpumask);
+	rx_cpu = cpumask_first(&priv->dpio_cpumask);
+	txc_cpu = cpumask_first(&priv->dpio_cpumask);

The original code is nicer, as you don't have to do the computation twice.

thanks,

greg k-h

#2 lore raw
Quoted 26 lines · Greg KH
Quoted 1 line · Srishti Sharma

Fixed a check reported by checkpatch.pl to avoid multiple assignments in a single statement.

Always wrap your changelog text at 72 columns please.

Quoted 11 lines
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +0 -0
index 26017fe..75e3366 100644

drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c static void set_fq_affinity(struct dpaa2_eth_priv *priv) · line 1640

Quoted 6 lines
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +2 -1
@@ -1636,7 +1636,8 @@ static void set_fq_affinity(struct dpaa2_eth_priv *priv)
       * This may well change at runtime, either through irqbalance or
       * through direct user intervention.
       */
-     rx_cpu = txc_cpu = cpumask_first(&priv->dpio_cpumask);
+     rx_cpu = cpumask_first(&priv->dpio_cpumask);
+     txc_cpu = cpumask_first(&priv->dpio_cpumask);

The original code is nicer, as you don't have to do the computation twice.

Quoted 3 lines

thanks,

greg k-h

Okay, Thanks :)

Regards,
Srishti