Skip to contentSkip to conversation

scsi: ufs: ufs-qcom: Don't define variable in the middle of the code

PATCH Applied Andy Shevchenko 3 participants 4 messages Oct 13 – Oct 24

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: ufs: ufs-qcom: Don't define variable in the middle of the code

While the C11 allows us to define variables in the code, we do not do this style (see more at [1]). Move the declaration to the top of the function.

---
 drivers/ufs/host/ufs-qcom.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ufs/host/ufs-qcom.c +2 -2
index 91a14a32f205..fee9b54ba5e1 100644
@@ -2439,6 +2439,7 @@ static irqreturn_t ufs_qcom_mcq_esi_handler(int irq, void *data)
 static int ufs_qcom_config_esi(struct ufs_hba *hba)
 {
 	struct ufs_qcom_host *host = ufshcd_get_variant(hba);
+	struct ufs_qcom_irq *qi;
 	int nr_irqs, ret;
 
 	if (host->esi_enabled)
@@ -2457,8 +2458,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 		return ret; /* Continue without ESI */
 	}
 
-	struct ufs_qcom_irq *qi = devm_kcalloc(hba->dev, nr_irqs, sizeof(*qi), GFP_KERNEL);
-
+	qi = devm_kcalloc(hba->dev, nr_irqs, sizeof(*qi), GFP_KERNEL);
 	if (!qi) {
 		platform_device_msi_free_irqs_all(hba->dev);
 		return -ENOMEM;
Signature · 1 line
2.50.1
maintainer Applied
#2 lore raw
In reply to Andy Shevchenko

Andy,

Quoted 3 lines

While the C11 allows us to define variables in the code, we do not do this style (see more at [1]). Move the declaration to the top of the function.

Applied to 7.4/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen