From: Bart Van Assche <bvanassche@acm.org>
To: Bragatheswaran Manickavel <bragathemanick0908@gmail.com>,
alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com,
martin.petersen@oracle.com, stanley.chu@mediatek.com,
mani@kernel.org, quic_cang@quicinc.com,
quic_asutoshd@quicinc.com, peter.wang@mediatek.com,
beanhuo@micron.com, quic_nguyenb@quicinc.com,
Arthur.Simchaev@wdc.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ufs/core: ufshcd: Conversion to bool not necessary
Date: Tue, 24 Oct 2023 11:59:35 -0700 [thread overview]
Message-ID: <64aededf-7879-4246-8c1c-bc38ea47e05c@acm.org> (raw)
In-Reply-To: <20231024183401.48888-1-bragathemanick0908@gmail.com>
On 10/24/23 11:34, Bragatheswaran Manickavel wrote:
> A logical evaluation already results in bool. There is no need for using
> a ternary operator based evaluation and bool conversion of the outcome.
>
> Issue identified using boolconv.cocci Coccinelle semantic patch.
>
> Signed-off-by: Bragatheswaran Manickavel <bragathemanick0908@gmail.com>
> ---
> drivers/ufs/core/ufshcd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 406885671665..bbd8e83be6c6 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -2406,7 +2406,7 @@ static inline bool ufshcd_ready_for_uic_cmd(struct ufs_hba *hba)
> int ret = read_poll_timeout(ufshcd_readl, val, val & UIC_COMMAND_READY,
> 500, UIC_CMD_TIMEOUT * 1000, false, hba,
> REG_CONTROLLER_STATUS);
> - return ret == 0 ? true : false;
> + return ret == 0;
> }
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
next prev parent reply other threads:[~2023-10-24 18:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-24 18:34 [PATCH] ufs/core: ufshcd: Conversion to bool not necessary Bragatheswaran Manickavel
2023-10-24 18:59 ` Bart Van Assche [this message]
2023-10-25 2:44 ` Martin K. Petersen
2023-10-25 3:51 ` Bragatheswaran Manickavel
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=64aededf-7879-4246-8c1c-bc38ea47e05c@acm.org \
--to=bvanassche@acm.org \
--cc=Arthur.Simchaev@wdc.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bragathemanick0908@gmail.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=peter.wang@mediatek.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=stanley.chu@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