Skip to contentSkip to conversation

scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function

PATCH Applied Chanwoo Lee 4 participants 4 messages Dec 19, 2023 – Jan 4, 2024 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): CGME20231219082757epcas1p33bda4e0723d3d57552132054d3e5a3fe@epcas1p3.samsung.com

#1 lore raw

PATCH 1/1 scsi: ufs: qcom: Remove unnecessary goto statement from ufs_qcom_config_esi function

From: ChanWoo Lee <[email protected]>

There is only one place where goto is used,
and it is unnecessary to check the ret value through 'goto out' because the ret value is already true.

Therefore, remove the goto statement and integrate the '!ret' condition into the existing code.

---
 drivers/ufs/host/ufs-qcom.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/ufs/host/ufs-qcom.c +2 -5
index 17e24270477d..8cf803806326 100644
@@ -1929,7 +1929,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 					     ufs_qcom_write_msi_msg);
 	if (ret) {
 		dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
-		goto out;
+		return ret;
 	}
 
 	msi_lock_descs(hba->dev);
@@ -1964,11 +1964,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 				      REG_UFS_CFG3);
 		}
 		ufshcd_mcq_enable_esi(hba);
-	}
-
-out:
-	if (!ret)
 		host->esi_enabled = true;
+	}
 
 	return ret;
 }
Signature · 1 line
2.29.0
Reviewed-by on v1 1/1
#2 lore raw

Le 19/12/2023 à 09:27, Chanwoo Lee a écrit :

Quoted 10 lines

From: ChanWoo Lee <[email protected]>

There is only one place where goto is used,
and it is unnecessary to check the ret value through 'goto out' because the ret value is already true.

Therefore, remove the goto statement and integrate the '!ret' condition into the existing code.

Quoted 30 lines
---
  drivers/ufs/host/ufs-qcom.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
drivers/ufs/host/ufs-qcom.c +2 -5
index 17e24270477d..8cf803806326 100644
@@ -1929,7 +1929,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
  					     ufs_qcom_write_msi_msg);
  	if (ret) {
  		dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
-		goto out;
+		return ret;
  	}
 
  	msi_lock_descs(hba->dev);
@@ -1964,11 +1964,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
  				      REG_UFS_CFG3);
  		}
  		ufshcd_mcq_enable_esi(hba);
-	}
-
-out:
-	if (!ret)
  		host->esi_enabled = true;
+	}
 
  	return ret;
  }
maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Chanwoo Lee
Quoted 10 lines · Chanwoo Lee

From: ChanWoo Lee <[email protected]>

There is only one place where goto is used,
and it is unnecessary to check the ret value through 'goto out' because the ret value is already true.

Therefore, remove the goto statement and integrate the '!ret' condition into the existing code.

- Mani

Quoted 33 lines
---
 drivers/ufs/host/ufs-qcom.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/ufs/host/ufs-qcom.c +2 -5
index 17e24270477d..8cf803806326 100644
@@ -1929,7 +1929,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 					     ufs_qcom_write_msi_msg);
 	if (ret) {
 		dev_err(hba->dev, "Failed to request Platform MSI %d\n", ret);
-		goto out;
+		return ret;
 	}
 
 	msi_lock_descs(hba->dev);
@@ -1964,11 +1964,8 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 				      REG_UFS_CFG3);
 		}
 		ufshcd_mcq_enable_esi(hba);
-	}
-
-out:
-	if (!ret)
 		host->esi_enabled = true;
+	}
 
 	return ret;
 }
Signature · 1 line
2.29.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#4 lore raw
In reply to Chanwoo Lee

Chanwoo,

Quoted 3 lines

There is only one place where goto is used, and it is unnecessary to check the ret value through 'goto out' because the ret value is already true.

Applied to 6.8/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering