[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <37603c73-cab7-4973-8705-1deee6445a7d@linaro.org>
Date: Wed, 15 Jan 2025 20:20:40 +0100
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Bart Van Assche <bvanassche@....org>,
Alim Akhtar <alim.akhtar@...sung.com>, Avri Altman <avri.altman@....com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Peter Wang <peter.wang@...iatek.com>, Stanley Jhu <chu.stanley@...il.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mediatek@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] ufs: Use str_enable_disable-like helpers
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
Powered by blists - more mailing lists