Skip to content

Commit 8d5e1d8

Browse files
baruchsiachczankel
authored andcommitted
xtensa: remove CCOUNT_PER_JIFFY
Use ccount_freq directly to make the code a little more readable. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
1 parent fedc21d commit 8d5e1d8

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎arch/xtensa/include/asm/timex.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#endif
3737

3838
extern unsigned long ccount_freq;
39-
#define CCOUNT_PER_JIFFY (ccount_freq / HZ)
4039

4140
typedef unsigned long long cycles_t;
4241

‎arch/xtensa/kernel/setup.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@ c_show(struct seq_file *f, void *slot)
585585
"bogomips\t: %lu.%02lu\n",
586586
XCHAL_BUILD_UNIQUE_ID,
587587
XCHAL_HAVE_BE ? "big" : "little",
588-
CCOUNT_PER_JIFFY/(1000000/HZ),
589-
(CCOUNT_PER_JIFFY/(10000/HZ)) % 100,
588+
ccount_freq/1000000,
589+
(ccount_freq/10000) % 100,
590590
loops_per_jiffy/(500000/HZ),
591591
(loops_per_jiffy/(5000/HZ)) % 100);
592592

‎arch/xtensa/kernel/time.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void __init time_init(void)
130130
#else
131131
ccount_freq = CONFIG_XTENSA_CPU_CLOCK*1000000UL;
132132
#endif
133-
clocksource_register_hz(&ccount_clocksource, CCOUNT_PER_JIFFY * HZ);
133+
clocksource_register_hz(&ccount_clocksource, ccount_freq);
134134

135135
ccount_timer.evt.cpumask = cpumask_of(0);
136136
ccount_timer.evt.irq = irq_create_mapping(NULL, LINUX_TIMER_INT);
@@ -164,7 +164,7 @@ irqreturn_t timer_interrupt (int irq, void *dev_id)
164164
#ifndef CONFIG_GENERIC_CALIBRATE_DELAY
165165
void calibrate_delay(void)
166166
{
167-
loops_per_jiffy = CCOUNT_PER_JIFFY;
167+
loops_per_jiffy = ccount_freq / HZ;
168168
printk("Calibrating delay loop (skipped)... "
169169
"%lu.%02lu BogoMIPS preset\n",
170170
loops_per_jiffy/(1000000/HZ),

0 commit comments

Comments
 (0)