On Sun, 2007-05-20 at 14:37 -0700, Andrew Morton wrote:
We have the signed do_div() work around and it is used in the ntp code 5
lines further down already.
tglx
--------------------------------->
Subject: NTP: use the signed divide function instead of do_div()
Replace do_div() by div_long_long_rem_signed()
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index cb25649..bb1bf86 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -304,10 +304,12 @@ int do_adjtimex(struct timex *txc)
temp64 = time_offset << (SHIFT_NSEC - SHIFT_FLL);
if (time_offset < 0) {
temp64 = -temp64;
- do_div(temp64, mtemp);
+ temp64 = div_long_long_rem_signed(temp64, mtemp,
+ &rem);
freq_adj -= temp64;
} else {
- do_div(temp64, mtemp);
+ temp64 = div_long_long_rem_signed(temp64, mtemp,
+ &rem);
freq_adj += temp64;
}
}
-