[PATCH net-next 13/14] net: stmmac: simplify atds initialisation

Russell King (Oracle) rmk+kernel at armlinux.org.uk
Fri Feb 27 01:54:10 PST 2026


atds is boolean, and there is only one place that its value is changed.
Simplify this to a boolean assignment.

Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 38f6b890ec37..a9b26d12a057 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7448,10 +7448,11 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
 
 	/* Set alternate descriptor size (which tells the hardware that
 	 * descriptors are 8 32-bit words) when using extended descriptors
-	 * with ring mode. Only applicable for pre-v4.0 cores.
+	 * with ring mode. Only applicable for pre-v4.0 cores. Platform glue
+	 * is not expected to change this.
 	 */
-	if (priv->extend_desc && priv->mode == STMMAC_RING_MODE)
-		priv->plat->dma_cfg->atds = 1;
+	priv->plat->dma_cfg->atds = priv->extend_desc &&
+				    priv->mode == STMMAC_RING_MODE;
 
 	/* Rx Watchdog is available in the COREs newer than the 3.40.
 	 * In some case, for example on bugged HW this feature
-- 
2.47.3




More information about the linux-arm-kernel mailing list