From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Bart Van Assche <bvanassche@acm.org>,
Alim Akhtar <alim.akhtar@samsung.com>,
Avri Altman <avri.altman@wdc.com>,
"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Peter Wang <peter.wang@mediatek.com>,
Stanley Jhu <chu.stanley@gmail.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ufs: Use str_enable_disable-like helpers
Date: Wed, 15 Jan 2025 20:20:40 +0100 [thread overview]
Message-ID: <37603c73-cab7-4973-8705-1deee6445a7d@linaro.org> (raw)
In-Reply-To: <ca5482da-1612-4fab-bfeb-bdc72cd65662@acm.org>
On 15/01/2025 18:53, Bart Van Assche wrote:
> On 1/14/25 12:07 PM, Krzysztof Kozlowski wrote:
>> 2. Is slightly shorter thus also easier to read.
>
> Does this change really make code easier to read? It forces readers
> of the code to look up a function definition. Isn't there a general
There is no general preference, up to you.
> preference in the Linux kernel to inline function definitions if the
> function body is shorter than or close to the length of the function
> name? I'm referring to functions like this one:
>
> static inline const char *str_up_down(bool v)
> {
> return v ? "up" : "down";
> }
>
> Bart.
It's subjective - in some places ternary is really complicating, from my
other patch:
data & XCSI_DLXINFR_SOTERR ? "true" : "false",
video->hq_mode ? "on" : "off", video->jpeg_hq_quality);
note that's ternary is split here:
dstat & BT848_DSTATUS_HLOC
? "yes" : "no");
I understand if you don't find the code here better.
Best regards,
Krzysztof
prev parent reply other threads:[~2025-01-15 19:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250114200726epcas5p4dc896686dd6cdcc449344dbef87af21d@epcas5p4.samsung.com>
2025-01-14 20:07 ` [PATCH] ufs: Use str_enable_disable-like helpers Krzysztof Kozlowski
2025-01-15 4:02 ` Alim Akhtar
2025-01-15 11:50 ` Peter Wang (王信友)
2025-01-15 17:53 ` Bart Van Assche
2025-01-15 19:20 ` Krzysztof Kozlowski [this message]
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=37603c73-cab7-4973-8705-1deee6445a7d@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=alim.akhtar@samsung.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=chu.stanley@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=peter.wang@mediatek.com \
/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