diff mbox series

[v3] dmaengine: fsl-qdma: check dma_set_mask return value

Message ID 1619427549-20498-1-git-send-email-yibin.gong@nxp.com (mailing list archive)
State Accepted
Commit f0c07993af0acf5545d5c1445798846565f4f147
Headers show
Series [v3] dmaengine: fsl-qdma: check dma_set_mask return value | expand

Commit Message

Robin Gong April 26, 2021, 8:59 a.m. UTC
For fix below warning reported by static code analysis tool like Coverity
from Synopsys:

'CID 12285639 (#1 of 2): Unchecked return value (CHECKED_RETURN)'

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
---
 drivers/dma/fsl-qdma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Vinod Koul May 10, 2021, 2:23 p.m. UTC | #1
On 26-04-21, 16:59, Robin Gong wrote:
> For fix below warning reported by static code analysis tool like Coverity
> from Synopsys:
> 
> 'CID 12285639 (#1 of 2): Unchecked return value (CHECKED_RETURN)'

This should be:
Addresses-Coverity-ID: 12285639 ("Unchecked return value")

I have fixed that up and applied
> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> ---
>  drivers/dma/fsl-qdma.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
> index ed2ab46..045ead4 100644
> --- a/drivers/dma/fsl-qdma.c
> +++ b/drivers/dma/fsl-qdma.c
> @@ -1235,7 +1235,11 @@ static int fsl_qdma_probe(struct platform_device *pdev)
>  	fsl_qdma->dma_dev.device_synchronize = fsl_qdma_synchronize;
>  	fsl_qdma->dma_dev.device_terminate_all = fsl_qdma_terminate_all;
>  
> -	dma_set_mask(&pdev->dev, DMA_BIT_MASK(40));
> +	ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(40));
> +	if (ret) {
> +		dev_err(&pdev->dev, "dma_set_mask failure.\n");
> +		return ret;
> +	}
>  
>  	platform_set_drvdata(pdev, fsl_qdma);
>  
> -- 
> 2.7.4
diff mbox series

Patch

diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index ed2ab46..045ead4 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -1235,7 +1235,11 @@  static int fsl_qdma_probe(struct platform_device *pdev)
 	fsl_qdma->dma_dev.device_synchronize = fsl_qdma_synchronize;
 	fsl_qdma->dma_dev.device_terminate_all = fsl_qdma_terminate_all;
 
-	dma_set_mask(&pdev->dev, DMA_BIT_MASK(40));
+	ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(40));
+	if (ret) {
+		dev_err(&pdev->dev, "dma_set_mask failure.\n");
+		return ret;
+	}
 
 	platform_set_drvdata(pdev, fsl_qdma);