[PATCH 0/4] mfd: stm32-timers: Make register definition more flexible

From: Uwe Kleine-König
Date: Fri Jun 14 2024 - 04:10:49 EST


Hello,

I'm not sure that everyone will agree the changes in here are
worthwhile, but I like them. One surprise is that this makes the
generated code for drivers/pwm/pwm-stm32.c more compact (see patch 4 for
a bloat-o-meter statistic). I'm surprised because it boils down to gcc
not noticing that

mask = ((((1UL))) << (1 + 4 * ((1) - 1))) << (ch * 4);

is equivalent to

mask = ((((1UL))) << (1 + 4 * ((ch + 1) - 1)));

.

I'm unsure what to suggest for how to merge this series. I have some
further changes on my agenda to drivers/pwm/pwm-stm32.c, so either
merging this via pwm or a stable branch would be great for me.

Best regards
Uwe

Uwe Kleine-König (4):
mfd: stm32-timers: Unify alignment of register definition
mfd: stm32-timers: Add some register definitions with a parameter
mfd: stm32-timers: Drop TIM_DIER_CC_IE(x) in favour of
TIM_DIER_CCxIE(x)
pwm-stm32: Make use of parametrised register definitions

drivers/counter/stm32-timer-cnt.c | 4 +-
drivers/pwm/pwm-stm32.c | 22 ++--
include/linux/mfd/stm32-timers.h | 179 ++++++++++++++++--------------
3 files changed, 107 insertions(+), 98 deletions(-)

base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
--
2.43.0