[PATCH] hwmon: (aspeed-g6-pwm-tacho): Drop cpp define only used once

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Fri Apr 12 00:15:41 PDT 2024


On Thu, Apr 11, 2024 at 11:15:05AM -0700, Guenter Roeck wrote:
> On Thu, Apr 11, 2024 at 06:01:36PM +0200, Uwe Kleine-König wrote:
> > The macro PWM_ASPEED_NR_PWMS is only used once, just use it's value in
> > this single code line.
> 
> I am not part of the thou-shalt-not-use-defines-if-only-used-once
> crowd, so I won't take this patch, sorry.

My patch wasn't about religion. It's more that I was annoyed that

	git grep pwmchip_alloc next/master drivers/hwmon

doesn't give me the number of PWM channels. That PWM_ASPEED_NR_PWMS is
only used once then only the detail that makes it easy to actually
change that.

So in my eyes there is no advantage in this define and the only effect
is that it hides information.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240412/1e2a33d2/attachment.sig>


More information about the linux-arm-kernel mailing list