diff options
-rw-r--r-- | include/net/pkt_sched.h | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 1925c65e617b..f6afee73235d 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -169,23 +169,17 @@ psched_tod_diff(int delta_sec, int bound) | |||
169 | 169 | ||
170 | #define PSCHED_TADD2(tv, delta, tv_res) \ | 170 | #define PSCHED_TADD2(tv, delta, tv_res) \ |
171 | ({ \ | 171 | ({ \ |
172 | int __delta = (delta); \ | 172 | int __delta = (tv).tv_usec + (delta); \ |
173 | (tv_res) = (tv); \ | 173 | (tv_res).tv_sec = (tv).tv_sec; \ |
174 | while(__delta >= USEC_PER_SEC){ \ | 174 | while (__delta >= USEC_PER_SEC) { (tv_res).tv_sec++; __delta -= USEC_PER_SEC; } \ |
175 | (tv_res).tv_sec++; \ | ||
176 | __delta -= USEC_PER_SEC; \ | ||
177 | } \ | ||
178 | (tv_res).tv_usec = __delta; \ | 175 | (tv_res).tv_usec = __delta; \ |
179 | }) | 176 | }) |
180 | 177 | ||
181 | #define PSCHED_TADD(tv, delta) \ | 178 | #define PSCHED_TADD(tv, delta) \ |
182 | ({ \ | 179 | ({ \ |
183 | int __delta = (delta); \ | 180 | (tv).tv_usec += (delta); \ |
184 | while(__delta >= USEC_PER_SEC){ \ | 181 | while ((tv).tv_usec >= USEC_PER_SEC) { (tv).tv_sec++; \ |
185 | (tv).tv_sec++; \ | 182 | (tv).tv_usec -= USEC_PER_SEC; } \ |
186 | __delta -= USEC_PER_SEC; \ | ||
187 | } \ | ||
188 | (tv).tv_usec = __delta; \ | ||
189 | }) | 183 | }) |
190 | 184 | ||
191 | /* Set/check that time is in the "past perfect"; | 185 | /* Set/check that time is in the "past perfect"; |