The patch titled kernel/time/ntp.c: possible cleanups has been added to the -mm tree. Its filename is kernel-time-ntpc-possible-cleanups.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: kernel/time/ntp.c: possible cleanups From: Adrian Bunk <bunk@xxxxxxxxx> This patch contains the following possible cleanups: - make the following needlessly global function static: - ntp_update_frequency() - make the following needlessly global variables static: - time_state - time_offset - time_constant - time_reftime - remove the following read-only global variable: - time_precision Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx> Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx> Cc: john stultz <johnstul@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/timex.h | 6 ------ kernel/time/ntp.c | 39 +++++++++++++++++++-------------------- 2 files changed, 19 insertions(+), 26 deletions(-) diff -puN include/linux/timex.h~kernel-time-ntpc-possible-cleanups include/linux/timex.h --- a/include/linux/timex.h~kernel-time-ntpc-possible-cleanups +++ a/include/linux/timex.h @@ -197,21 +197,15 @@ extern int tickadj; /* amount of adjus /* * phase-lock loop variables */ -extern int time_state; /* clock status */ extern int time_status; /* clock synchronization status bits */ -extern long time_offset; /* time adjustment (us) */ -extern long time_constant; /* pll time constant */ -extern long time_precision; /* clock precision (us) */ extern long time_maxerror; /* maximum error */ extern long time_esterror; /* estimated error */ extern long time_freq; /* frequency offset (scaled ppm) */ -extern long time_reftime; /* time at last adjustment (s) */ extern long time_adjust; /* The amount of adjtime left */ extern void ntp_clear(void); -extern void ntp_update_frequency(void); /** * ntp_synced - Returns 1 if the NTP status is not UNSYNC diff -puN kernel/time/ntp.c~kernel-time-ntpc-possible-cleanups kernel/time/ntp.c --- a/kernel/time/ntp.c~kernel-time-ntpc-possible-cleanups +++ a/kernel/time/ntp.c @@ -30,17 +30,30 @@ static u64 tick_length, tick_length_base * phase-lock loop variables */ /* TIME_ERROR prevents overwriting the CMOS clock */ -int time_state = TIME_OK; /* clock synchronization status */ +static int time_state = TIME_OK; /* clock synchronization status */ int time_status = STA_UNSYNC; /* clock status bits */ -long time_offset; /* time adjustment (ns) */ -long time_constant = 2; /* pll time constant */ -long time_precision = 1; /* clock precision (us) */ +static long time_offset; /* time adjustment (ns) */ +static long time_constant = 2; /* pll time constant */ long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */ long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ long time_freq; /* frequency offset (scaled ppm)*/ -long time_reftime; /* time at last adjustment (s) */ +static long time_reftime; /* time at last adjustment (s) */ long time_adjust; +#define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE) +#define CLOCK_TICK_ADJUST (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / CLOCK_TICK_RATE) + +static void ntp_update_frequency(void) +{ + tick_length_base = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ) << TICK_LENGTH_SHIFT; + tick_length_base += (s64)CLOCK_TICK_ADJUST << TICK_LENGTH_SHIFT; + tick_length_base += (s64)time_freq << (TICK_LENGTH_SHIFT - SHIFT_NSEC); + + do_div(tick_length_base, HZ); + + tick_nsec = tick_length_base >> TICK_LENGTH_SHIFT; +} + /** * ntp_clear - Clears the NTP state variables * @@ -59,20 +72,6 @@ void ntp_clear(void) time_offset = 0; } -#define CLOCK_TICK_OVERFLOW (LATCH * HZ - CLOCK_TICK_RATE) -#define CLOCK_TICK_ADJUST (((s64)CLOCK_TICK_OVERFLOW * NSEC_PER_SEC) / CLOCK_TICK_RATE) - -void ntp_update_frequency(void) -{ - tick_length_base = (u64)(tick_usec * NSEC_PER_USEC * USER_HZ) << TICK_LENGTH_SHIFT; - tick_length_base += (s64)CLOCK_TICK_ADJUST << TICK_LENGTH_SHIFT; - tick_length_base += (s64)time_freq << (TICK_LENGTH_SHIFT - SHIFT_NSEC); - - do_div(tick_length_base, HZ); - - tick_nsec = tick_length_base >> TICK_LENGTH_SHIFT; -} - /* * this routine handles the overflow of the microsecond field * @@ -330,7 +329,7 @@ leave: if ((time_status & (STA_UNSYNC|ST txc->esterror = time_esterror; txc->status = time_status; txc->constant = time_constant; - txc->precision = time_precision; + txc->precision = 1; txc->tolerance = MAXFREQ; txc->tick = tick_usec; _ Patches currently in -mm which might be from bunk@xxxxxxxxx are add-force-of-use-mmconfig.patch make-drivers-cpufreq-cpufreq_ondemandcpowersave_bias_target-static.patch git-dvb.patch git-gfs2.patch git-input.patch git-libata-all.patch git-mtd.patch drivers-net-e1000-possible-cleanups.patch git-net.patch security-selinux-hooksc-make-4-functions-static.patch fs-nfs-make-code-static.patch git-ocfs2.patch git-pcmcia.patch include-scsi-libsash-should-include-linux-scatterlisth.patch gregkh-pci-acpiphp-configure-_prt-v3-cleanup.patch git-scsi-misc.patch drivers-scsi-aic7xxx-possible-cleanups.patch drivers-scsi-small-cleanups.patch drivers-scsi-qla2xxx-make-some-functions-static.patch drivers-scsi-aic7xxx-aic79xx_corec-make-ahd_match_scb-static.patch drivers-scsi-aic7xxx-possible-cleanups-2.patch drivers-scsi-advansysc-cleanups.patch make-drivers-scsi-aic7xxx-aic79xx_coreahd_set_tags-static.patch megaraid-fix-warnings-when-config_proc_fs=n.patch git-cryptodev.patch mm-make-functions-static.patch acx1xx-wireless-driver.patch drivers-edac-make-code-static.patch inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-fix.patch reiserfs-warn-about-the-useless-nolargeio-option.patch x86-microcode-add-sysfs-and-hotplug-support-fix-fix-2.patch drivers-char-scx200_gpioc-make-code-static.patch drivers-char-pc8736x_gpioc-remove-unused-static-functions.patch kernel-time-ntpc-possible-cleanups.patch hdaps-unify-and-cache-hdaps-readouts-fix.patch generic-ioremap_page_range-i386-conversion-fix.patch fs-ecryptfs-possible-cleanups.patch ecryptfs-add-a-maintainers-entry.patch make-kernel-sysctlc_proc_do_string-static.patch namespaces-utsname-sysctl-hack-fix.patch namespaces-utsname-implement-clone_newuts-flag.patch fs-reiser4-possible-cleanups.patch drivers-ide-cleanups.patch md-the-scheduled-removal-of-the-start_array-ioctl-for-md.patch srcu-3-add-srcu-operations-to-rcutorture-fix.patch the-scheduled-removal-of-some-oss-drivers.patch the-scheduled-removal-of-some-oss-drivers-fix.patch the-scheduled-removal-of-some-oss-drivers-fix-fix.patch kill-sound-oss-_symsc.patch schedule-obsolete-oss-drivers-for-removal-2nd-round.patch slab-cache-shrinker-statistics.patch debug-shared-irqs-kconfig-fix.patch i386-enable-4k-stacks-by-default.patch mutex-subsystem-synchro-test-module.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html