[linux-next:master 11947/12283] drivers/dma/ep93xx_dma.c:1409:74: warning: '%u' directive output may be truncated writing between 1 and 8 bytes into a region of size 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   4f3e012d4cfd1d9bf837870c961f462ca9f23ebe
commit: d7333f9d33772ba93f0144b1e3969866f80fdb9a [11947/12283] dmaengine: cirrus: use snprintf() to calm down gcc 13.3.0
config: arm-ep93xx_defconfig (https://download.01.org/0day-ci/archive/20240917/202409172024.pU8U5beA-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240917/202409172024.pU8U5beA-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409172024.pU8U5beA-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/dma/ep93xx_dma.c: In function 'ep93xx_dma_of_probe':
>> drivers/dma/ep93xx_dma.c:1409:74: warning: '%u' directive output may be truncated writing between 1 and 8 bytes into a region of size 2 [-Wformat-truncation=]
    1409 |                         snprintf(dma_clk_name, sizeof(dma_clk_name), "m2p%u", i);
         |                                                                          ^~
   drivers/dma/ep93xx_dma.c:1409:70: note: directive argument in the range [0, 20259280]
    1409 |                         snprintf(dma_clk_name, sizeof(dma_clk_name), "m2p%u", i);
         |                                                                      ^~~~~~~
   drivers/dma/ep93xx_dma.c:1409:25: note: 'snprintf' output between 5 and 12 bytes into a destination of size 5
    1409 |                         snprintf(dma_clk_name, sizeof(dma_clk_name), "m2p%u", i);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/dma/ep93xx_dma.c:1407:74: warning: '%u' directive output may be truncated writing between 1 and 8 bytes into a region of size 2 [-Wformat-truncation=]
    1407 |                         snprintf(dma_clk_name, sizeof(dma_clk_name), "m2m%u", i);
         |                                                                          ^~
   drivers/dma/ep93xx_dma.c:1407:70: note: directive argument in the range [0, 20259280]
    1407 |                         snprintf(dma_clk_name, sizeof(dma_clk_name), "m2m%u", i);
         |                                                                      ^~~~~~~
   drivers/dma/ep93xx_dma.c:1407:25: note: 'snprintf' output between 5 and 12 bytes into a destination of size 5
    1407 |                         snprintf(dma_clk_name, sizeof(dma_clk_name), "m2m%u", i);
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +1409 drivers/dma/ep93xx_dma.c

  1368	
  1369	static struct ep93xx_dma_engine *ep93xx_dma_of_probe(struct platform_device *pdev)
  1370	{
  1371		const struct ep93xx_edma_data *data;
  1372		struct device *dev = &pdev->dev;
  1373		struct ep93xx_dma_engine *edma;
  1374		struct dma_device *dma_dev;
  1375		char dma_clk_name[5];
  1376		int i;
  1377	
  1378		data = device_get_match_data(dev);
  1379		if (!data)
  1380			return ERR_PTR(dev_err_probe(dev, -ENODEV, "No device match found\n"));
  1381	
  1382		edma = devm_kzalloc(dev, struct_size(edma, channels, data->num_channels),
  1383				    GFP_KERNEL);
  1384		if (!edma)
  1385			return ERR_PTR(-ENOMEM);
  1386	
  1387		edma->m2m = data->id;
  1388		edma->num_channels = data->num_channels;
  1389		dma_dev = &edma->dma_dev;
  1390	
  1391		INIT_LIST_HEAD(&dma_dev->channels);
  1392		for (i = 0; i < edma->num_channels; i++) {
  1393			struct ep93xx_dma_chan *edmac = &edma->channels[i];
  1394	
  1395			edmac->chan.device = dma_dev;
  1396			edmac->regs = devm_platform_ioremap_resource(pdev, i);
  1397			if (IS_ERR(edmac->regs))
  1398				return edmac->regs;
  1399	
  1400			edmac->irq = fwnode_irq_get(dev_fwnode(dev), i);
  1401			if (edmac->irq < 0)
  1402				return ERR_PTR(edmac->irq);
  1403	
  1404			edmac->edma = edma;
  1405	
  1406			if (edma->m2m)
  1407				snprintf(dma_clk_name, sizeof(dma_clk_name), "m2m%u", i);
  1408			else
> 1409				snprintf(dma_clk_name, sizeof(dma_clk_name), "m2p%u", i);
  1410	
  1411			edmac->clk = devm_clk_get(dev, dma_clk_name);
  1412			if (IS_ERR(edmac->clk)) {
  1413				dev_err_probe(dev, PTR_ERR(edmac->clk),
  1414					      "no %s clock found\n", dma_clk_name);
  1415				return ERR_CAST(edmac->clk);
  1416			}
  1417	
  1418			spin_lock_init(&edmac->lock);
  1419			INIT_LIST_HEAD(&edmac->active);
  1420			INIT_LIST_HEAD(&edmac->queue);
  1421			INIT_LIST_HEAD(&edmac->free_list);
  1422			tasklet_setup(&edmac->tasklet, ep93xx_dma_tasklet);
  1423	
  1424			list_add_tail(&edmac->chan.device_node,
  1425				      &dma_dev->channels);
  1426		}
  1427	
  1428		return edma;
  1429	}
  1430	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux