diff mbox series

[2/3] dmaengine: fsl-qdma: increase size of 'irq_name'

Message ID 20240119124944.152562-2-vkoul@kernel.org (mailing list archive)
State Accepted
Commit 6386f6c995b3ab91c72cfb76e4465553c555a8da
Headers show
Series [1/3] dmaengine: shdma: increase size of 'dev_id' | expand

Commit Message

Vinod Koul Jan. 19, 2024, 12:49 p.m. UTC
We seem to have hit warnings of 'output may be truncated' which is fixed
by increasing the size of 'irq_name'

drivers/dma/fsl-qdma.c: In function ‘fsl_qdma_irq_init’:
drivers/dma/fsl-qdma.c:824:46: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]
  824 |                 sprintf(irq_name, "qdma-queue%d", i);
      |                                              ^~
drivers/dma/fsl-qdma.c:824:35: note: directive argument in the range [-2147483641, 2147483646]
  824 |                 sprintf(irq_name, "qdma-queue%d", i);
      |                                   ^~~~~~~~~~~~~~
drivers/dma/fsl-qdma.c:824:17: note: ‘sprintf’ output between 12 and 22 bytes into a destination of size 20
  824 |                 sprintf(irq_name, "qdma-queue%d", i);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/dma/fsl-qdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Frank Li Jan. 19, 2024, 5:18 p.m. UTC | #1
On Fri, Jan 19, 2024 at 06:19:43PM +0530, Vinod Koul wrote:
> We seem to have hit warnings of 'output may be truncated' which is fixed
> by increasing the size of 'irq_name'
> 
> drivers/dma/fsl-qdma.c: In function ‘fsl_qdma_irq_init’:
> drivers/dma/fsl-qdma.c:824:46: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]
>   824 |                 sprintf(irq_name, "qdma-queue%d", i);
>       |                                              ^~
> drivers/dma/fsl-qdma.c:824:35: note: directive argument in the range [-2147483641, 2147483646]
>   824 |                 sprintf(irq_name, "qdma-queue%d", i);
>       |                                   ^~~~~~~~~~~~~~
> drivers/dma/fsl-qdma.c:824:17: note: ‘sprintf’ output between 12 and 22 bytes into a destination of size 20
>   824 |                 sprintf(irq_name, "qdma-queue%d", i);
>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/dma/fsl-qdma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
> index 47cb28468049..a1d0aa63142a 100644
> --- a/drivers/dma/fsl-qdma.c
> +++ b/drivers/dma/fsl-qdma.c
> @@ -805,7 +805,7 @@ fsl_qdma_irq_init(struct platform_device *pdev,
>  	int i;
>  	int cpu;
>  	int ret;
> -	char irq_name[20];
> +	char irq_name[32];
>  
>  	fsl_qdma->error_irq =
>  		platform_get_irq_byname(pdev, "qdma-error");
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index 47cb28468049..a1d0aa63142a 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -805,7 +805,7 @@  fsl_qdma_irq_init(struct platform_device *pdev,
 	int i;
 	int cpu;
 	int ret;
-	char irq_name[20];
+	char irq_name[32];
 
 	fsl_qdma->error_irq =
 		platform_get_irq_byname(pdev, "qdma-error");