Commit 80f9a35d authored by Alexey Kuznetsov's avatar Alexey Kuznetsov Committed by David S. Miller

Make pkt_sched.h:PSCHED_TDIFF_SAFE behave sane when measuring

large time intervals.
parent bc450c1e
...@@ -358,8 +358,8 @@ extern int psched_tod_diff(int delta_sec, int bound); ...@@ -358,8 +358,8 @@ extern int psched_tod_diff(int delta_sec, int bound);
#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2)) #define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
#define PSCHED_TDIFF_SAFE(tv1, tv2, bound, guard) \ #define PSCHED_TDIFF_SAFE(tv1, tv2, bound, guard) \
({ \ ({ \
long __delta = (tv1) - (tv2); \ long long __delta = (tv1) - (tv2); \
if ( __delta > (bound)) { __delta = (bound); guard; } \ if ( __delta > (long long)(bound)) { __delta = (bound); guard; } \
__delta; \ __delta; \
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment