diff options
author | Alexander Sverdlin <alexander.sverdlin@gmail.com> | 2024-09-12 16:21:06 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2024-09-16 11:17:55 +0000 |
commit | d7333f9d33772ba93f0144b1e3969866f80fdb9a (patch) | |
tree | 14d50b2104cddc005aa56de5e378782e255163d1 | |
parent | f3eeba0645dcb48c90f64ae6193148bf881429a8 (diff) | |
download | linux-stable-d7333f9d33772ba93f0144b1e3969866f80fdb9a.tar.gz linux-stable-d7333f9d33772ba93f0144b1e3969866f80fdb9a.tar.bz2 linux-stable-d7333f9d33772ba93f0144b1e3969866f80fdb9a.zip |
dmaengine: cirrus: use snprintf() to calm down gcc 13.3.0
Even though it's a false positive (highest channel number is "9"), refer to
"struct ep93xx_edma_data edma_m2p", we can avoid new warning by using
snprintf().
drivers/dma/ep93xx_dma.c: In function 'ep93xx_dma_of_probe':
>> drivers/dma/ep93xx_dma.c:1365:51: warning: '%u' directive writing between 1 and 8 bytes into a region of size 2 [-Wformat-overflow=]
1365 | sprintf(dma_clk_name, "m2p%u", i);
| ^~
drivers/dma/ep93xx_dma.c:1365:47: note: directive argument in the range [0, 16777216]
1365 | sprintf(dma_clk_name, "m2p%u", i);
| ^~~~~~~
drivers/dma/ep93xx_dma.c:1365:25: note: 'sprintf' output between 5 and 12 bytes into a destination of size 5
1365 | sprintf(dma_clk_name, "m2p%u", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixes: 4e8ad5ed845b ("dmaengine: cirrus: Convert to DT for Cirrus EP93xx")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202409122133.NctarRoK-lkp@intel.com/
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | drivers/dma/ep93xx_dma.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index 7de04e8ace44..8514b9ab8517 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c @@ -1404,9 +1404,9 @@ static struct ep93xx_dma_engine *ep93xx_dma_of_probe(struct platform_device *pde edmac->edma = edma; if (edma->m2m) - sprintf(dma_clk_name, "m2m%u", i); + snprintf(dma_clk_name, sizeof(dma_clk_name), "m2m%u", i); else - sprintf(dma_clk_name, "m2p%u", i); + snprintf(dma_clk_name, sizeof(dma_clk_name), "m2p%u", i); edmac->clk = devm_clk_get(dev, dma_clk_name); if (IS_ERR(edmac->clk)) { |