]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: convert plat_stmmacenet_data booleans to type bool
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 9 Mar 2026 09:39:23 +0000 (09:39 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Mar 2026 02:54:06 +0000 (19:54 -0700)
Convert members of struct plat_stmmacenet_data that are booleans to
type 'bool' and ensure their initialisers are true/false. Move the
has_xxx for the GMAC cores together, and move the COE members to the
end of the list of bool to avoid unused holes in the struct.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Link: https://patch.msgid.link/E1vzX59-0000000CVs2-3MHc@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
14 files changed:
drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
include/linux/stmmac.h

index 0495437d3a6e98ac2f1400a3c92c93d469bf9d1a..b0c5d1ecabcec4236afdc7b44ddfe1a8cff33b04 100644 (file)
@@ -88,7 +88,7 @@ static int dwc_eth_dwmac_config_dt(struct platform_device *pdev,
        plat_dat->core_type = DWMAC_CORE_GMAC4;
        plat_dat->dma_cfg->aal = 1;
        plat_dat->flags |= STMMAC_FLAG_TSO_EN;
-       plat_dat->pmt = 1;
+       plat_dat->pmt = true;
 
        return 0;
 }
index 0b32560cd059de430ec7597351f5c82c15a031a3..421c6c81ca5ebef3cfeeddefe5035c6818b9235a 100644 (file)
@@ -566,7 +566,7 @@ static void common_default_data(struct plat_stmmacenet_data *plat)
        /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
        plat->clk_csr = STMMAC_CSR_20_35M;
        plat->core_type = DWMAC_CORE_GMAC;
-       plat->force_sf_dma_mode = 1;
+       plat->force_sf_dma_mode = true;
 
        plat->mdio_bus_data->needs_reset = true;
 }
index 51b1562f84d1dfc7f0c43b66cc5fa1987678483a..eb14c197d6aef8b71e2adecea10936a7e9493504 100644 (file)
@@ -94,7 +94,7 @@ static void loongson_default_data(struct pci_dev *pdev,
        /* clk_csr_i = 100-150MHz & MDC = clk_csr_i/62 */
        plat->clk_csr = STMMAC_CSR_100_150M;
        plat->core_type = DWMAC_CORE_GMAC;
-       plat->force_sf_dma_mode = 1;
+       plat->force_sf_dma_mode = true;
 
        /* Increase the default value for multicast hash bins */
        plat->multicast_filter_bins = 256;
index 1f2d7d19ca56e797b8b74c9b032f739ddd48e24d..a139db6a8cbb3188b179648cd496cd718e90f1dd 100644 (file)
@@ -564,7 +564,7 @@ static int mediatek_dwmac_common_data(struct platform_device *pdev,
                plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL;
        else
                plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
-       plat->riwt_off = 1;
+       plat->riwt_off = true;
        plat->maxmtu = ETH_DATA_LEN;
        plat->host_dma_width = priv_plat->variant->dma_bit_mask;
        plat->bsp_priv = priv_plat;
index cb1c074c205307bca556192584fb0a4a10eecd47..388e9fdeb86cda87517fbfefe09b9b96000b3cbe 100644 (file)
@@ -817,7 +817,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
        plat_dat->core_type = DWMAC_CORE_GMAC4;
        if (ethqos->has_emac_ge_3)
                plat_dat->dwmac4_addrs = &data->dwmac4_addrs;
-       plat_dat->pmt = 1;
+       plat_dat->pmt = true;
        if (of_property_read_bool(np, "snps,tso"))
                plat_dat->flags |= STMMAC_FLAG_TSO_EN;
        if (of_device_is_compatible(np, "qcom,qcs404-ethqos"))
index af594a09667651f7306a226ada5e175e6b09c1ff..48fceadc55b12351a7021d7dfecb5af9ef7a8bf7 100644 (file)
@@ -163,7 +163,7 @@ static int s32_dwmac_probe(struct platform_device *pdev)
 
        /* S32CC core feature set */
        plat->core_type = DWMAC_CORE_GMAC4;
-       plat->pmt = 1;
+       plat->pmt = true;
        plat->flags |= STMMAC_FLAG_SPH_DISABLE;
        plat->rx_fifo_size = 20480;
        plat->tx_fifo_size = 20480;
index c6b99814d391fed2387eb86e74536230f181a03d..5f89fd968ae94e27b33d0d089ba51d37456c64d5 100644 (file)
@@ -565,7 +565,7 @@ static void socfpga_gen5_setup_plat_dat(struct socfpga_dwmac *dwmac)
        plat_dat->core_type = DWMAC_CORE_GMAC;
 
        /* Rx watchdog timer in dwmac is buggy in this hw */
-       plat_dat->riwt_off = 1;
+       plat_dat->riwt_off = true;
 }
 
 static void socfpga_agilex5_setup_plat_dat(struct socfpga_dwmac *dwmac)
index 3ce03b059277917795ee3559d61c13c695c7d0a2..6dbe5d5a32240a9c1e788fe35fcb5a40de23c9ef 100644 (file)
@@ -1179,7 +1179,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
         * hardware features were copied from Allwinner drivers.
         */
        plat_dat->rx_coe = STMMAC_RX_COE_TYPE2;
-       plat_dat->tx_coe = 1;
+       plat_dat->tx_coe = true;
        plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I;
        plat_dat->bsp_priv = gmac;
        plat_dat->init = sun8i_dwmac_init;
index 52593ba3a3a317e3d99f943e1ef654808b824f74..74bd996d93c90afa4b2b2ce223c9196846e55aa0 100644 (file)
@@ -135,7 +135,7 @@ static int sun7i_gmac_probe(struct platform_device *pdev)
 
        /* platform data specifying hardware features and callbacks.
         * hardware features were copied from Allwinner drivers. */
-       plat_dat->tx_coe = 1;
+       plat_dat->tx_coe = true;
        plat_dat->core_type = DWMAC_CORE_GMAC;
        plat_dat->bsp_priv = gmac;
        plat_dat->init = sun7i_gmac_init;
index d765acbe375481312c5595856ec390fc13236b44..b4b39e6a169e41f378c5455987d9e8adab3b8ae6 100644 (file)
@@ -310,7 +310,7 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
 
        plat->core_type = DWMAC_CORE_XGMAC;
        plat->flags |= STMMAC_FLAG_TSO_EN;
-       plat->pmt = 1;
+       plat->pmt = true;
        plat->bsp_priv = mgbe;
 
        if (!plat->mdio_node)
index 87f43811faa0112612a907385a66dc0ad844b1b0..939431255fa5086639ad24c43ee47d980b07f8ca 100644 (file)
@@ -7401,7 +7401,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
 
                /* TXCOE doesn't work in thresh DMA mode */
                if (priv->plat->force_thresh_dma_mode)
-                       priv->plat->tx_coe = 0;
+                       priv->plat->tx_coe = false;
                else
                        priv->plat->tx_coe = priv->dma_cap.tx_coe;
 
index 836fed7d60ab3b2927b0a6c84934db715c1bc7a4..d584fd2daa6f15cfaa18f876863a4eaffd0946b2 100644 (file)
@@ -25,7 +25,7 @@ static void common_default_data(struct plat_stmmacenet_data *plat)
        /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */
        plat->clk_csr = STMMAC_CSR_20_35M;
        plat->core_type = DWMAC_CORE_GMAC;
-       plat->force_sf_dma_mode = 1;
+       plat->force_sf_dma_mode = true;
 
        plat->mdio_bus_data->needs_reset = true;
 }
