]> www.infradead.org Git - users/hch/misc.git/commitdiff
net: stmmac: mostly remove "buf_sz"
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 5 Mar 2025 17:54:21 +0000 (17:54 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Mar 2025 23:35:16 +0000 (15:35 -0800)
The "buf_sz" parameter is not used in the stmmac driver - there is one
place where the value of buf_sz is validated, and two places where it
is written. It is otherwise unused.

Remove these accesses. However, leave the module parameter in place as
removing it could cause module load to fail, breaking user setups.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Furong Xu <0x1207@gmail.com>
Link: https://patch.msgid.link/E1tpswn-005U6I-TU@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 1a928e21b28659e3322bd6c9b4f81b0390c5453a..7f1421b9983fd8103329a47b5f30d59831ed41a1 100644 (file)
@@ -101,6 +101,7 @@ static int tc = TC_DEFAULT;
 module_param(tc, int, 0644);
 MODULE_PARM_DESC(tc, "DMA threshold control value");
 
+/* This is unused */
 #define        DEFAULT_BUFSIZE 1536
 static int buf_sz = DEFAULT_BUFSIZE;
 module_param(buf_sz, int, 0644);
@@ -218,8 +219,6 @@ static void stmmac_verify_args(void)
 {
        if (unlikely(watchdog < 0))
                watchdog = TX_TIMEO;
-       if (unlikely((buf_sz < DEFAULT_BUFSIZE) || (buf_sz > BUF_SIZE_16KiB)))
-               buf_sz = DEFAULT_BUFSIZE;
        if (unlikely((pause < 0) || (pause > 0xffff)))
                pause = PAUSE_TIME;
 
@@ -4028,7 +4027,6 @@ static int __stmmac_open(struct net_device *dev,
                }
        }
 
-       buf_sz = dma_conf->dma_buf_sz;
        for (int i = 0; i < MTL_MAX_TX_QUEUES; i++)
                if (priv->dma_conf.tx_queue[i].tbs & STMMAC_TBS_EN)
                        dma_conf->tx_queue[i].tbs = priv->dma_conf.tx_queue[i].tbs;
@@ -7989,9 +7987,6 @@ static int __init stmmac_cmdline_opt(char *str)
                } else if (!strncmp(opt, "phyaddr:", 8)) {
                        if (kstrtoint(opt + 8, 0, &phyaddr))
                                goto err;
-               } else if (!strncmp(opt, "buf_sz:", 7)) {
-                       if (kstrtoint(opt + 7, 0, &buf_sz))
-                               goto err;
                } else if (!strncmp(opt, "tc:", 3)) {
                        if (kstrtoint(opt + 3, 0, &tc))
                                goto err;