mbox series

[0/3] pwm: stm32: Minor cleanups

Message ID 20191016073842.1300297-1-thierry.reding@gmail.com
Headers show
Series pwm: stm32: Minor cleanups | expand

Message

Thierry Reding Oct. 16, 2019, 7:38 a.m. UTC
Hi,

Looking at Fabrice's STM32 patches I noticed that we're now passing the
breakinput values (u32) into a function via int parameters. The easiest
way to fix this inconsistency is by just passing a pointer to the break
input structure. There's some preparatory work here that makes the code
slightly more readable, in my opinion, but it's really marginal, so I'm
not terribly thrilled by this series in retrospect.

If nobody else thinks this is a big improvement I'll just scrap it.

Thierry

Thierry Reding (3):
  pwm: stm32: Remove clutter from ternary operator
  pwm: stm32: Remove confusing bitmask
  pwm: stm32: Pass breakinput instead of its values

 drivers/pwm/pwm-stm32.c | 37 ++++++++++++++++++++-----------------
 1 file changed, 20 insertions(+), 17 deletions(-)

Comments

Uwe Kleine-König Oct. 16, 2019, 8:33 a.m. UTC | #1
On Wed, Oct 16, 2019 at 09:38:39AM +0200, Thierry Reding wrote:
> Hi,
> 
> Looking at Fabrice's STM32 patches I noticed that we're now passing the
> breakinput values (u32) into a function via int parameters. The easiest
> way to fix this inconsistency is by just passing a pointer to the break
> input structure. There's some preparatory work here that makes the code
> slightly more readable, in my opinion, but it's really marginal, so I'm
> not terribly thrilled by this series in retrospect.
> 
> If nobody else thinks this is a big improvement I'll just scrap it.

I like it. Together with my suggestion to add parameters to the register
offsets I think it's worth the effort.

Best regards
Uwe