[RFC v6 19/23] timer_list: print_tickdevice(): calculate ->min_delta_ns dynamically

Nicolai Stange
2016-09-09T20:19:39Z

print_tickdevice(), assembling the per-tick device sections in
/proc/timer_list, is the last user of struct clock_event_device's
->min_delta_ns member.

In order to make this one fully obsolete while retaining userspace ABI,
calculate the displayed value of 'min_delta_ns' on the fly from
->min_delta_ticks_adjusted.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
kernel/time/timer_list.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index ac20d4c..9067760 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -206,10 +206,11 @@ static void
print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
{
struct clock_event_device *dev = td->evtdev;
- u64 max_delta_ns;
+ u64 max_delta_ns, min_delta_ns;

max_delta_ns = clockevent_delta2ns(dev->max_delta_ticks, dev);
max_delta_ns = min(max_delta_ns, dev->max_delta_ns);
+ min_delta_ns = clockevent_delta2ns(dev->min_delta_ticks_adjusted, dev);

SEQ_printf(m, "Tick Device: mode: %d\n", td->mode);
if (cpu < 0)
@@ -226,7 +227,7 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
SEQ_printf(m, " max_delta_ns: %llu\n",
(unsigned long long) max_delta_ns);
SEQ_printf(m, " min_delta_ns: %llu\n",
- (unsigned long long) dev->min_delta_ns);
+ (unsigned long long) min_delta_ns);
SEQ_printf(m, " mult: %u\n", dev->mult);
SEQ_printf(m, " shift: %u\n", dev->shift);
SEQ_printf(m, " mode: %d\n", clockevent_get_state(dev));
--
2.9.3