@@ -58,9 +58,9 @@ static int snps_gmac5_default_data(struct pci_dev *pdev,
 
        plat->clk_csr = STMMAC_CSR_250_300M;
        plat->core_type = DWMAC_CORE_GMAC4;
-       plat->force_sf_dma_mode = 1;
+       plat->force_sf_dma_mode = true;
        plat->flags |= STMMAC_FLAG_TSO_EN;
-       plat->pmt = 1;
+       plat->pmt = true;
 
        /* Set default number of RX and TX queues to use */
        plat->tx_queues_to_use = 4;
index 1aed48fe0db6c7bb2f943ac1a1aea57b544a5233..0d3bad0f8915e10f7e10c326be50e6823fd3b2a5 100644 (file)
@@ -514,34 +514,34 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
                plat->multicast_filter_bins = dwmac1000_validate_mcast_bins(
                                &pdev->dev, plat->multicast_filter_bins);
                plat->core_type = DWMAC_CORE_GMAC;
-               plat->pmt = 1;
+               plat->pmt = true;
        }
 
        if (of_device_is_compatible(np, "snps,dwmac-3.40a")) {
                plat->core_type = DWMAC_CORE_GMAC;
-               plat->enh_desc = 1;
-               plat->tx_coe = 1;
-               plat->bugged_jumbo = 1;
-               plat->pmt = 1;
+               plat->enh_desc = true;
+               plat->tx_coe = true;
+               plat->bugged_jumbo = true;
+               plat->pmt = true;
        }
 
        if (of_device_compatible_match(np, stmmac_gmac4_compats)) {
                plat->core_type = DWMAC_CORE_GMAC4;
-               plat->pmt = 1;
+               plat->pmt = true;
                if (of_property_read_bool(np, "snps,tso"))
                        plat->flags |= STMMAC_FLAG_TSO_EN;
        }
 
        if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
                of_device_is_compatible(np, "snps,dwmac-3.710")) {
-               plat->enh_desc = 1;
-               plat->bugged_jumbo = 1;
-               plat->force_sf_dma_mode = 1;
+               plat->enh_desc = true;
+               plat->bugged_jumbo = true;
+               plat->force_sf_dma_mode = true;
        }
 
        if (of_device_is_compatible(np, "snps,dwxgmac")) {
                plat->core_type = DWMAC_CORE_XGMAC;
-               plat->pmt = 1;
+               plat->pmt = true;
                if (of_property_read_bool(np, "snps,tso"))
                        plat->flags |= STMMAC_FLAG_TSO_EN;
                of_property_read_u32(np, "snps,multicast-filter-bins",
index 919196713c05a94c638607f28e7507fa0f6e71ec..9420da96a4ff2f88d7c222629195fb8782be2c3f 100644 (file)
@@ -229,14 +229,14 @@ struct plat_stmmacenet_data {
        struct stmmac_dma_cfg *dma_cfg;
        struct stmmac_safety_feature_cfg *safety_feat_cfg;
        int clk_csr;
-       int enh_desc;
-       int tx_coe;
+       bool enh_desc;
+       bool tx_coe;
+       bool bugged_jumbo;
+       bool pmt;
+       bool force_sf_dma_mode;
+       bool force_thresh_dma_mode;
+       bool riwt_off;
        int rx_coe;
-       int bugged_jumbo;
-       int pmt;
-       int force_sf_dma_mode;
-       int force_thresh_dma_mode;
-       int riwt_off;
        int max_speed;
        int maxmtu;
        int multicast_filter_bins;