From: Balbir Singh 1. Change the interface of timespec_sub() to return by value and rename the arguments. Use lhs,rhs instead of end,start. 2. Pass the arguments by value Signed-off-by: Balbir Singh Cc: Shailabh Nagar Cc: Jes Sorensen Cc: Peter Chubb Cc: Erich Focht Cc: Levent Serinol Cc: Jay Lan Signed-off-by: Andrew Morton --- include/linux/time.h | 12 +++++++----- kernel/delayacct.c | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff -puN include/linux/time.h~per-task-delay-accounting-setup-fix-1 include/linux/time.h --- devel/include/linux/time.h~per-task-delay-accounting-setup-fix-1 2006-05-11 09:23:43.000000000 -0700 +++ devel-akpm/include/linux/time.h 2006-05-11 09:23:43.000000000 -0700 @@ -68,13 +68,15 @@ extern unsigned long mktime(const unsign extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); /* - * sub = end - start, in normalized form + * sub = lhs - rhs, in normalized form */ -static inline void timespec_sub(struct timespec *start, struct timespec *end, - struct timespec *sub) +static inline struct timespec timespec_sub(struct timespec lhs, + struct timespec rhs) { - set_normalized_timespec(sub, end->tv_sec - start->tv_sec, - end->tv_nsec - start->tv_nsec); + struct timespec ts_delta; + set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec, + lhs.tv_nsec - rhs.tv_nsec); + return ts_delta; } /* diff -puN kernel/delayacct.c~per-task-delay-accounting-setup-fix-1 kernel/delayacct.c --- devel/kernel/delayacct.c~per-task-delay-accounting-setup-fix-1 2006-05-11 09:23:43.000000000 -0700 +++ devel-akpm/kernel/delayacct.c 2006-05-11 09:23:43.000000000 -0700 @@ -74,7 +74,7 @@ static inline void delayacct_end(struct s64 ns; do_posix_clock_monotonic_gettime(end); - timespec_sub(&ts, start, end); + ts = timespec_sub(*end, *start); ns = timespec_to_ns(&ts); if (ns < 0) return; _