Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83482
b: refs/heads/master
c: 6ffc787
h: refs/heads/master
v: v3
  • Loading branch information
David Fries authored and Linus Torvalds committed Feb 6, 2008
1 parent 923395f commit 04ece8f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 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: 82f560874e88bd1fd8c98a6254d65a1dffab3876
refs/heads/master: 6ffc787a4492ac627315aaeafdfdc0a5c3028582
4 changes: 4 additions & 0 deletions trunk/include/linux/acct.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ typedef struct acct acct_t;
static inline u32 jiffies_to_AHZ(unsigned long x)
{
#if (TICK_NSEC % (NSEC_PER_SEC / AHZ)) == 0
# if HZ < AHZ
return x * (AHZ / HZ);
# else
return x / (HZ / AHZ);
# endif
#else
u64 tmp = (u64)x * TICK_NSEC;
do_div(tmp, (NSEC_PER_SEC / AHZ));
Expand Down
11 changes: 9 additions & 2 deletions trunk/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,11 @@ EXPORT_SYMBOL(jiffies_to_timeval);
clock_t jiffies_to_clock_t(long x)
{
#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0
# if HZ < USER_HZ
return x * (USER_HZ / HZ);
# else
return x / (HZ / USER_HZ);
# endif
#else
u64 tmp = (u64)x * TICK_NSEC;
do_div(tmp, (NSEC_PER_SEC / USER_HZ));
Expand Down Expand Up @@ -599,7 +603,12 @@ EXPORT_SYMBOL(clock_t_to_jiffies);
u64 jiffies_64_to_clock_t(u64 x)
{
#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0
# if HZ < USER_HZ
x *= USER_HZ;
do_div(x, HZ);
# else
do_div(x, HZ / USER_HZ);
# endif
#else
/*
* There are better ways that don't overflow early,
Expand All @@ -611,7 +620,6 @@ u64 jiffies_64_to_clock_t(u64 x)
#endif
return x;
}

EXPORT_SYMBOL(jiffies_64_to_clock_t);

u64 nsec_to_clock_t(u64 x)
Expand Down Expand Up @@ -646,7 +654,6 @@ u64 get_jiffies_64(void)
} while (read_seqretry(&xtime_lock, seq));
return ret;
}

EXPORT_SYMBOL(get_jiffies_64);
#endif

Expand Down

0 comments on commit 04ece8f

Please sign in to comment.