From 612434f5cc3e32a12f0fae604bf1004aff0271f7 Mon Sep 17 00:00:00 2001 From: basamaryan Date: Thu, 11 Dec 2025 02:13:11 -0800 Subject: [PATCH] tcp: Fix compiler error due to type confusion tcp_tso_should_defer() used the min() macro on incompatible types (u64 vs long) error: comparison of distinct pointer types ('typeof (srtt_in_ns >> 1) *' (aka 'unsigned long long *') and 'typeof (1000000L) *' (aka 'long *')) Fix this up by using min_t to ensure the comparison is performed as unsigned 64-bit integers Fixes: 8b7ac7af3a6664d707cb451c1cac5d9444977815 Change-Id: Iccd7ae5bdcc3fd77fea126389761cc30c5558315 --- net/ipv4/tcp_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 7d9a4fcf2330..87b82164451c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2025,7 +2025,7 @@ static bool tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb, /* If next ACK is likely to come too late, * ie in more than min(1ms, half srtt), do not defer. */ - threshold = min(srtt_in_ns >> 1, NSEC_PER_MSEC); + threshold = min_t(u64, srtt_in_ns >> 1, NSEC_PER_MSEC); if ((s64)(how_far_is_the_ack - threshold) > 0) goto send_now;