From: "Peter Wang (王信友)" <peter.wang@mediatek.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"bvanassche@acm.org" <bvanassche@acm.org>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "Alice Chao (趙珮均)" <Alice.Chao@mediatek.com>,
"CC Chou (周志杰)" <cc.chou@mediatek.com>,
"Eddie Huang (黃智傑)" <eddie.huang@mediatek.com>,
"Ed Tsai (蔡宗軒)" <Ed.Tsai@mediatek.com>,
wsd_upstream <wsd_upstream@mediatek.com>,
"Chaotian Jing (井朝天)" <Chaotian.Jing@mediatek.com>,
"Chun-Hung Wu (巫駿宏)" <Chun-hung.Wu@mediatek.com>,
"Yi-fan Peng (彭羿凡)" <Yi-fan.Peng@mediatek.com>,
"Qilin Tan (谭麒麟)" <Qilin.Tan@mediatek.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Jiajie Hao (郝加节)" <jiajie.hao@mediatek.com>,
"Lin Gui (桂林)" <Lin.Gui@mediatek.com>,
"Naomi Chu (朱詠田)" <Naomi.Chu@mediatek.com>,
"Tun-yu Yu (游敦聿)" <Tun-yu.Yu@mediatek.com>
Subject: Re: [PATCH v2 1/9] ufs: host: mediatek: Remove unnecessary boolean conversion
Date: Mon, 21 Jul 2025 07:30:18 +0000 [thread overview]
Message-ID: <a1cf6616a5bcce149a7442ed4bb72ea75c9452c9.camel@mediatek.com> (raw)
In-Reply-To: <06cca9bf-e88a-4884-811b-ec103ca6f40f@acm.org>
On Fri, 2025-07-18 at 08:13 -0700, Bart Van Assche wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>
>
> On 7/18/25 2:51 AM, peter.wang@mediatek.com wrote:
> > This patch removes unnecessary boolean conversions to ensure
> > consistency
> > with other usages in ufs-mediatek.c. The changes simplify the code
> > by
> > directly returning the result of bitwise operations without
> > converting
> > them to boolean values.
>
> Hmm ... the conversion to boolean still happens but now happens
> implicitly (by the compiler) instead of explicitly (via !!).
> > diff --git a/drivers/ufs/host/ufs-mediatek.c
> > b/drivers/ufs/host/ufs-mediatek.c
> > index 182f58d0c9db..14f0130da653 100644
> > --- a/drivers/ufs/host/ufs-mediatek.c
> > +++ b/drivers/ufs/host/ufs-mediatek.c
> > @@ -96,28 +96,28 @@ static bool
> > ufs_mtk_is_boost_crypt_enabled(struct ufs_hba *hba)
> > {
> > struct ufs_mtk_host *host = ufshcd_get_variant(hba);
> >
> > - return !!(host->caps & UFS_MTK_CAP_BOOST_CRYPT_ENGINE);
> > + return (host->caps & UFS_MTK_CAP_BOOST_CRYPT_ENGINE);
> > }
>
> How about removing the parentheses too since this patch makes the
> parentheses unnecessary?
>
> Otherwise this patch looks good to me.
Hi Bart,
Removing the parentheses does make it cleaner. I will remove
them in the next version.
Thanks
Peter
>
> Thanks,
>
> Bart.
>
next prev parent reply other threads:[~2025-07-21 7:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-18 9:51 [PATCH v2 0/9] ufs: host: mediatek: Provide features and fixes in MediaTek platforms peter.wang
2025-07-18 9:51 ` [PATCH v2 1/9] ufs: host: mediatek: Remove unnecessary boolean conversion peter.wang
2025-07-18 15:13 ` Bart Van Assche
2025-07-21 7:30 ` Peter Wang (王信友) [this message]
2025-07-18 9:51 ` [PATCH v2 2/9] ufs: host: mediatek: Add DDR_EN setting peter.wang
2025-07-18 15:14 ` Bart Van Assche
2025-07-21 7:31 ` Peter Wang (王信友)
2025-07-18 9:51 ` [PATCH v2 3/9] ufs: host: mediatek: Change ref-clk timeout policy peter.wang
2025-07-18 9:51 ` [PATCH v2 4/9] ufs: host: mediatek: Handle broken RTC based on DTS setting peter.wang
2025-07-18 9:51 ` [PATCH v2 5/9] ufs: host: mediatek: Set IRQ affinity policy for MCQ mode peter.wang
2025-07-18 9:51 ` [PATCH v2 6/9] ufs: host: mediatek: Add more UFSCHI hardware versions peter.wang
2025-07-18 9:51 ` [PATCH v2 7/9] ufs: host: mediatek: Add clock scaling query function peter.wang
2025-07-18 9:51 ` [PATCH v2 8/9] ufs: host: mediatek: Support clock scaling with Vcore binding peter.wang
2025-07-18 9:51 ` [PATCH v2 9/9] ufs: host: mediatek: Support FDE (AES) clock scaling peter.wang
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=a1cf6616a5bcce149a7442ed4bb72ea75c9452c9.camel@mediatek.com \
--to=peter.wang@mediatek.com \
--cc=Alice.Chao@mediatek.com \
--cc=Chaotian.Jing@mediatek.com \
--cc=Chun-hung.Wu@mediatek.com \
--cc=Ed.Tsai@mediatek.com \
--cc=Lin.Gui@mediatek.com \
--cc=Naomi.Chu@mediatek.com \
--cc=Qilin.Tan@mediatek.com \
--cc=Tun-yu.Yu@mediatek.com \
--cc=Yi-fan.Peng@mediatek.com \
--cc=bvanassche@acm.org \
--cc=cc.chou@mediatek.com \
--cc=eddie.huang@mediatek.com \
--cc=jiajie.hao@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=wsd_upstream@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;
as well as URLs for NNTP newsgroup(s).