Re: [patch 26/29] x86/hpet: Consolidate clockevent functions

From: Ingo Molnar
Date: Wed Jun 26 2019 - 17:18:00 EST



* Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:

> @@ -440,11 +419,11 @@ static struct hpet_channel hpet_channel0
> .name = "hpet",
> .features = CLOCK_EVT_FEAT_PERIODIC |
> CLOCK_EVT_FEAT_ONESHOT,
> - .set_state_periodic = hpet_legacy_set_periodic,
> - .set_state_oneshot = hpet_legacy_set_oneshot,
> - .set_state_shutdown = hpet_legacy_shutdown,
> - .tick_resume = hpet_legacy_resume,
> - .set_next_event = hpet_legacy_next_event,
> + .set_state_periodic = hpet_clkevt_set_periodic,
> + .set_state_oneshot = hpet_clkevt_set_oneshot,
> + .set_state_shutdown = hpet_clkevt_shutdown,
> + .tick_resume = hpet_clkevt_legacy_resume,
> + .set_next_event = hpet_clkevt_set_next_event,
> .irq = 0,
> .rating = 50,

> - evt->set_state_shutdown = hpet_msi_shutdown;
> - evt->set_state_oneshot = hpet_msi_set_oneshot;
> - evt->tick_resume = hpet_msi_resume;
> - evt->set_next_event = hpet_msi_next_event;
> + evt->set_state_shutdown = hpet_clkevt_shutdown;
> + evt->set_state_oneshot = hpet_clkevt_set_oneshot;
> + evt->set_next_event = hpet_clkevt_set_next_event;
> + evt->tick_resume = hpet_clkevt_msi_resume;
> evt->cpumask = cpumask_of(hc->cpu);

My compulsive-obsessive half really wants this to look like:

> + evt->set_state_shutdown = hpet_clkevt_shutdown;
> + evt->set_state_oneshot = hpet_clkevt_set_oneshot;
> + evt->set_next_event = hpet_clkevt_set_next_event;
> + evt->tick_resume = hpet_clkevt_msi_resume;
> evt->cpumask = cpumask_of(hc->cpu);

:-)

Also, maybe harmonize the callback names with the local function names,
like hpet_clkevt_set_next_event() already does and
hpet_clkevt_set_oneshot() almost does:

s/hpet_clkevt_shutdown
/hpet_clkevt_set_state_shutdown

s/hpet_clkevt_set_oneshot
/hpet_clkevt_set_state_oneshot

s/hpet_clkevt_msi_resume
/hpet_clkevt_tick_resume

... unless the name variations have some hidden purpose and meaning?

With that fixed:

Reviewed-by: Ingo Molnar <mingo@xxxxxxxxxx>

Thanks,

Ingo