Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33800
b: refs/heads/master
c: 96dd742
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Linus Torvalds committed Sep 6, 2006
1 parent 4508c99 commit 9fe35d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 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: fe2bbc4832659b7ffc867cac03e0a92ae81e11e4
refs/heads/master: 96dd7421a06a5bc6eb731323b95efcb2fd864854
7 changes: 6 additions & 1 deletion trunk/include/linux/ktime.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ typedef union {
#endif
} ktime_t;

#define KTIME_MAX (~((u64)1 << 63))
#define KTIME_MAX ((s64)~((u64)1 << 63))
#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)

/*
* ktime_t definitions when using the 64-bit scalar representation:
Expand All @@ -73,6 +74,10 @@ typedef union {
*/
static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
{
#if (BITS_PER_LONG == 64)
if (unlikely(secs >= KTIME_SEC_MAX))
return (ktime_t){ .tv64 = KTIME_MAX };
#endif
return (ktime_t) { .tv64 = (s64)secs * NSEC_PER_SEC + (s64)nsecs };
}

Expand Down

0 comments on commit 9fe35d9

Please sign in to comment.