From: "Alim Akhtar" <alim.akhtar@samsung.com>
To: "'Krzysztof Kozlowski'" <krzysztof.kozlowski@linaro.org>,
"'Avri Altman'" <avri.altman@wdc.com>,
"'Bart Van Assche'" <bvanassche@acm.org>,
"'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>
Cc: <cpgs@samsung.com>
Subject: RE: [PATCH] ufs: Use str_enable_disable-like helpers
Date: Wed, 15 Jan 2025 09:32:46 +0530 [thread overview]
Message-ID: <1891546521.01736915882616.JavaMail.epsvc@epcpadp2new> (raw)
In-Reply-To: <20250114200716.969457-1-krzysztof.kozlowski@linaro.org>
Hello Krzysztof,
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Wednesday, January 15, 2025 1:37 AM
> To: Alim Akhtar <alim.akhtar@samsung.com>; Avri Altman
> <avri.altman@wdc.com>; Bart Van Assche <bvanassche@acm.org>; 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
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Subject: [PATCH] ufs: Use str_enable_disable-like helpers
>
> 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.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
> drivers/ufs/core/ufshcd.c | 11 ++++++-----
> drivers/ufs/host/ufs-mediatek.c | 7 +++----
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
On a side note, there are other host controller driver (e.g. exynos and
Qcomm) which also uses few conditional operators, But I didn't find a
matching helper in string_choices.h, so may be that can be taken separately
in future.
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index
> 27154a5dcb7b..5225d48a47f8 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
[Snip]
> --
> 2.43.0
next prev parent reply other threads:[~2025-01-15 4:39 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 [this message]
2025-01-15 11:50 ` Peter Wang (王信友)
2025-01-15 17:53 ` Bart Van Assche
2025-01-15 19:20 ` Krzysztof Kozlowski
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=1891546521.01736915882616.JavaMail.epsvc@epcpadp2new \
--to=alim.akhtar@samsung.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=avri.altman@wdc.com \
--cc=bvanassche@acm.org \
--cc=chu.stanley@gmail.com \
--cc=cpgs@samsung.com \
--cc=krzysztof.kozlowski@linaro.org \
--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