[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230310073203.2mpd24pxe5rvm4e7@pengutronix.de>
Date: Fri, 10 Mar 2023 08:32:03 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Bartosz Golaszewski <brgl@...ev.pl>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Schspa Shi <schspa@...il.com>, Marc Zyngier <maz@...nel.org>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-pwm@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
patches@...nsource.cirrus.com,
Linus Walleij <linus.walleij@...aro.org>,
Doug Berger <opendmb@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Andy Shevchenko <andy@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Nandor Han <nandor.han@...com>,
Semi Malinen <semi.malinen@...com>
Subject: Re: [PATCH v1 00/16] gpio: Use string_choices.h
Hi Bart, hi Andy,
On Thu, Mar 09, 2023 at 04:22:19PM +0100, Bartosz Golaszewski wrote:
> I've been thinking about this and I must say it doesn't make much
> sense to me. Not only does it NOT reduce the code size (even if we
> assume the unlikely case where we'd build all those modules that use
> the helpers) but also decreases the readability for anyone not
> familiar with the new interfaces (meaning time spent looking up the
> new function). The "%s", x ? "if" : "else" statement is concise and
> clear already, I don't see much improvement with this series. And I'm
> saying it from the position of someone who loves factoring out common
> code. :)
>
> I'll wait to hear what others have to say but if it were up to me, I'd
> politely say no.
Interpreting this as request to share my view: I'm having the same
doubts. While I'm not a big fan of the ?: operator, it's semantic is
more obvious here.
What I find most difficult about
str_high_low(plr & BIT(j))
(from patch #6) is: Does this give me "high" or "low" if the argument is
zero? You could tell me, and judging from the patch I'd hope that it
would give me "low". But if I stumble over this code in two weeks I
have probably forgotten and have to look it up again.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists