aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2008-05-01 07:34:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-01 11:03:58 -0400
commitf8bd2258e2d520dff28c855658bd24bdafb5102d (patch)
treed76db1dc858cb316bc7d5b8473f690a753fd2c93 /kernel/time
parent6f6d6a1a6a1336431a6cba60ace9e97c3a496a19 (diff)
remove div_long_long_rem
x86 is the only arch right now, which provides an optimized for div_long_long_rem and it has the downside that one has to be very careful that the divide doesn't overflow. The API is a little akward, as the arguments for the unsigned divide are signed. The signed version also doesn't handle a negative divisor and produces worse code on 64bit archs. There is little incentive to keep this API alive, so this converts the few users to the new API. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: john stultz <johnstul@us.ibm.com> Cc: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/ntp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index a4492f3d64db..dbd6f8905614 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -234,7 +234,7 @@ static inline void notify_cmos_timer(void) { }
234 */ 234 */
235int do_adjtimex(struct timex *txc) 235int do_adjtimex(struct timex *txc)
236{ 236{
237 long mtemp, save_adjust, rem; 237 long mtemp, save_adjust;
238 s64 freq_adj; 238 s64 freq_adj;
239 int result; 239 int result;
240 240
@@ -345,9 +345,7 @@ int do_adjtimex(struct timex *txc)
345 freq_adj += time_freq; 345 freq_adj += time_freq;
346 freq_adj = min(freq_adj, (s64)MAXFREQ_NSEC); 346 freq_adj = min(freq_adj, (s64)MAXFREQ_NSEC);
347 time_freq = max(freq_adj, (s64)-MAXFREQ_NSEC); 347 time_freq = max(freq_adj, (s64)-MAXFREQ_NSEC);
348 time_offset = div_long_long_rem_signed(time_offset, 348 time_offset = div_s64(time_offset, NTP_INTERVAL_FREQ);
349 NTP_INTERVAL_FREQ,
350 &rem);
351 time_offset <<= SHIFT_UPDATE; 349 time_offset <<= SHIFT_UPDATE;
352 } /* STA_PLL */ 350 } /* STA_PLL */
353 } /* txc->modes & ADJ_OFFSET */ 351 } /* txc->modes & ADJ_OFFSET */