scsi: ufs: core: Conversion to bool not necessary
authorBragatheswaran Manickavel <bragathemanick0908@gmail.com>
Tue, 24 Oct 2023 18:34:01 +0000 (00:04 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 25 Oct 2023 02:44:35 +0000 (22:44 -0400)
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>
Link: https://lore.kernel.org/r/20231024183401.48888-1-bragathemanick0908@gmail.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/core/ufshcd.c

index 24aa7a2de9daa33cad0f79cee8ffc3089b045466..5c1be0a2638b383c3ee0017adb1dcacab5fdec3e 100644 (file)
@@ -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;
 }
 
 /**