[PATCH] NTP shift_right cleanup
authorjohn stultz <johnstul@us.ibm.com>
Sun, 30 Oct 2005 23:01:42 +0000 (15:01 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Oct 2005 01:37:18 +0000 (17:37 -0800)
commit1bb34a412750291e4e5e9f1d0fe7ae1b7e976098
tree00d481a2ff4302f444fbf7c31e5e661f79dc85a9
parent9c0cbd54ce0397017a823484f9a8054ab369b8a2
[PATCH] NTP shift_right cleanup

Create a macro shift_right() that avoids the numerous ugly conditionals in the
NTP code that look like:

        if(a < 0)
                b = -(-a >> shift);
        else
                b = a >> shift;

Replacing it with:

        b = shift_right(a, shift);

This should have zero effect on the logic, however it should probably have
a bit of testing just to be sure.

Also replace open-coded min/max with the macros.

Signed-off-by : John Stultz <johnstul@us.ibm.com>

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/timex.h
kernel/time.c
kernel/timer.c