[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251119224140.8616-22-david.laight.linux@gmail.com>
Date: Wed, 19 Nov 2025 22:41:17 +0000
From: david.laight.linux@...il.com
To: linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
nic_swsd@...ltek.com,
Paolo Abeni <pabeni@...hat.com>,
David Laight <david.laight.linux@...il.com>
Subject: [PATCH 21/44] drivers/net/ethernet/realtek: use min() instead of min_t()
From: David Laight <david.laight.linux@...il.com>
min_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'.
Use min(a, b) instead as it promotes any 'unsigned int' to 'unsigned long'
and so cannot discard significant bits.
In this case the 'unsigned long' value is small enough that the result
is ok.
Detected by an extra check added to min_t().
Signed-off-by: David Laight <david.laight.linux@...il.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index d18734fe12e4..3e636983df4a 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -4238,8 +4238,7 @@ static unsigned int rtl8125_quirk_udp_padto(struct rtl8169_private *tp,
}
if (trans_data_len < sizeof(struct udphdr))
- padto = max_t(unsigned int, padto,
- len + sizeof(struct udphdr) - trans_data_len);
+ padto = max(padto, len + sizeof(struct udphdr) - trans_data_len);
}
return padto;
--
2.39.5
Powered by blists - more mailing lists