lkml.org 
[lkml]   [2018]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [net-next, 1/3] tcp: convert icsk_user_timeout from jiffies to msecs
On Thu, Jul 12, 2018 at 1:57 AM David Laight <David.Laight@aculab.com> wrote:
>
> From: Jon Maxwell Sent: 12 July 2018 01:36
> ...
> > - (s32)(tcp_time_stamp(tp) - start_ts) >
> > - jiffies_to_msecs(icsk->icsk_user_timeout))
> > + (s32)(tcp_time_stamp(tp) - start_ts) > icsk->icsk_user_timeout)
>
> That has never been tested properly.
> icsk_user_timeout is u32 so the comparison is unsigned and the (s32) cast
> has no effect.
>

The existing code had this ' bug' already.

Please do not blame this patch, and send a patch if you believe there
is an issue ?

In my opinion, the (s32) here is a reminder for the reader of the
width of the expression,
more than anything, since there is no chance the result can be negative.
\
 
 \ /
  Last update: 2018-07-15 22:05    [W:0.036 / U:3.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site