Skip to contentSkip to conversation

remoteproc: qcom: remove some bogus error handling

PATCH In review Dan Carpenter 2 participants 2 messages Jun 29, 2016 – Jul 5, 2016

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

PATCH 1/1 remoteproc: qcom: remove some bogus error handling

"val" can't be negative because it's unsigned and also readl() doesn't return negative error codes.

drivers/remoteproc/qcom_q6v5_pil.c +1 -3
index fb4c56c..8abc369 100644
@@ -386,7 +386,6 @@ static int q6v5_mpss_validate(struct q6v5 *qproc, const struct firmware *fw)
 	phys_addr_t fw_addr;
 	bool relocate;
 	size_t size;
-	u32 val;
 	int ret;
 	int i;
 
@@ -425,8 +424,7 @@ static int q6v5_mpss_validate(struct q6v5 *qproc, const struct firmware *fw)
 		writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
 	}
 
-	val = readl(qproc->rmb_base + RMB_MBA_STATUS_REG);
-	return val < 0 ? val : 0;
+	return readl(qproc->rmb_base + RMB_MBA_STATUS_REG);
 }
 
 static int q6v5_mpss_load(struct q6v5 *qproc)
#1 lore raw
Quoted 3 lines · Dan Carpenter

"val" can't be negative because it's unsigned and also readl() doesn't return negative error codes.

Thanks for catching this. Unfortunately a successful validation will result in status becoming 4 and I check if the return value is non-zero (rather than negative) in q6v5_mpss_load().

However, the next step in the process is to do a timed wait for the status to turn 4 or negative, so we should treat that snippet (check for MBA_AUTH_COMPLETE) as part of the validation and move it in here from q6v5_mpss_load().

Regards,
Bjorn

Quoted 28 lines
drivers/remoteproc/qcom_q6v5_pil.c +1 -4
index fb4c56c..8abc369 100644
@@ -386,7 +386,6 @@ static int q6v5_mpss_validate(struct q6v5 *qproc, const struct firmware *fw)
 	phys_addr_t fw_addr;
 	bool relocate;
 	size_t size;
-	u32 val;
 	int ret;
 	int i;
 
@@ -425,8 +424,7 @@ static int q6v5_mpss_validate(struct q6v5 *qproc, const struct firmware *fw)
 		writel(size, qproc->rmb_base + RMB_PMI_CODE_LENGTH_REG);
 	}
 
-	val = readl(qproc->rmb_base + RMB_MBA_STATUS_REG);
-	return val < 0 ? val : 0;
+	return readl(qproc->rmb_base + RMB_MBA_STATUS_REG);
 }
 
 static int q6v5_mpss_load(struct q6v5 *qproc)
--

To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html