Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clocksource/drivers/vf-pit: Encapsulate set counter function

Encapsulate the writel() calls to set the counter into a
self-explainatory function.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20250804152344.1109310-16-daniel.lezcano@linaro.org

+7 -2
+7 -2
drivers/clocksource/timer-vf-pit.c
··· 74 74 writel(0, PITTCTRL(pit->clkevt_base)); 75 75 } 76 76 77 + static inline void pit_timer_set_counter(void __iomem *base, unsigned int cnt) 78 + { 79 + writel(cnt, PITLDVAL(base)); 80 + } 81 + 77 82 static inline void pit_clocksource_enable(struct pit_timer *pit) 78 83 { 79 84 writel(PITTCTRL_TEN, PITTCTRL(pit->clksrc_base)); ··· 123 118 124 119 /* set the max load value and start the clock source counter */ 125 120 pit_clocksource_disable(pit); 126 - writel(~0, PITLDVAL(pit->clksrc_base)); 121 + pit_timer_set_counter(pit->clksrc_base, ~0); 127 122 pit_clocksource_enable(pit); 128 123 129 124 sched_clock_base = pit->clksrc_base + PITCVAL_OFFSET; ··· 144 139 * hardware requirement. 145 140 */ 146 141 pit_timer_disable(pit); 147 - writel(delta - 1, PITLDVAL(pit->clkevt_base)); 142 + pit_timer_set_counter(pit->clkevt_base, delta - 1); 148 143 pit_timer_enable(pit); 149 144 150 145 return 0;