kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] remoteproc: qcom: remove some bogus error handling
@ 2016-06-29 14:40 Dan Carpenter
  2016-07-05 23:43 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-06-29 14:40 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson; +Cc: linux-remoteproc, kernel-janitors

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
index fb4c56c..8abc369 100644
--- a/drivers/remoteproc/qcom_q6v5_pil.c
+++ b/drivers/remoteproc/qcom_q6v5_pil.c
@@ -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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] remoteproc: qcom: remove some bogus error handling
  2016-06-29 14:40 [patch] remoteproc: qcom: remove some bogus error handling Dan Carpenter
@ 2016-07-05 23:43 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2016-07-05 23:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Ohad Ben-Cohen, Bjorn Andersson, linux-remoteproc,
	kernel-janitors

On Wed 29 Jun 07:40 PDT 2016, Dan Carpenter wrote:

> "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

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pil.c b/drivers/remoteproc/qcom_q6v5_pil.c
> index fb4c56c..8abc369 100644
> --- a/drivers/remoteproc/qcom_q6v5_pil.c
> +++ b/drivers/remoteproc/qcom_q6v5_pil.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-05 23:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-29 14:40 [patch] remoteproc: qcom: remove some bogus error handling Dan Carpenter
2016-07-05 23:43 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).