public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:50: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8
@ 2023-11-03  0:45 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-11-03  0:45 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: oe-kbuild-all, linux-kernel, Vinod Koul, Serge Semin,
	Manivannan Sadhasivam

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   4652b8e4f3ffa48c706ec334f048c217a7d9750d
commit: 353d5c241e83c4de04ca5ec0d7922bfb0809aa25 dmaengine: dw-edma: Add HDMA DebugFS support
date:   5 months ago
config: parisc-randconfig-001-20231102 (https://download.01.org/0day-ci/archive/20231103/202311030809.CjufIFaP-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231103/202311030809.CjufIFaP-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311030809.CjufIFaP-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/dma/dw-edma/dw-hdma-v0-debugfs.c: In function 'dw_hdma_v0_debugfs_on':
>> drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:50: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Wformat-truncation=]
     125 |                 snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
         |                                                  ^~
   In function 'dw_hdma_debugfs_regs_wr',
       inlined from 'dw_hdma_debugfs_regs' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:156:2,
       inlined from 'dw_hdma_v0_debugfs_on' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:169:2:
   drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:46: note: directive argument in the range [-2147483641, 65534]
     125 |                 snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
         |                                              ^~~~~~~
   drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:17: note: 'snprintf' output between 10 and 20 bytes into a destination of size 16
     125 |                 snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/dma/dw-edma/dw-hdma-v0-debugfs.c: In function 'dw_hdma_v0_debugfs_on':
   drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:142:50: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 [-Wformat-truncation=]
     142 |                 snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
         |                                                  ^~
   In function 'dw_hdma_debugfs_regs_rd',
       inlined from 'dw_hdma_debugfs_regs' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:157:2,
       inlined from 'dw_hdma_v0_debugfs_on' at drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:169:2:
   drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:142:46: note: directive argument in the range [-2147483641, 65534]
     142 |                 snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
         |                                              ^~~~~~~
   drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:142:17: note: 'snprintf' output between 10 and 20 bytes into a destination of size 16
     142 |                 snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +125 drivers/dma/dw-edma/dw-hdma-v0-debugfs.c

   115	
   116	static void dw_hdma_debugfs_regs_wr(struct dw_edma *dw, struct dentry *dent)
   117	{
   118		struct dentry *regs_dent, *ch_dent;
   119		char name[16];
   120		int i;
   121	
   122		regs_dent = debugfs_create_dir(WRITE_STR, dent);
   123	
   124		for (i = 0; i < dw->wr_ch_cnt; i++) {
 > 125			snprintf(name, sizeof(name), "%s:%d", CHANNEL_STR, i);
   126	
   127			ch_dent = debugfs_create_dir(name, regs_dent);
   128	
   129			dw_hdma_debugfs_regs_ch(dw, EDMA_DIR_WRITE, i, ch_dent);
   130		}
   131	}
   132	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-03  0:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-03  0:45 drivers/dma/dw-edma/dw-hdma-v0-debugfs.c:125:50: warning: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox