Skip to contentSkip to conversation

scsi: ufs: core: Simplify bool conversion

PATCH In review Yang Li 2 participants 2 messages Sep 7, 2023

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 scsi: ufs: core: Simplify bool conversion

./drivers/ufs/core/ufshcd.c:2307:26-31: WARNING: conversion to bool not needed here

---
 drivers/ufs/core/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +1 -1
index c2df07545f96..04bbe38ffd87 100644
@@ -2304,7 +2304,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;
 }
 
 /**
Signature · 1 line
2.20.1.7.g153144c
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Yang Li

./drivers/ufs/core/ufshcd.c:2307:26-31: WARNING: conversion to bool not needed here

---
  drivers/ufs/core/ufshcd.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ufs/core/ufshcd.c +0 -0
index c2df07545f96..04bbe38ffd87 100644

drivers/ufs/core/ufshcd.c static inline bool ufshcd_ready_for_uic_cmd(struct ufs_hba *hba) · line 2308

Quoted 6 lines
drivers/ufs/core/ufshcd.c +1 -1
@@ -2304,7 +2304,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;
  }