From: "David Laight" <redacted>
Date: Fri, 20 Jul 2012 11:32:05 +0100
quoted
- else if (rt->dst.expires - jiffies < INT_MAX)
- expires = rt->dst.expires - jiffies;
+ else if ((long)rt->dst.expires - (long)jiffies > INT_MIN
+ && (long)rt->dst.expires - (long)jiffies <
INT_MAX)
quoted
+ expires = (long)rt->dst.expires - (long)jiffies;
else
- expires = INT_MAX;
+ expires = time_is_after_jiffies(rt->dst.expires) ?
INT_MAX : INT_MIN;
I can't help feeling there is a better way to do this.
Maybe:
long expires = rt->dst.expires - jiffies;
if (expires != (int)expires)
expires = expires > 0 ? INT_MAX : INT_MIN;
Although maybe -INT_MAX instead of INT_MIN.
This patch also does not apply at all to net-next, so needs to be
redone regardless.