LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Make the kernel NTP code hand 64-bit *unsigned* values to do_div() [try #3]
@ 2008-02-21 16:50 David Howells
2008-02-23 8:04 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: David Howells @ 2008-02-21 16:50 UTC (permalink / raw)
To: torvalds, akpm, zippel, schwab; +Cc: linux-kernel, dhowells
From: David Howells <dhowells@redhat.com>
The kernel NTP code shouldn't hand 64-bit *signed* values to do_div(). Make it
instead hand 64-bit unsigned values. This gets rid of a couple of warnings.
Signed-off-by: David Howells <dhowells@redhat.com>
---
kernel/time/ntp.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index c88b591..d4bca92 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -342,14 +342,16 @@ int do_adjtimex(struct timex *txc)
freq_adj = shift_right(freq_adj, time_constant * 2 +
(SHIFT_PLL + 2) * 2 - SHIFT_NSEC);
if (mtemp >= MINSEC && (time_status & STA_FLL || mtemp > MAXSEC)) {
+ u64 utemp64;
temp64 = time_offset << (SHIFT_NSEC - SHIFT_FLL);
if (time_offset < 0) {
- temp64 = -temp64;
- do_div(temp64, mtemp);
- freq_adj -= temp64;
+ utemp64 = -temp64;
+ do_div(utemp64, mtemp);
+ freq_adj -= utemp64;
} else {
- do_div(temp64, mtemp);
- freq_adj += temp64;
+ utemp64 = temp64;
+ do_div(utemp64, mtemp);
+ freq_adj += utemp64;
}
}
freq_adj += time_freq;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make the kernel NTP code hand 64-bit *unsigned* values to do_div() [try #3]
2008-02-21 16:50 [PATCH] Make the kernel NTP code hand 64-bit *unsigned* values to do_div() [try #3] David Howells
@ 2008-02-23 8:04 ` Andrew Morton
2008-02-23 21:01 ` Thomas Gleixner
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-02-23 8:04 UTC (permalink / raw)
To: David Howells
Cc: torvalds, zippel, schwab, linux-kernel, Thomas Gleixner, Ingo Molnar
On Thu, 21 Feb 2008 16:50:35 +0000 David Howells <dhowells@redhat.com> wrote:
> From: David Howells <dhowells@redhat.com>
>
> The kernel NTP code shouldn't hand 64-bit *signed* values to do_div(). Make it
> instead hand 64-bit unsigned values. This gets rid of a couple of warnings.
On certain architectures. It would have bene nice to mention what those
architectures are, and to quote the warnings. Next time, please ;)
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
>
> kernel/time/ntp.c | 12 +++++++-----
Thomas, do you consider ntp to fall under git-hrt?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make the kernel NTP code hand 64-bit *unsigned* values to do_div() [try #3]
2008-02-23 8:04 ` Andrew Morton
@ 2008-02-23 21:01 ` Thomas Gleixner
2008-02-23 21:07 ` Andrew Morton
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2008-02-23 21:01 UTC (permalink / raw)
To: Andrew Morton
Cc: David Howells, torvalds, zippel, schwab, linux-kernel, Ingo Molnar
On Sat, 23 Feb 2008, Andrew Morton wrote:
> On Thu, 21 Feb 2008 16:50:35 +0000 David Howells <dhowells@redhat.com> wrote:
>
> > From: David Howells <dhowells@redhat.com>
> >
> > The kernel NTP code shouldn't hand 64-bit *signed* values to do_div(). Make it
> > instead hand 64-bit unsigned values. This gets rid of a couple of warnings.
>
> On certain architectures. It would have bene nice to mention what those
> architectures are, and to quote the warnings. Next time, please ;)
>
> > Signed-off-by: David Howells <dhowells@redhat.com>
> > ---
> >
> > kernel/time/ntp.c | 12 +++++++-----
>
> Thomas, do you consider ntp to fall under git-hrt?
I'll pick it up.
Thanks,
tglx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make the kernel NTP code hand 64-bit *unsigned* values to do_div() [try #3]
2008-02-23 21:01 ` Thomas Gleixner
@ 2008-02-23 21:07 ` Andrew Morton
2008-02-23 22:05 ` Thomas Gleixner
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2008-02-23 21:07 UTC (permalink / raw)
To: Thomas Gleixner
Cc: David Howells, torvalds, zippel, schwab, linux-kernel, Ingo Molnar
On Sat, 23 Feb 2008 22:01:55 +0100 (CET) Thomas Gleixner <tglx@linutronix.de> wrote:
> On Sat, 23 Feb 2008, Andrew Morton wrote:
>
> > On Thu, 21 Feb 2008 16:50:35 +0000 David Howells <dhowells@redhat.com> wrote:
> >
> > > From: David Howells <dhowells@redhat.com>
> > >
> > > The kernel NTP code shouldn't hand 64-bit *signed* values to do_div(). Make it
> > > instead hand 64-bit unsigned values. This gets rid of a couple of warnings.
> >
> > On certain architectures. It would have bene nice to mention what those
> > architectures are, and to quote the warnings. Next time, please ;)
> >
> > > Signed-off-by: David Howells <dhowells@redhat.com>
> > > ---
> > >
> > > kernel/time/ntp.c | 12 +++++++-----
> >
> > Thomas, do you consider ntp to fall under git-hrt?
>
> I'll pick it up.
>
OK. And this is still
git+ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt.git#mm,
yes?
Can we please define the scope of that tree?
Please review
fix-shadowed-variables-in-kernel-posix-cpu-timersc.patch
timers-simplify-lockdep-stuff.patch
hrtimers-simplify-lockdep-stuff.patch
kill-double_spin_lock.patch
ntp-make-the-kernel-ntp-code-hand-64-bit-unsigned-values-to-do_div.patch
from http://userweb.kernel.org/~akpm/mmotm/broken-out/. I think they're
all probably git-hrt material.
Can we get that tree into linux-next too please?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Make the kernel NTP code hand 64-bit *unsigned* values to do_div() [try #3]
2008-02-23 21:07 ` Andrew Morton
@ 2008-02-23 22:05 ` Thomas Gleixner
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2008-02-23 22:05 UTC (permalink / raw)
To: Andrew Morton
Cc: David Howells, torvalds, zippel, schwab, linux-kernel, Ingo Molnar
On Sat, 23 Feb 2008, Andrew Morton wrote:
> > > Thomas, do you consider ntp to fall under git-hrt?
> >
> > I'll pick it up.
> >
> OK. And this is still
> git+ssh://master.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt.git#mm,
> yes?
Yes
> Can we please define the scope of that tree?
Primary scope is hrtimer, posixtimer, clockevents & Co.
In the last month I fed a lot of timekeeping/ntp stuff via -hrt as
well. If there is no objection, I'm happy to provide the sink for
those.
> Please review
>
> fix-shadowed-variables-in-kernel-posix-cpu-timersc.patch
> timers-simplify-lockdep-stuff.patch
> hrtimers-simplify-lockdep-stuff.patch
> kill-double_spin_lock.patch
> ntp-make-the-kernel-ntp-code-hand-64-bit-unsigned-values-to-do_div.patch
>
> from http://userweb.kernel.org/~akpm/mmotm/broken-out/. I think they're
> all probably git-hrt material.
Will do tomorrow, when I'm more awake.
> Can we get that tree into linux-next too please?
Will contact Stephen.
Thanks,
tglx
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-02-23 22:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-21 16:50 [PATCH] Make the kernel NTP code hand 64-bit *unsigned* values to do_div() [try #3] David Howells
2008-02-23 8:04 ` Andrew Morton
2008-02-23 21:01 ` Thomas Gleixner
2008-02-23 21:07 ` Andrew Morton
2008-02-23 22:05 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).