public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ufs/core: ufshcd: Conversion to bool not necessary
@ 2023-10-24 18:34 Bragatheswaran Manickavel
  2023-10-24 18:59 ` Bart Van Assche
  2023-10-25  2:44 ` Martin K. Petersen
  0 siblings, 2 replies; 4+ messages in thread
From: Bragatheswaran Manickavel @ 2023-10-24 18:34 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, bvanassche, jejb, martin.petersen,
	stanley.chu, mani, quic_cang, quic_asutoshd, peter.wang, beanhuo,
	quic_nguyenb, Arthur.Simchaev
  Cc: Bragatheswaran Manickavel, linux-scsi, linux-kernel

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;
 }
 
 /**
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-25  3:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 18:34 [PATCH] ufs/core: ufshcd: Conversion to bool not necessary Bragatheswaran Manickavel
2023-10-24 18:59 ` Bart Van Assche
2023-10-25  2:44 ` Martin K. Petersen
2023-10-25  3:51   ` Bragatheswaran Manickavel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox