From: Lizhi Hou <lizhi.hou@amd.com>
To: Vinod Koul <vkoul@kernel.org>, <dmaengine@vger.kernel.org>,
Brian Xu <brian.xu@amd.com>,
Raj Kumar Rampelli <raj.kumar.rampelli@amd.com>,
"Michal Simek" <michal.simek@amd.com>
Subject: Re: [PATCH] dmaengine: xilinx: xdma: Workaround truncation compilation error
Date: Wed, 3 Jan 2024 08:52:17 -0800 [thread overview]
Message-ID: <e86f5dec-8de0-a6ba-50aa-fc6900bad241@amd.com> (raw)
In-Reply-To: <20231222094017.731917-1-vkoul@kernel.org>
Hi Vinod,
This fix should be xilinx_dpdma driver. (dmaengine: xilinx: xilinx_dpdma)
Thanks,
Lizhi
On 12/22/23 01:40, Vinod Koul wrote:
> Increase length to be copied to be large enough to overcome the
> following compilation error. The buf is large enough for this purpose.
>
> drivers/dma/xilinx/xilinx_dpdma.c: In function ‘xilinx_dpdma_debugfs_desc_done_irq_read’:
> drivers/dma/xilinx/xilinx_dpdma.c:313:39: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
> 313 | snprintf(buf, out_str_len, "%d",
> | ^
> drivers/dma/xilinx/xilinx_dpdma.c:313:9: note: ‘snprintf’ output between 2 and 6 bytes into a destination of size 5
> 313 | snprintf(buf, out_str_len, "%d",
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 314 | dpdma_debugfs.xilinx_dpdma_irq_done_count);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Vinod Koul <vkoul@kernel.org>
> ---
> drivers/dma/xilinx/xilinx_dpdma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/xilinx/xilinx_dpdma.c b/drivers/dma/xilinx/xilinx_dpdma.c
> index 69587d85a7cd..b82815e64d24 100644
> --- a/drivers/dma/xilinx/xilinx_dpdma.c
> +++ b/drivers/dma/xilinx/xilinx_dpdma.c
> @@ -309,7 +309,7 @@ static ssize_t xilinx_dpdma_debugfs_desc_done_irq_read(char *buf)
>
> out_str_len = strlen(XILINX_DPDMA_DEBUGFS_UINT16_MAX_STR);
> out_str_len = min_t(size_t, XILINX_DPDMA_DEBUGFS_READ_MAX_SIZE,
> - out_str_len);
> + out_str_len + 1);
> snprintf(buf, out_str_len, "%d",
> dpdma_debugfs.xilinx_dpdma_irq_done_count);
>
prev parent reply other threads:[~2024-01-03 16:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-22 9:40 [PATCH] dmaengine: xilinx: xdma: Workaround truncation compilation error Vinod Koul
2024-01-03 16:52 ` Lizhi Hou [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e86f5dec-8de0-a6ba-50aa-fc6900bad241@amd.com \
--to=lizhi.hou@amd.com \
--cc=brian.xu@amd.com \
--cc=dmaengine@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=raj.kumar.rampelli@amd.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox