[RFC v8 12/28] many clockevent drivers: don't set ->min_delta_ns and ->max_delta_ns

From: Nicolai Stange
Date: Sat Nov 19 2016 - 11:10:57 EST


Now that the clockevent core always initializes the ->*_delta_ns values
from their ->_delta_ticks counterparts, there is no point in having the
clockevent devices' drivers doing so as well.

Don't initialize ->min_delta_ns and ->max_delta_ns from the clockevent
devices' drivers.

This patch was created with the help of the Coccinelle script below.
One initialization of ->min_delta_ns in arch/tile/kernel/time.c gets
missed by this Cocci script and its removal has been manually added.

@@
expression ced;
expression ns, cycles;
@@
- ced->min_delta_ns = ns;
...
ced->min_delta_ticks = cycles;

@@
expression ced;
expression ns, cycles;
@@
- ced.min_delta_ns = ns;
...
ced.min_delta_ticks = cycles;

@@
identifier ced;
expression ns, cycles;
@@
struct clock_event_device ced = {
- .min_delta_ns = ns,
.min_delta_ticks = cycles,
};

@@
expression ced;
expression ns, cycles;
@@
- ced->max_delta_ns = ns;
...
ced->max_delta_ticks = cycles;

@@
expression ced;
expression ns, cycles;
@@
- ced.max_delta_ns = ns;
...
ced.max_delta_ticks = cycles;

@@
identifier ced;
expression ns, cycles;
@@
struct clock_event_device ced = {
- .max_delta_ns = ns,
.max_delta_ticks = cycles,
};

Signed-off-by: Nicolai Stange <nicstange@xxxxxxxxx>
---
arch/avr32/kernel/time.c | 2 --
arch/blackfin/kernel/time-ts.c | 4 ----
arch/c6x/platforms/timer64.c | 2 --
arch/hexagon/kernel/time.c | 2 --
arch/m68k/coldfire/pit.c | 4 ----
arch/microblaze/kernel/timer.c | 4 ----
arch/mips/alchemy/common/time.c | 2 --
arch/mips/jz4740/time.c | 2 --
arch/mips/kernel/cevt-bcm1480.c | 2 --
arch/mips/kernel/cevt-ds1287.c | 2 --
arch/mips/kernel/cevt-gt641xx.c | 2 --
arch/mips/kernel/cevt-sb1250.c | 2 --
arch/mips/kernel/cevt-txx9.c | 3 ---
arch/mips/loongson32/common/time.c | 2 --
arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c | 2 --
arch/mips/loongson64/loongson-3/hpet.c | 2 --
arch/mips/ralink/cevt-rt3352.c | 2 --
arch/mips/sgi-ip27/ip27-timer.c | 2 --
arch/mn10300/kernel/cevt-mn10300.c | 2 --
arch/powerpc/kernel/time.c | 4 ----
arch/s390/kernel/time.c | 2 --
arch/score/kernel/time.c | 4 ----
arch/sparc/kernel/time_32.c | 2 --
arch/sparc/kernel/time_64.c | 4 ----
arch/tile/kernel/time.c | 2 --
arch/um/kernel/time.c | 2 --
arch/unicore32/kernel/time.c | 4 ----
arch/x86/kernel/apic/apic.c | 8 --------
arch/x86/lguest/boot.c | 2 --
arch/x86/platform/uv/uv_time.c | 4 ----
arch/x86/xen/time.c | 4 ----
drivers/clocksource/dw_apb_timer.c | 3 ---
drivers/clocksource/metag_generic.c | 2 --
drivers/clocksource/numachip.c | 2 --
drivers/clocksource/sh_cmt.c | 2 --
drivers/clocksource/timer-atlas7.c | 2 --
kernel/time/tick-broadcast-hrtimer.c | 2 --
37 files changed, 100 deletions(-)

diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
index 3fff4c9..af08261 100644
--- a/arch/avr32/kernel/time.c
+++ b/arch/avr32/kernel/time.c
@@ -141,9 +141,7 @@ void __init time_init(void)

/* setup COMPARE clockevent */
comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift);
- comparator.max_delta_ns = clockevent_delta2ns((u32)~0, &comparator);
comparator.max_delta_ticks = (u32)~0;
- comparator.min_delta_ns = clockevent_delta2ns(50, &comparator) + 1;
comparator.min_delta_ticks = 50;
comparator.cpumask = cpumask_of(0);

diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index 4c93b6f..be43289 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -229,9 +229,7 @@ static void __init bfin_gptmr0_clockevent_init(struct clock_event_device *evt)

clock_tick = get_sclk();
evt->mult = div_sc(clock_tick, NSEC_PER_SEC, evt->shift);
- evt->max_delta_ns = clockevent_delta2ns(-1, evt);
evt->max_delta_ticks = (unsigned long)-1;
- evt->min_delta_ns = clockevent_delta2ns(100, evt);
evt->min_delta_ticks = 100;

evt->cpumask = cpumask_of(0);
@@ -345,9 +343,7 @@ void bfin_coretmr_clockevent_init(void)

clock_tick = get_cclk() / TIME_SCALE;
evt->mult = div_sc(clock_tick, NSEC_PER_SEC, evt->shift);
- evt->max_delta_ns = clockevent_delta2ns(-1, evt);
evt->max_delta_ticks = (unsigned long)-1;
- evt->min_delta_ns = clockevent_delta2ns(100, evt);
evt->min_delta_ticks = 100;

evt->cpumask = cpumask_of(cpu);
diff --git a/arch/c6x/platforms/timer64.c b/arch/c6x/platforms/timer64.c
index 0bd0452..67cd790 100644
--- a/arch/c6x/platforms/timer64.c
+++ b/arch/c6x/platforms/timer64.c
@@ -233,9 +233,7 @@ void __init timer64_init(void)

clockevents_calc_mult_shift(cd, c6x_core_freq / TIMER_DIVISOR, 5);

- cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
cd->max_delta_ticks = 0x7fffffff;
- cd->min_delta_ns = clockevent_delta2ns(250, cd);
cd->min_delta_ticks = 250;

cd->cpumask = cpumask_of(smp_processor_id());
diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index fbdeac1..426764d 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -198,9 +198,7 @@ void __init time_init_deferred(void)
*/
clockevents_calc_mult_shift(ce_dev, sleep_clk_freq, 4);

- ce_dev->max_delta_ns = clockevent_delta2ns(0x7fffffff, ce_dev);
ce_dev->max_delta_ticks = 0x7fffffff;
- ce_dev->min_delta_ns = clockevent_delta2ns(0xf, ce_dev);
ce_dev->min_delta_ticks = 0xf;

#ifdef CONFIG_SMP
diff --git a/arch/m68k/coldfire/pit.c b/arch/m68k/coldfire/pit.c
index 91850e7..56ff421 100644
--- a/arch/m68k/coldfire/pit.c
+++ b/arch/m68k/coldfire/pit.c
@@ -147,11 +147,7 @@ void hw_timer_init(irq_handler_t handler)
{
cf_pit_clockevent.cpumask = cpumask_of(smp_processor_id());
cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32);
- cf_pit_clockevent.max_delta_ns =
- clockevent_delta2ns(0xFFFF, &cf_pit_clockevent);
cf_pit_clockevent.max_delta_ticks = 0xFFFF;
- cf_pit_clockevent.min_delta_ns =
- clockevent_delta2ns(0x3f, &cf_pit_clockevent);
cf_pit_clockevent.min_delta_ticks = 0x3f;
clockevents_register_device(&cf_pit_clockevent);

diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c
index 7ba2ff6..8b82d10 100644
--- a/arch/microblaze/kernel/timer.c
+++ b/arch/microblaze/kernel/timer.c
@@ -175,11 +175,7 @@ static __init int xilinx_clockevent_init(void)
clockevent_xilinx_timer.mult =
div_sc(timer_clock_freq, NSEC_PER_SEC,
clockevent_xilinx_timer.shift);
- clockevent_xilinx_timer.max_delta_ns =
- clockevent_delta2ns((u32)~0, &clockevent_xilinx_timer);
clockevent_xilinx_timer.max_delta_ticks = (u32)~0;
- clockevent_xilinx_timer.min_delta_ns =
- clockevent_delta2ns(1, &clockevent_xilinx_timer);
clockevent_xilinx_timer.min_delta_ticks = 1;
clockevent_xilinx_timer.cpumask = cpumask_of(0);
clockevents_register_device(&clockevent_xilinx_timer);
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index 4afdb70..5f0edac 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -137,9 +137,7 @@ static int __init alchemy_time_init(unsigned int m2int)

cd->shift = 32;
cd->mult = div_sc(32768, NSEC_PER_SEC, cd->shift);
- cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd);
cd->max_delta_ticks = 0xffffffff;
- cd->min_delta_ns = clockevent_delta2ns(9, cd);
cd->min_delta_ticks = 9; /* ~0.28ms */
clockevents_register_device(cd);
setup_irq(m2int, &au1x_rtcmatch2_irqaction);
diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c
index 8cb992f..4bf158e 100644
--- a/arch/mips/jz4740/time.c
+++ b/arch/mips/jz4740/time.c
@@ -144,9 +144,7 @@ void __init plat_time_init(void)
jz4740_jiffies_per_tick = DIV_ROUND_CLOSEST(clk_rate, HZ);

clockevent_set_clock(&jz4740_clockevent, clk_rate);
- jz4740_clockevent.min_delta_ns = clockevent_delta2ns(100, &jz4740_clockevent);
jz4740_clockevent.min_delta_ticks = 100;
- jz4740_clockevent.max_delta_ns = clockevent_delta2ns(0xffff, &jz4740_clockevent);
jz4740_clockevent.max_delta_ticks = 0xffff;
jz4740_clockevent.cpumask = cpumask_of(0);

diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c
index 8f9f2da..35b8702 100644
--- a/arch/mips/kernel/cevt-bcm1480.c
+++ b/arch/mips/kernel/cevt-bcm1480.c
@@ -122,9 +122,7 @@ void sb1480_clockevent_init(void)
cd->features = CLOCK_EVT_FEAT_PERIODIC |
CLOCK_EVT_FEAT_ONESHOT;
clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
- cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd);
cd->max_delta_ticks = 0x7fffff;
- cd->min_delta_ns = clockevent_delta2ns(2, cd);
cd->min_delta_ticks = 2;
cd->rating = 200;
cd->irq = irq;
diff --git a/arch/mips/kernel/cevt-ds1287.c b/arch/mips/kernel/cevt-ds1287.c
index 61ad907..3084bdb0 100644
--- a/arch/mips/kernel/cevt-ds1287.c
+++ b/arch/mips/kernel/cevt-ds1287.c
@@ -127,9 +127,7 @@ int __init ds1287_clockevent_init(int irq)
cd->rating = 100;
cd->irq = irq;
clockevent_set_clock(cd, 32768);
- cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
cd->max_delta_ticks = 0x7fffffff;
- cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
cd->min_delta_ticks = 0x300;
cd->cpumask = cpumask_of(0);

diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index fd90c82..d86975e 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -151,9 +151,7 @@ static int __init gt641xx_timer0_clockevent_init(void)
cd = &gt641xx_timer0_clockevent;
cd->rating = 200 + gt641xx_base_clock / 10000000;
clockevent_set_clock(cd, gt641xx_base_clock);
- cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
cd->max_delta_ticks = 0x7fffffff;
- cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
cd->min_delta_ticks = 0x300;
cd->cpumask = cpumask_of(0);

diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c
index 9d1edb5..8fb7723 100644
--- a/arch/mips/kernel/cevt-sb1250.c
+++ b/arch/mips/kernel/cevt-sb1250.c
@@ -122,9 +122,7 @@ void sb1250_clockevent_init(void)
cd->features = CLOCK_EVT_FEAT_PERIODIC |
CLOCK_EVT_FEAT_ONESHOT;
clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
- cd->max_delta_ns = clockevent_delta2ns(0x7fffff, cd);
cd->max_delta_ticks = 0x7fffff;
- cd->min_delta_ns = clockevent_delta2ns(2, cd);
cd->min_delta_ticks = 2;
cd->rating = 200;
cd->irq = irq;
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
index e651a03..acb56fe 100644
--- a/arch/mips/kernel/cevt-txx9.c
+++ b/arch/mips/kernel/cevt-txx9.c
@@ -194,10 +194,7 @@ void __init txx9_clockevent_init(unsigned long baseaddr, int irq,
txx9_clock_event_device.tmrptr = tmrptr;

clockevent_set_clock(cd, TIMER_CLK(imbusclk));
- cd->max_delta_ns =
- clockevent_delta2ns(0xffffffff >> (32 - TXX9_TIMER_BITS), cd);
cd->max_delta_ticks = 0xffffffff >> (32 - TXX9_TIMER_BITS);
- cd->min_delta_ns = clockevent_delta2ns(0xf, cd);
cd->min_delta_ticks = 0xf;
cd->irq = irq;
cd->cpumask = cpumask_of(0),
diff --git a/arch/mips/loongson32/common/time.c b/arch/mips/loongson32/common/time.c
index bf42507..4e8e6bd 100644
--- a/arch/mips/loongson32/common/time.c
+++ b/arch/mips/loongson32/common/time.c
@@ -198,9 +198,7 @@ static void __init ls1x_time_init(void)
ls1x_pwmtimer_init();

clockevent_set_clock(cd, mips_hpt_frequency);
- cd->max_delta_ns = clockevent_delta2ns(0xffffff, cd);
cd->max_delta_ticks = 0xffffff;
- cd->min_delta_ns = clockevent_delta2ns(0x000300, cd);
cd->min_delta_ticks = 0x000300;
cd->cpumask = cpumask_of(smp_processor_id());
clockevents_register_device(cd);
diff --git a/arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
index fd9a9f2..6bc905c 100644
--- a/arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
+++ b/arch/mips/loongson64/common/cs5536/cs5536_mfgpt.c
@@ -122,9 +122,7 @@ void __init setup_mfgpt0_timer(void)

cd->cpumask = cpumask_of(cpu);
clockevent_set_clock(cd, MFGPT_TICK_RATE);
- cd->max_delta_ns = clockevent_delta2ns(0xffff, cd);
cd->max_delta_ticks = 0xffff;
- cd->min_delta_ns = clockevent_delta2ns(0xf, cd);
cd->min_delta_ticks = 0xf;

/* Enable MFGPT0 Comparator 2 Output to the Interrupt Mapper */
diff --git a/arch/mips/loongson64/loongson-3/hpet.c b/arch/mips/loongson64/loongson-3/hpet.c
index 94f5410..2d407a1 100644
--- a/arch/mips/loongson64/loongson-3/hpet.c
+++ b/arch/mips/loongson64/loongson-3/hpet.c
@@ -240,9 +240,7 @@ void __init setup_hpet_timer(void)
cd->irq = HPET_T0_IRQ;
cd->cpumask = cpumask_of(cpu);
clockevent_set_clock(cd, HPET_FREQ);
- cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
cd->max_delta_ticks = 0x7fffffff;
- cd->min_delta_ns = clockevent_delta2ns(HPET_MIN_PROG_DELTA, cd);
cd->min_delta_ticks = HPET_MIN_PROG_DELTA;

clockevents_register_device(cd);
diff --git a/arch/mips/ralink/cevt-rt3352.c b/arch/mips/ralink/cevt-rt3352.c
index b8a1376..3657f98 100644
--- a/arch/mips/ralink/cevt-rt3352.c
+++ b/arch/mips/ralink/cevt-rt3352.c
@@ -128,9 +128,7 @@ static int __init ralink_systick_init(struct device_node *np)
systick_irqaction.name = np->name;
systick.dev.name = np->name;
clockevents_calc_mult_shift(&systick.dev, SYSTICK_FREQ, 60);
- systick.dev.max_delta_ns = clockevent_delta2ns(0x7fff, &systick.dev);
systick.dev.max_delta_ticks = 0x7fff;
- systick.dev.min_delta_ns = clockevent_delta2ns(0x3, &systick.dev);
systick.dev.min_delta_ticks = 0x3;
systick.dev.irq = irq_of_parse_and_map(np, 0);
if (!systick.dev.irq) {
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index c1e0c84..aad2a6e 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -112,9 +112,7 @@ void hub_rt_clock_event_init(void)
cd->name = name;
cd->features = CLOCK_EVT_FEAT_ONESHOT;
clockevent_set_clock(cd, CYCLES_PER_SEC);
- cd->max_delta_ns = clockevent_delta2ns(0xfffffffffffff, cd);
cd->max_delta_ticks = 0xfffffffffffff;
- cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
cd->min_delta_ticks = 0x300;
cd->rating = 200;
cd->irq = irq;
diff --git a/arch/mn10300/kernel/cevt-mn10300.c b/arch/mn10300/kernel/cevt-mn10300.c
index 2b21bbc..276336b 100644
--- a/arch/mn10300/kernel/cevt-mn10300.c
+++ b/arch/mn10300/kernel/cevt-mn10300.c
@@ -97,9 +97,7 @@ int __init init_clockevents(void)
clockevents_calc_mult_shift(cd, MN10300_JCCLK, 1);

/* Calculate the min / max delta */
- cd->max_delta_ns = clockevent_delta2ns(TMJCBR_MAX, cd);
cd->max_delta_ticks = TMJCBR_MAX;
- cd->min_delta_ns = clockevent_delta2ns(100, cd);
cd->min_delta_ticks = 100;

cd->rating = 200;
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b6b13d9..aefb9dd 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -972,11 +972,7 @@ static void __init init_decrementer_clockevent(void)

clockevents_calc_mult_shift(&decrementer_clockevent, ppc_tb_freq, 4);

- decrementer_clockevent.max_delta_ns =
- clockevent_delta2ns(decrementer_max, &decrementer_clockevent);
decrementer_clockevent.max_delta_ticks = decrementer_max;
- decrementer_clockevent.min_delta_ns =
- clockevent_delta2ns(2, &decrementer_clockevent);
decrementer_clockevent.min_delta_ticks = 2;

register_decrementer_clockevent(cpu);
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 46f2073..5673630 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -157,9 +157,7 @@ void init_cpu_timer(void)
cd->features = CLOCK_EVT_FEAT_ONESHOT;
cd->mult = 16777;
cd->shift = 12;
- cd->min_delta_ns = 1;
cd->min_delta_ticks = 1;
- cd->max_delta_ns = LONG_MAX;
cd->max_delta_ticks = ULONG_MAX;
cd->rating = 400;
cd->cpumask = cpumask_of(cpu);
diff --git a/arch/score/kernel/time.c b/arch/score/kernel/time.c
index 29aafc7..50455e6 100644
--- a/arch/score/kernel/time.c
+++ b/arch/score/kernel/time.c
@@ -79,11 +79,7 @@ void __init time_init(void)
/* setup COMPARE clockevent */
score_clockevent.mult = div_sc(SYSTEM_CLOCK, NSEC_PER_SEC,
score_clockevent.shift);
- score_clockevent.max_delta_ns = clockevent_delta2ns((u32)~0,
- &score_clockevent);
score_clockevent.max_delta_ticks = (u32)~0;
- score_clockevent.min_delta_ns = clockevent_delta2ns(50,
- &score_clockevent) + 1;
score_clockevent.min_delta_ticks = 50;
score_clockevent.cpumask = cpumask_of(0);
clockevents_register_device(&score_clockevent);
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 1203c7c..247c229 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -227,9 +227,7 @@ void register_percpu_ce(int cpu)
ce->shift = 32;
ce->mult = div_sc(sparc_config.clock_rate, NSEC_PER_SEC,
ce->shift);
- ce->max_delta_ns = clockevent_delta2ns(sparc_config.clock_rate, ce);
ce->max_delta_ticks = (unsigned long)sparc_config.clock_rate;
- ce->min_delta_ns = clockevent_delta2ns(100, ce);
ce->min_delta_ticks = 100;

clockevents_register_device(ce);
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 83f0f99..76e1594 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -794,11 +794,7 @@ void __init time_init(void)
sparc64_clockevent.name = tick_ops->name;
clockevents_calc_mult_shift(&sparc64_clockevent, freq, 4);

- sparc64_clockevent.max_delta_ns =
- clockevent_delta2ns(0x7fffffffffffffffUL, &sparc64_clockevent);
sparc64_clockevent.max_delta_ticks = 0x7fffffffffffffffUL;
- sparc64_clockevent.min_delta_ns =
- clockevent_delta2ns(0xF, &sparc64_clockevent);
sparc64_clockevent.min_delta_ticks = 0xF;

printk("clockevent: mult[%x] shift[%d]\n",
diff --git a/arch/tile/kernel/time.c b/arch/tile/kernel/time.c
index c2fd280..3022733 100644
--- a/arch/tile/kernel/time.c
+++ b/arch/tile/kernel/time.c
@@ -153,7 +153,6 @@ static int tile_timer_shutdown(struct clock_event_device *evt)
static DEFINE_PER_CPU(struct clock_event_device, tile_timer) = {
.name = "tile timer",
.features = CLOCK_EVT_FEAT_ONESHOT,
- .min_delta_ns = 1000,
.min_delta_ticks = 1,
.rating = 100,
.irq = -1,
@@ -169,7 +168,6 @@ void setup_tile_timer(void)

/* Fill in fields that are speed-specific. */
clockevents_calc_mult_shift(evt, cycles_per_sec, TILE_MINSEC);
- evt->max_delta_ns = clockevent_delta2ns(MAX_TICK, evt);
evt->max_delta_ticks = MAX_TICK;

/* Mark as being for this cpu only. */
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index 11b96ed..6023d4c 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -64,9 +64,7 @@ static struct clock_event_device timer_clockevent = {
.set_state_oneshot = itimer_one_shot,
.set_next_event = itimer_next_event,
.shift = 0,
- .max_delta_ns = 0xffffffff,
.max_delta_ticks = 0xffffffff,
- .min_delta_ns = TIMER_MIN_DELTA,
.min_delta_ticks = TIMER_MIN_DELTA, // microsecond resolution should be enough for anyone, same as 640K RAM
.irq = 0,
.mult = 1,
diff --git a/arch/unicore32/kernel/time.c b/arch/unicore32/kernel/time.c
index 29c91a9..d2a1c50 100644
--- a/arch/unicore32/kernel/time.c
+++ b/arch/unicore32/kernel/time.c
@@ -89,11 +89,7 @@ void __init time_init(void)

clockevents_calc_mult_shift(&ckevt_puv3_osmr0, CLOCK_TICK_RATE, 5);

- ckevt_puv3_osmr0.max_delta_ns =
- clockevent_delta2ns(0x7fffffff, &ckevt_puv3_osmr0);
ckevt_puv3_osmr0.max_delta_ticks = 0x7fffffff;
- ckevt_puv3_osmr0.min_delta_ns =
- clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_puv3_osmr0) + 1;
ckevt_puv3_osmr0.min_delta_ticks = MIN_OSCR_DELTA * 2;
ckevt_puv3_osmr0.cpumask = cpumask_of(0);

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index eebb677..6522d6c 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -729,11 +729,7 @@ static int __init calibrate_APIC_clock(void)
lapic_timer_frequency);
lapic_clockevent.mult = div_sc(lapic_timer_frequency/APIC_DIVISOR,
TICK_NSEC, lapic_clockevent.shift);
- lapic_clockevent.max_delta_ns =
- clockevent_delta2ns(0x7FFFFF, &lapic_clockevent);
lapic_clockevent.max_delta_ticks = 0x7FFFFF;
- lapic_clockevent.min_delta_ns =
- clockevent_delta2ns(0xF, &lapic_clockevent);
lapic_clockevent.min_delta_ticks = 0xF;
lapic_clockevent.features &= ~CLOCK_EVT_FEAT_DUMMY;
return 0;
@@ -778,11 +774,7 @@ static int __init calibrate_APIC_clock(void)
/* Calculate the scaled math multiplication factor */
lapic_clockevent.mult = div_sc(delta, TICK_NSEC * LAPIC_CAL_LOOPS,
lapic_clockevent.shift);
- lapic_clockevent.max_delta_ns =
- clockevent_delta2ns(0x7FFFFFFF, &lapic_clockevent);
lapic_clockevent.max_delta_ticks = 0x7FFFFFFF;
- lapic_clockevent.min_delta_ns =
- clockevent_delta2ns(0xF, &lapic_clockevent);
lapic_clockevent.min_delta_ticks = 0xF;

lapic_timer_frequency = (delta * APIC_DIVISOR) / LAPIC_CAL_LOOPS;
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 930dabe..8566f85 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -993,9 +993,7 @@ static struct clock_event_device lguest_clockevent = {
.rating = INT_MAX,
.mult = 1,
.shift = 0,
- .min_delta_ns = LG_CLOCK_MIN_DELTA,
.min_delta_ticks = LG_CLOCK_MIN_DELTA,
- .max_delta_ns = LG_CLOCK_MAX_DELTA,
.max_delta_ticks = LG_CLOCK_MAX_DELTA,
};

diff --git a/arch/x86/platform/uv/uv_time.c b/arch/x86/platform/uv/uv_time.c
index 6410ee3..670a545 100644
--- a/arch/x86/platform/uv/uv_time.c
+++ b/arch/x86/platform/uv/uv_time.c
@@ -388,12 +388,8 @@ static __init int uv_rtc_setup_clock(void)
clock_event_device_uv.mult = div_sc(sn_rtc_cycles_per_second,
NSEC_PER_SEC, clock_event_device_uv.shift);

- clock_event_device_uv.min_delta_ns = NSEC_PER_SEC /
- sn_rtc_cycles_per_second;
clock_event_device_uv.min_delta_ticks = 1;

- clock_event_device_uv.max_delta_ns = clocksource_uv.mask *
- (NSEC_PER_SEC / sn_rtc_cycles_per_second);
clock_event_device_uv.max_delta_ticks = clocksource_uv.mask;

rc = schedule_on_each_cpu(uv_rtc_register_clockevents);
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index cfc2f12..d2b9439 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -208,9 +208,7 @@ static const struct clock_event_device xen_timerop_clockevent = {
.name = "xen",
.features = CLOCK_EVT_FEAT_ONESHOT,

- .max_delta_ns = 0xffffffff,
.max_delta_ticks = 0xffffffff,
- .min_delta_ns = TIMER_SLOP,
.min_delta_ticks = TIMER_SLOP,

.mult = 1,
@@ -269,9 +267,7 @@ static const struct clock_event_device xen_vcpuop_clockevent = {
.name = "xen",
.features = CLOCK_EVT_FEAT_ONESHOT,

- .max_delta_ns = 0xffffffff,
.max_delta_ticks = 0xffffffff,
- .min_delta_ns = TIMER_SLOP,
.min_delta_ticks = TIMER_SLOP,

.mult = 1,
diff --git a/drivers/clocksource/dw_apb_timer.c b/drivers/clocksource/dw_apb_timer.c
index 2d68204..8f89b90 100644
--- a/drivers/clocksource/dw_apb_timer.c
+++ b/drivers/clocksource/dw_apb_timer.c
@@ -255,10 +255,7 @@ dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
dw_ced->timer.freq = freq;

clockevents_calc_mult_shift(&dw_ced->ced, freq, APBT_MIN_PERIOD);
- dw_ced->ced.max_delta_ns = clockevent_delta2ns(0x7fffffff,
- &dw_ced->ced);
dw_ced->ced.max_delta_ticks = 0x7fffffff;
- dw_ced->ced.min_delta_ns = clockevent_delta2ns(5000, &dw_ced->ced);
dw_ced->ced.min_delta_ticks = 5000;
dw_ced->ced.cpumask = cpumask_of(cpu);
dw_ced->ced.features = CLOCK_EVT_FEAT_PERIODIC |
diff --git a/drivers/clocksource/metag_generic.c b/drivers/clocksource/metag_generic.c
index 2b08024..5f86bdb 100644
--- a/drivers/clocksource/metag_generic.c
+++ b/drivers/clocksource/metag_generic.c
@@ -113,9 +113,7 @@ static int arch_timer_starting_cpu(unsigned int cpu)
clk->set_next_event = metag_timer_set_next_event,

clk->mult = div_sc(hwtimer_freq, NSEC_PER_SEC, clk->shift);
- clk->max_delta_ns = clockevent_delta2ns(0x7fffffff, clk);
clk->max_delta_ticks = 0x7fffffff;
- clk->min_delta_ns = clockevent_delta2ns(0xf, clk);
clk->min_delta_ticks = 0xf;
clk->cpumask = cpumask_of(cpu);

diff --git a/drivers/clocksource/numachip.c b/drivers/clocksource/numachip.c
index 6a20dc8..8ad51a0 100644
--- a/drivers/clocksource/numachip.c
+++ b/drivers/clocksource/numachip.c
@@ -50,9 +50,7 @@ static struct clock_event_device numachip2_clockevent = {
.features = CLOCK_EVT_FEAT_ONESHOT,
.mult = 1,
.shift = 0,
- .min_delta_ns = 1250,
.min_delta_ticks = 1250,
- .max_delta_ns = LONG_MAX,
.max_delta_ticks = LONG_MAX,
};

diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c
index 97ce6bf..e8bc1e6 100644
--- a/drivers/clocksource/sh_cmt.c
+++ b/drivers/clocksource/sh_cmt.c
@@ -814,9 +814,7 @@ static int sh_cmt_register_clockevent(struct sh_cmt_channel *ch,
/* TODO: calculate good shift from rate and counter bit width */
ced->shift = 32;
ced->mult = div_sc(ch->cmt->rate, NSEC_PER_SEC, ced->shift);
- ced->max_delta_ns = clockevent_delta2ns(ch->max_match_value, ced);
ced->max_delta_ticks = ch->max_match_value;
- ced->min_delta_ns = clockevent_delta2ns(0x1f, ced);
ced->min_delta_ticks = 0x1f;

dev_info(&ch->cmt->pdev->dev, "ch%u: used for clock events\n",
diff --git a/drivers/clocksource/timer-atlas7.c b/drivers/clocksource/timer-atlas7.c
index c95f209..5ef980e 100644
--- a/drivers/clocksource/timer-atlas7.c
+++ b/drivers/clocksource/timer-atlas7.c
@@ -191,9 +191,7 @@ static int sirfsoc_local_timer_starting_cpu(unsigned int cpu)
ce->tick_resume = sirfsoc_timer_shutdown;
ce->set_next_event = sirfsoc_timer_set_next_event;
clockevents_calc_mult_shift(ce, atlas7_timer_rate, 60);
- ce->max_delta_ns = clockevent_delta2ns(-2, ce);
ce->max_delta_ticks = (unsigned long)-2;
- ce->min_delta_ns = clockevent_delta2ns(2, ce);
ce->min_delta_ticks = 2;
ce->cpumask = cpumask_of(cpu);

diff --git a/kernel/time/tick-broadcast-hrtimer.c b/kernel/time/tick-broadcast-hrtimer.c
index 690b797..d0fbbf8 100644
--- a/kernel/time/tick-broadcast-hrtimer.c
+++ b/kernel/time/tick-broadcast-hrtimer.c
@@ -83,8 +83,6 @@ static struct clock_event_device ce_broadcast_hrtimer = {
CLOCK_EVT_FEAT_HRTIMER,
.rating = 0,
.bound_on = -1,
- .min_delta_ns = 1,
- .max_delta_ns = KTIME_MAX,
.min_delta_ticks = 1,
.max_delta_ticks = ULONG_MAX,
.mult = 1,
--
2.10.2