Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Eliminate unused do_gtod variable

Since we started using the generic timekeeping code, we haven't had a
powerpc-specific version of do_gettimeofday, and hence there is now
nothing that reads the do_gtod variable in arch/powerpc/kernel/time.c.
This therefore removes it and the code that sets it.

Signed-off-by: Paul Mackerras <paulus@samba.org>

-55
-20
arch/powerpc/include/asm/time.h
··· 48 48 extern unsigned long ppc_tb_freq; 49 49 #define DEFAULT_TB_FREQ 125000000UL 50 50 51 - /* 52 - * By putting all of this stuff into a single struct we 53 - * reduce the number of cache lines touched by do_gettimeofday. 54 - * Both by collecting all of the data in one cache line and 55 - * by touching only one TOC entry on ppc64. 56 - */ 57 - struct gettimeofday_vars { 58 - u64 tb_to_xs; 59 - u64 stamp_xsec; 60 - u64 tb_orig_stamp; 61 - }; 62 - 63 - struct gettimeofday_struct { 64 - unsigned long tb_ticks_per_sec; 65 - struct gettimeofday_vars vars[2]; 66 - struct gettimeofday_vars * volatile varp; 67 - unsigned var_idx; 68 - unsigned tb_to_us; 69 - }; 70 - 71 51 struct div_result { 72 52 u64 result_high; 73 53 u64 result_low;
-35
arch/powerpc/kernel/time.c
··· 164 164 static unsigned tb_to_ns_shift __read_mostly; 165 165 static unsigned long boot_tb __read_mostly; 166 166 167 - static struct gettimeofday_struct do_gtod; 168 - 169 167 extern struct timezone sys_tz; 170 168 static long timezone_offset; 171 169 ··· 413 415 } 414 416 EXPORT_SYMBOL(udelay); 415 417 416 - 417 - /* 418 - * There are two copies of tb_to_xs and stamp_xsec so that no 419 - * lock is needed to access and use these values in 420 - * do_gettimeofday. We alternate the copies and as long as a 421 - * reasonable time elapses between changes, there will never 422 - * be inconsistent values. ntpd has a minimum of one minute 423 - * between updates. 424 - */ 425 418 static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec, 426 419 u64 new_tb_to_xs) 427 420 { 428 - unsigned temp_idx; 429 - struct gettimeofday_vars *temp_varp; 430 - 431 - temp_idx = (do_gtod.var_idx == 0); 432 - temp_varp = &do_gtod.vars[temp_idx]; 433 - 434 - temp_varp->tb_to_xs = new_tb_to_xs; 435 - temp_varp->tb_orig_stamp = new_tb_stamp; 436 - temp_varp->stamp_xsec = new_stamp_xsec; 437 - smp_mb(); 438 - do_gtod.varp = temp_varp; 439 - do_gtod.var_idx = temp_idx; 440 - 441 421 /* 442 422 * tb_update_count is used to allow the userspace gettimeofday code 443 423 * to assure itself that it sees a consistent view of the tb_to_xs and ··· 491 515 tb_ticks_per_sec = new_tb_ticks_per_sec; 492 516 calc_cputime_factors(); 493 517 div128_by_32( XSEC_PER_SEC, 0, tb_ticks_per_sec, &divres ); 494 - do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 495 518 tb_to_xs = divres.result_low; 496 - do_gtod.varp->tb_to_xs = tb_to_xs; 497 519 vdso_data->tb_ticks_per_sec = tb_ticks_per_sec; 498 520 vdso_data->tb_to_xs = tb_to_xs; 499 521 } ··· 962 988 sys_tz.tz_minuteswest = -timezone_offset / 60; 963 989 sys_tz.tz_dsttime = 0; 964 990 } 965 - 966 - do_gtod.varp = &do_gtod.vars[0]; 967 - do_gtod.var_idx = 0; 968 - do_gtod.varp->tb_orig_stamp = tb_last_jiffy; 969 - __get_cpu_var(last_jiffy) = tb_last_jiffy; 970 - do_gtod.varp->stamp_xsec = (u64) xtime.tv_sec * XSEC_PER_SEC; 971 - do_gtod.tb_ticks_per_sec = tb_ticks_per_sec; 972 - do_gtod.varp->tb_to_xs = tb_to_xs; 973 - do_gtod.tb_to_us = tb_to_us; 974 991 975 992 vdso_data->tb_orig_stamp = tb_last_jiffy; 976 993 vdso_data->tb_update_count = 0;