[PKT_SCHED]: PSCHED_TADD() and PSCHED_TADD2() can result,tv_usec >= 1000000
Signed-off-by: Shuya MAEDA <maeda-sxb@necst.nec.co.jp> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3d3a853379
commit
4ee303dfea
@ -169,17 +169,23 @@ psched_tod_diff(int delta_sec, int bound)
|
|||||||
|
|
||||||
#define PSCHED_TADD2(tv, delta, tv_res) \
|
#define PSCHED_TADD2(tv, delta, tv_res) \
|
||||||
({ \
|
({ \
|
||||||
int __delta = (tv).tv_usec + (delta); \
|
int __delta = (delta); \
|
||||||
(tv_res).tv_sec = (tv).tv_sec; \
|
(tv_res) = (tv); \
|
||||||
if (__delta > USEC_PER_SEC) { (tv_res).tv_sec++; __delta -= USEC_PER_SEC; } \
|
while(__delta >= USEC_PER_SEC){ \
|
||||||
|
(tv_res).tv_sec++; \
|
||||||
|
__delta -= USEC_PER_SEC; \
|
||||||
|
} \
|
||||||
(tv_res).tv_usec = __delta; \
|
(tv_res).tv_usec = __delta; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define PSCHED_TADD(tv, delta) \
|
#define PSCHED_TADD(tv, delta) \
|
||||||
({ \
|
({ \
|
||||||
(tv).tv_usec += (delta); \
|
int __delta = (delta); \
|
||||||
if ((tv).tv_usec > USEC_PER_SEC) { (tv).tv_sec++; \
|
while(__delta >= USEC_PER_SEC){ \
|
||||||
(tv).tv_usec -= USEC_PER_SEC; } \
|
(tv).tv_sec++; \
|
||||||
|
__delta -= USEC_PER_SEC; \
|
||||||
|
} \
|
||||||
|
(tv).tv_usec = __delta; \
|
||||||
})
|
})
|
||||||
|
|
||||||
/* Set/check that time is in the "past perfect";
|
/* Set/check that time is in the "past perfect";
|
||||||
|
Loading…
Reference in New Issue
Block a user