diff mbox series

[v2,1/4] firmware: qcom: scm: Remove log reporting memory allocation failure

Message ID 1711034642-22860-1-git-send-email-quic_mojha@quicinc.com
State Accepted
Commit 3de990f7895906a7a18d2dff63e3e525acaa4ecc
Headers show
Series [v2,1/4] firmware: qcom: scm: Remove log reporting memory allocation failure | expand

Commit Message

Mukesh Ojha March 21, 2024, 3:23 p.m. UTC
Remove redundant memory allocation failure.

WARNING: Possible unnecessary 'out of memory' message
+       if (!mdata_buf) {
+               dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
---
Changes in v2: https://lore.kernel.org/lkml/20240227155308.18395-7-quic_mojha@quicinc.com/
 - Added R-by tag

 drivers/firmware/qcom/qcom_scm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Konrad Dybcio March 22, 2024, 6:22 p.m. UTC | #1
On 21.03.2024 16:24, Mukesh Ojha wrote:
> Remove redundant scm argument from qcom_scm_waitq_wakeup().
> 
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
Mukesh Ojha April 5, 2024, 3:40 p.m. UTC | #2
Gentle ping..

-Mukesh

On 3/21/2024 8:53 PM, Mukesh Ojha wrote:
> Remove redundant memory allocation failure.
> 
> WARNING: Possible unnecessary 'out of memory' message
> +       if (!mdata_buf) {
> +               dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");
> 
> Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
> Reviewed-by: Bjorn Andersson <andersson@kernel.org>
> ---
> Changes in v2: https://lore.kernel.org/lkml/20240227155308.18395-7-quic_mojha@quicinc.com/
>   - Added R-by tag
> 
>   drivers/firmware/qcom/qcom_scm.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
> index 49ddbcab0680..a11fb063cc67 100644
> --- a/drivers/firmware/qcom/qcom_scm.c
> +++ b/drivers/firmware/qcom/qcom_scm.c
> @@ -554,10 +554,9 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
>   	 */
>   	mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys,
>   				       GFP_KERNEL);
> -	if (!mdata_buf) {
> -		dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");
> +	if (!mdata_buf)
>   		return -ENOMEM;
> -	}
> +
>   	memcpy(mdata_buf, metadata, size);
>   
>   	ret = qcom_scm_clk_enable();
Bjorn Andersson April 21, 2024, 10:29 p.m. UTC | #3
On Thu, 21 Mar 2024 20:53:59 +0530, Mukesh Ojha wrote:
> Remove redundant memory allocation failure.
> 
> WARNING: Possible unnecessary 'out of memory' message
> +       if (!mdata_buf) {
> +               dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");
> 
> 
> [...]

Applied, thanks!

[1/4] firmware: qcom: scm: Remove log reporting memory allocation failure
      commit: 3de990f7895906a7a18d2dff63e3e525acaa4ecc
[2/4] firmware: scm: Remove redundant scm argument from qcom_scm_waitq_wakeup()
      commit: 000636d91d605f6209a635a29d0487af5b12b237
[3/4] firmware: qcom: scm: Rework dload mode availability check
      commit: 398a4c58f3f29ac3ff4d777dc91fe40a07bbca8c
[4/4] firmware: qcom: scm: Fix __scm and waitq completion variable initialization
      commit: 2e4955167ec5c04534cebea9e8273a907e7a75e1

Best regards,
diff mbox series

Patch

diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 49ddbcab0680..a11fb063cc67 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -554,10 +554,9 @@  int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
 	 */
 	mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys,
 				       GFP_KERNEL);
-	if (!mdata_buf) {
-		dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");
+	if (!mdata_buf)
 		return -ENOMEM;
-	}
+
 	memcpy(mdata_buf, metadata, size);
 
 	ret = qcom_scm_clk_enable();