Re: 2.6.22-rc2 built on ppc (2)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Gleixner
Date: Monday, May 21, 2007 - 3:03 am

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;
 			}
 		    }




-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.22-rc2 built on ppc (2), Elimar Riesebieter, (Sun May 20, 4:08 am)
Re: 2.6.22-rc2 built on ppc (2), Andrew Morton, (Sun May 20, 2:37 pm)
Re: 2.6.22-rc2 built on ppc (2), Roman Zippel, (Sun May 20, 6:54 pm)
Re: 2.6.22-rc2 built on ppc (2), Thomas Gleixner, (Mon May 21, 3:03 am)
Re: 2.6.22-rc2 built on ppc (2), Roman Zippel, (Mon May 21, 3:25 am)
Re: 2.6.22-rc2 built on ppc (2), Thomas Gleixner, (Mon May 21, 3:40 am)