[RFC v8 18/28] clockevents: purge ->min_delta_ns

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


The struct clock_event_device's ->min_delta_ns member isn't used anymore.

Purge it.

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 | 2 --
kernel/time/clockevents.c | 13 +++++++------
2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 6342b76..5c4670a 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -88,7 +88,6 @@ enum clock_event_state {
* @broadcast: function to broadcast events
* @min_delta_ticks: minimum delta value in ticks stored for reconfiguration
* @max_delta_ticks: maximum delta value in ticks stored for reconfiguration
- * @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)
@@ -121,7 +120,6 @@ struct clock_event_device {
void (*resume)(struct clock_event_device *);
unsigned long min_delta_ticks;
unsigned long max_delta_ticks;
- u64 min_delta_ns;

const char *name;
int rating;
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 36dd024..57b00b0 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -443,14 +443,15 @@ static void __clockevents_update_bounds(struct clock_event_device *dev)
(dev->features & CLOCK_EVT_FEAT_DUMMY))
return;

+ dev->max_delta_ns = cev_delta2ns(dev->max_delta_ticks, dev, true);
+
/*
- * 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,
+ (unsigned long)((1000ULL * dev->mult) >> dev->shift));
}

/**
--
2.10.2