time: Fix casting issue in tk_set_xtime and tk_xtime_add
authorJohn Stultz <[email protected]>
Mon, 23 Jul 2012 20:22:37 +0000 (16:22 -0400)
committerThomas Gleixner <[email protected]>
Tue, 24 Jul 2012 14:48:45 +0000 (16:48 +0200)
commitb44d50dcacea0d485ca2ff9140f8cc28ee22f28d
tree5c1702b71fd15a79381edf6fe83b202212d3b387
parentf726a697d06102e7a1fc0a87308cb30a84580205
time: Fix casting issue in tk_set_xtime and tk_xtime_add

commit 1e75fa8b (time: Condense timekeeper.xtime into xtime_sec)
introduced helper functions which apply a timespec to the core
internal timekeeper data. The internal storage type is u64. The
timespec tv_nsec value must be shifted before set or added to the
internal value. tv_nsec is a long, which is 32bit on a 32bit system,
so without casting tv_nsec to u64 we lose the bits which are shifted
over the 32bit boundary.

Add the proper typecasts.

Reported-by: Konrad Rzeszutek Wilk <[email protected]>
Tested-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: John Stultz <[email protected]>
Acked-by: Prarit Bhargava <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
kernel/time/timekeeping.c