]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: simplify atds initialisation
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 27 Feb 2026 09:54:10 +0000 (09:54 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2026 02:35:06 +0000 (18:35 -0800)
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@armlinux.org.uk>
Link: https://patch.msgid.link/E1vvuXy-0000000Avnk-10Q8@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 027b566bb9c0391b612055bbf87a12dd5d95aa33..1a054453d05eb7772c15ce8d508f15cdb36f1516 100644 (file)
@@ -7443,10 +7443,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