[RFC v4 19/22] clockevents: purge ->min_delta_ns and ->max_delta_ns
From: Nicolai Stange
Date: Mon Aug 22 2016 - 19:35:38 EST
The struct clock_event_device ->min_delta_ns and ->max_delta_ns aren't
used anymore.
Purge them.
In __clockevents_update_bounds(), shortcut the
->min_delta_ticks => ->min_delta_ns => ->min_delta_ticks_adjusted
calculation detour -- it had been made solely for the purpose of ensuring
that ->min_delta_ticks_adjusted corresponds to something >= 1us.
Signed-off-by: Nicolai Stange <nicstange@xxxxxxxxx>
---
include/linux/clockchips.h | 4 ----
kernel/time/clockevents.c | 13 +++++--------
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 8578e24..4b71882 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -87,8 +87,6 @@ enum clock_event_state {
* @tick_resume: resume clkevt device
* @broadcast: function to broadcast events
* @min_delta_ticks: minimum delta value in ticks stored for reconfiguration
- * @max_delta_ns: maximum delta value in ns
- * @min_delta_ns: minimum delta value in ns
* @name: ptr to clock event name
* @rating: variable to rate clock event devices
* @irq: IRQ number (only for non CPU local devices)
@@ -120,8 +118,6 @@ struct clock_event_device {
void (*suspend)(struct clock_event_device *);
void (*resume)(struct clock_event_device *);
unsigned long min_delta_ticks;
- u64 max_delta_ns;
- u64 min_delta_ns;
const char *name;
int rating;
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index bb3b98c..c59d6f2 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -444,15 +444,12 @@ static void __clockevents_update_bounds(struct clock_event_device *dev)
return;
/*
- * cev_delta2ns() never returns values less than 1us and thus,
- * we'll never program any ced with anything less.
+ * Enforce ->min_delta_ticks_adjusted to correspond to a value
+ * >= 1us.
*/
- dev->min_delta_ns = cev_delta2ns(dev->min_delta_ticks, dev, false);
- dev->max_delta_ns = cev_delta2ns(dev->max_delta_ticks, dev, true);
- dev->min_delta_ticks_adjusted = (unsigned long)((dev->min_delta_ns *
- dev->mult) >> dev->shift);
- dev->min_delta_ticks_adjusted = max(dev->min_delta_ticks_adjusted,
- dev->min_delta_ticks);
+ dev->min_delta_ticks_adjusted =
+ max(dev->min_delta_ticks,
+ (unsigned long)((1000ULL * dev->mult) >> dev->shift));
}
/**
--
2.9.2