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: 8b7ac7af3a
Change-Id: Iccd7ae5bdcc3fd77fea126389761cc30c5558315
This commit is contained in:
basamaryan 2025-12-11 02:13:11 -08:00
commit 612434f5cc
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885

View file

@ -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;