Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19651
b: refs/heads/master
c: 88fc389
h: refs/heads/master
i:
  19649: 484acda
  19647: 83e5cae
v: v3
  • Loading branch information
George Anzinger authored and Linus Torvalds committed Feb 3, 2006
1 parent 7e35cf6 commit dcaede2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 034b91a3b66cf9d2983ac45f73162395c0936c36
refs/heads/master: 88fc3897e3219e63ae6e2d180a6c87d033ef9f3b
13 changes: 7 additions & 6 deletions trunk/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,16 @@ void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec)
*
* Returns the timespec representation of the nsec parameter.
*/
inline struct timespec ns_to_timespec(const nsec_t nsec)
struct timespec ns_to_timespec(const nsec_t nsec)
{
struct timespec ts;

if (nsec)
ts.tv_sec = div_long_long_rem_signed(nsec, NSEC_PER_SEC,
&ts.tv_nsec);
else
ts.tv_sec = ts.tv_nsec = 0;
if (!nsec)
return (struct timespec) {0, 0};

ts.tv_sec = div_long_long_rem_signed(nsec, NSEC_PER_SEC, &ts.tv_nsec);
if (unlikely(nsec < 0))
set_normalized_timespec(&ts, ts.tv_sec, ts.tv_nsec);

return ts;
}
Expand Down

0 comments on commit dcaede2

Please sign in to comment.