From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Doug Berger" <opendmb@gmail.com>,
"Florian Fainelli" <florian.fainelli@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Andy Shevchenko" <andy@kernel.org>,
"Uwe Kleine-König" <ukleinek@kernel.org>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Kuppuswamy Sathyanarayanan"
<sathyanarayanan.kuppuswamy@linux.intel.com>,
"Nandor Han" <nandor.han@ge.com>,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
patches@opensource.cirrus.com
Subject: Re: [PATCH v2] gpio: Use str_enable_disable-like helpers
Date: Wed, 15 Jan 2025 14:00:14 +0100 [thread overview]
Message-ID: <110c9b58-9ac1-4a24-84da-4dfc722f1ea4@linaro.org> (raw)
In-Reply-To: <CACRpkdaer2vedtupM7QW6W2KZF6N+yKN2V93URd2PbT9xfZKeQ@mail.gmail.com>
On 15/01/2025 12:51, Linus Walleij wrote:
> On Tue, Jan 14, 2025 at 8:14 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>
>> Replace ternary (condition ? "enable" : "disable") syntax with helpers
>> from string_choices.h because:
>> 1. Simple function call with one argument is easier to read. Ternary
>> operator has three arguments and with wrapping might lead to quite
>> long code.
>> 2. Is slightly shorter thus also easier to read.
>> 3. It brings uniformity in the text - same string.
>> 4. Allows deduping by the linker, which results in a smaller binary
>> file.
>>
>> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> For a while I was critical about the string helpers but since both Andy
> and Krzysztof like them, I will consider myself convinced and start to
> like them instead.
It is pretty subjective, so I also find reasonable not to accept them to
your subsystem. To me they bring more benefits in complicated cases like:
(data_in ^ in_pol) & msk ? "hi" : "lo",
or from pinctr (note the line break):
seq_puts(s, pin->output_value ?
"high" : "low");
Anyway, thanks for review!
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-01-15 13:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 19:14 Krzysztof Kozlowski
2025-01-14 23:19 ` Doug Berger
2025-01-15 10:24 ` Charles Keepax
2025-01-15 11:51 ` Linus Walleij
2025-01-15 13:00 ` Krzysztof Kozlowski [this message]
2025-02-03 8:13 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=110c9b58-9ac1-4a24-84da-4dfc722f1ea4@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andy@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=brgl@bgdev.pl \
--cc=florian.fainelli@broadcom.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=nandor.han@ge.com \
--cc=opendmb@gmail.com \
--cc=patches@opensource.cirrus.com \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®