Skip to contentSkip to conversation

rtase: Use min() instead of min_t()

PATCH Applied Justin Lai 3 participants 3 messages May 20, 2025 – May 21, 2025

Subsystems (3)
lore
Share & tools
lore

Justin Lai

author maintainer
#0 lore raw

PATCH v3 1/1 rtase: Use min() instead of min_t()

Use min() instead of min_t() to avoid the possibility of casting to the wrong type.

---
v1 -> v2:
- Remove the Fixes tag.

v2 -> v3:
- Nothing has changed, and it simply has been rebased and reposted.

---
 drivers/net/ethernet/realtek/rtase/rtase_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/realtek/rtase/rtase_main.c +2 -2
index 0efe7668e498..4d37217e9a14 100644
@@ -1983,7 +1983,7 @@ static u16 rtase_calc_time_mitigation(u32 time_us)
 	u8 msb, time_count, time_unit;
 	u16 int_miti;
 
-	time_us = min_t(int, time_us, RTASE_MITI_MAX_TIME);
+	time_us = min(time_us, RTASE_MITI_MAX_TIME);
 
 	if (time_us > RTASE_MITI_TIME_COUNT_MASK) {
 		msb = fls(time_us);
@@ -2005,7 +2005,7 @@ static u16 rtase_calc_packet_num_mitigation(u16 pkt_num)
 	u8 msb, pkt_num_count, pkt_num_unit;
 	u16 int_miti;
 
-	pkt_num = min_t(int, pkt_num, RTASE_MITI_MAX_PKT_NUM);
+	pkt_num = min(pkt_num, RTASE_MITI_MAX_PKT_NUM);
 
 	if (pkt_num > 60) {
 		pkt_num_unit = RTASE_MITI_MAX_PKT_NUM_IDX;
Signature · 1 line
2.34.1
#2 lore raw
In reply to Justin Lai
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Tue, 20 May 2025 12:20:31 +0800 you wrote:

Use min() instead of min_t() to avoid the possibility of casting to the wrong type.

---
v1 -> v2:
- Remove the Fixes tag.

[...]

Here is the summary with links:
- [net-next,v3] rtase: Use min() instead of min_t()

    https://git.kernel.org/netdev/net-next/c/f44092606a3f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html