timekeeping: Fix time moving backwards
Changed the calculation logic that sometimes calculates
the time wrong.
Sometimes there is an overflow when the tv_nsec field in
the timespec structure is being added since it is 32-bit.
To resolve this issue nsec variable is being added first
so that the addition is performed in 64 bit signed format.
Bug 1217429
Change-Id: I9c65da88f02596ba73c47be6342ed909e650db22
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Reviewed-on: http://git-master/r/195092
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Bo Yan <byan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Shridhar Rasal <srasal@nvidia.com>
1 file changed