[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1f1ad21-fb73-4f30-b428-8cec5ff53ed6@bootlin.com>
Date: Tue, 18 Nov 2025 14:59:33 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>
Cc: Alexandre Torgue <alexandre.torgue@...s.st.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@...il.com>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 1/2] net: stmmac: stmmac_is_jumbo_frm() len
should be unsigned
On 18/11/2025 11:01, Russell King (Oracle) wrote:
> stmmac_is_jumbo_frm() and the is_jumbo_frm() methods take skb->len
> which is an unsigned int. Avoid an implicit cast to "int" via the
> method parameter and then incorrectly doing signed comparisons on
> this unsigned value.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
Maxime
> ---
> drivers/net/ethernet/stmicro/stmmac/chain_mode.c | 2 +-
> drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +-
> drivers/net/ethernet/stmicro/stmmac/ring_mode.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
> index fb55efd52240..d14b56e5ed40 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c
> @@ -83,7 +83,7 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
> return entry;
> }
>
> -static unsigned int is_jumbo_frm(int len, int enh_desc)
> +static unsigned int is_jumbo_frm(unsigned int len, int enh_desc)
> {
> unsigned int ret = 0;
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> index d359722100fa..4953e0fab547 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h
> @@ -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) (int len, int ehn_desc);
> + unsigned int (*is_jumbo_frm)(unsigned int len, int ehn_desc);
> int (*jumbo_frm)(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
> int csum);
> int (*set_16kib_bfsize)(int mtu);
> diff --git a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
> index d218412ca832..039903c424df 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c
> @@ -91,7 +91,7 @@ static int jumbo_frm(struct stmmac_tx_queue *tx_q, struct sk_buff *skb,
> return entry;
> }
>
> -static unsigned int is_jumbo_frm(int len, int enh_desc)
> +static unsigned int is_jumbo_frm(unsigned int len, int enh_desc)
> {
> unsigned int ret = 0;
>
Powered by blists - more mailing lists