]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: stmmac_is_jumbo_frm() returns boolean
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 18 Nov 2025 10:01:20 +0000 (10:01 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 19 Nov 2025 16:33:49 +0000 (08:33 -0800)
stmmac_is_jumbo_frm() returns whether the driver considers the frame
size to be a jumbo frame, and thus returns 0/1 values. This is boolean,
so convert it to return a boolean and use false/true instead. Also
convert stmmac_xmit()'s is_jumbo to be bool, which causes several
variables to be repositioned to keep it in reverse Christmas-tree
order.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/E1vLIWW-0000000Ewkl-21Ia@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/chain_mode.c
drivers/net/ethernet/stmicro/stmmac/hwif.h
drivers/net/ethernet/stmicro/stmmac/ring_mode.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index d14b56e5ed40743a29a67f88f548c041655ef70e..120a009c99929914049ebe7bef42644577f56392 100644 (file)
@@ -83,14 +83,13 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
        return entry;
 }
 
-static unsigned int is_jumbo_frm(unsigned int len, int enh_desc)
+static bool is_jumbo_frm(unsigned int len, bool enh_desc)
 {
-       unsigned int ret = 0;
+       bool ret = false;
 
        if ((enh_desc && (len > BUF_SIZE_8KiB)) ||
-           (!enh_desc && (len > BUF_SIZE_2KiB))) {
-               ret = 1;
-       }
+           (!enh_desc && (len > BUF_SIZE_2KiB)))
+               ret = true;
 
        return ret;
 }
index 4953e0fab547e83cb5535692ae2ade6e681fa3c8..f257ce4b6c66e0bbd3180d54ac7f5be934153a6b 100644 (file)
@@ -541,7 +541,7 @@ struct stmmac_rx_queue;
 struct stmmac_mode_ops {
        void (*init) (void *des, dma_addr_t phy_addr, unsigned int size,
                      unsigned int extend_desc);
-       unsigned int (*is_jumbo_frm)(unsigned int len, int ehn_desc);
+       bool (*is_jumbo_frm)(unsigned int len, bool enh_desc);
        int (*jumbo_frm)(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
                         int csum);
        int (*set_16kib_bfsize)(int mtu);
index 039903c424df65e7cb6e6a8888ebfcf15627e229..382d94a3b97209a3787122aa17537985aa55f4e8 100644 (file)
@@ -91,14 +91,9 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
        return entry;
 }
 
-static unsigned int is_jumbo_frm(unsigned int len, int enh_desc)
+static bool is_jumbo_frm(unsigned int len, bool enh_desc)
 {
-       unsigned int ret = 0;
-
-       if (len >= BUF_SIZE_4KiB)
-               ret = 1;
-
-       return ret;
+       return len >= BUF_SIZE_4KiB;
 }
 
 static void refill_desc3(struct stmmac_rx_queue *rx_q, struct dma_desc *p)
index 32edeeef9d8fa3ca0fdeccabafd74c67484c953d..15b0c08ebd8773260ace4172e55030c5aca628c9 100644 (file)
@@ -4583,18 +4583,18 @@ static bool stmmac_has_ip_ethertype(struct sk_buff *skb)
  */
 static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
 {
-       unsigned int first_entry, tx_packets, enh_desc;
+       bool enh_desc, has_vlan, set_ic, is_jumbo = false;
        struct stmmac_priv *priv = netdev_priv(dev);
        unsigned int nopaged_len = skb_headlen(skb);
-       int i, csum_insertion = 0, is_jumbo = 0;
        u32 queue = skb_get_queue_mapping(skb);
        int nfrags = skb_shinfo(skb)->nr_frags;
+       unsigned int first_entry, tx_packets;
        int gso = skb_shinfo(skb)->gso_type;
        struct stmmac_txq_stats *txq_stats;
        struct dma_edesc *tbs_desc = NULL;
        struct dma_desc *desc, *first;
        struct stmmac_tx_queue *tx_q;
-       bool has_vlan, set_ic;
+       int i, csum_insertion = 0;
        int entry, first_tx;
        dma_addr_t des;
        u32 sdu_len;