summaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-02-22 15:48:43 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-25 18:38:15 +0100
commit2b9d1496e7835a603c340e8f0dd81f4b74d5f248 (patch)
tree419904a23470733179a0ecd647263777b2f8e780 /kernel/time
parente96291653b2e4df02f160b574070f6e632868e5e (diff)
downloadlinux-stable-2b9d1496e7835a603c340e8f0dd81f4b74d5f248.tar.gz
linux-stable-2b9d1496e7835a603c340e8f0dd81f4b74d5f248.tar.bz2
linux-stable-2b9d1496e7835a603c340e8f0dd81f4b74d5f248.zip
time: ntp: make 64-bit constants more robust
Impact: cleanup, no functionality changed - make PPM_SCALE an explicit s64 constant, to remove (s64) casts from usage sites. kernel/time/ntp.o: text data bss dec hex filename 2536 114 136 2786 ae2 ntp.o.before 2536 114 136 2786 ae2 ntp.o.after md5: 40a7728d1188aa18e83e21a81fa7b150 ntp.o.before.asm 40a7728d1188aa18e83e21a81fa7b150 ntp.o.after.asm Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/ntp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 4346ed6e623f..7447d57e021a 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -408,7 +408,7 @@ static inline void process_adjtimex_modes(struct timex *txc, struct timespec *ts
time_status &= ~STA_NANO;
if (txc->modes & ADJ_FREQUENCY) {
- time_freq = (s64)txc->freq * PPM_SCALE;
+ time_freq = txc->freq * PPM_SCALE;
time_freq = min(time_freq, MAXFREQ_SCALED);
time_freq = max(time_freq, -MAXFREQ_SCALED);
}
@@ -505,7 +505,7 @@ int do_adjtimex(struct timex *txc)
result = TIME_ERROR;
txc->freq = shift_right((time_freq >> PPM_SCALE_INV_SHIFT) *
- (s64)PPM_SCALE_INV, NTP_SCALE_SHIFT);
+ PPM_SCALE_INV, NTP_SCALE_SHIFT);
txc->maxerror = time_maxerror;
txc->esterror = time_esterror;
txc->status = time_status;