The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:36: warning: '%d' directive writing between 1 and 11 bytes into a region of size 7
@ 2023-10-18 13:27 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-10-18 13:27 UTC (permalink / raw)
  To: Geetha sowjanya
  Cc: oe-kbuild-all, linux-kernel, Sunil Goutham, Subbaraya Sundeep

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   06dc10eae55b5ceabfef287a7e5f16ceea204aa0
commit: d06c2aba51631bf6cd32a2f8f1edd67c110ade8a octeontx2-af: cn10k: mcs: Add debugfs support
date:   1 year ago
config: x86_64-buildonly-randconfig-006-20230826 (https://download.01.org/0day-ci/archive/20231018/202310182158.KXRDW2Ao-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231018/202310182158.KXRDW2Ao-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/202310182158.KXRDW2Ao-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_mcs_init':
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:36: warning: '%d' directive writing between 1 and 11 bytes into a region of size 7 [-Wformat-overflow=]
     535 |                 sprintf(dname, "mcs%d", i);
         |                                    ^~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:32: note: directive argument in the range [-2147483644, 2147483646]
     535 |                 sprintf(dname, "mcs%d", i);
         |                                ^~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:17: note: 'sprintf' output between 5 and 15 bytes into a destination of size 10
     535 |                 sprintf(dname, "mcs%d", i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~


vim +535 drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c

   520	
   521	static void rvu_dbg_mcs_init(struct rvu *rvu)
   522	{
   523		struct mcs *mcs;
   524		char dname[10];
   525		int i;
   526	
   527		if (!rvu->mcs_blk_cnt)
   528			return;
   529	
   530		rvu->rvu_dbg.mcs_root = debugfs_create_dir("mcs", rvu->rvu_dbg.root);
   531	
   532		for (i = 0; i < rvu->mcs_blk_cnt; i++) {
   533			mcs = mcs_get_pdata(i);
   534	
 > 535			sprintf(dname, "mcs%d", i);
   536			rvu->rvu_dbg.mcs = debugfs_create_dir(dname,
   537							      rvu->rvu_dbg.mcs_root);
   538	
   539			rvu->rvu_dbg.mcs_rx = debugfs_create_dir("rx_stats", rvu->rvu_dbg.mcs);
   540	
   541			debugfs_create_file("flowid", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   542					    &rvu_dbg_mcs_rx_flowid_stats_fops);
   543	
   544			debugfs_create_file("secy", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   545					    &rvu_dbg_mcs_rx_secy_stats_fops);
   546	
   547			debugfs_create_file("sc", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   548					    &rvu_dbg_mcs_rx_sc_stats_fops);
   549	
   550			debugfs_create_file("sa", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   551					    &rvu_dbg_mcs_rx_sa_stats_fops);
   552	
   553			debugfs_create_file("port", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   554					    &rvu_dbg_mcs_rx_port_stats_fops);
   555	
   556			rvu->rvu_dbg.mcs_tx = debugfs_create_dir("tx_stats", rvu->rvu_dbg.mcs);
   557	
   558			debugfs_create_file("flowid", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   559					    &rvu_dbg_mcs_tx_flowid_stats_fops);
   560	
   561			debugfs_create_file("secy", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   562					    &rvu_dbg_mcs_tx_secy_stats_fops);
   563	
   564			debugfs_create_file("sc", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   565					    &rvu_dbg_mcs_tx_sc_stats_fops);
   566	
   567			debugfs_create_file("sa", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   568					    &rvu_dbg_mcs_tx_sa_stats_fops);
   569	
   570			debugfs_create_file("port", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   571					    &rvu_dbg_mcs_tx_port_stats_fops);
   572		}
   573	}
   574	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread
* drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:36: warning: '%d' directive writing between 1 and 11 bytes into a region of size 7
@ 2023-11-04 11:48 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2023-11-04 11:48 UTC (permalink / raw)
  To: Geetha sowjanya
  Cc: oe-kbuild-all, linux-kernel, Sunil Goutham, Subbaraya Sundeep

Hi Geetha,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   90b0c2b2edd1adff742c621e246562fbefa11b70
commit: d06c2aba51631bf6cd32a2f8f1edd67c110ade8a octeontx2-af: cn10k: mcs: Add debugfs support
date:   1 year, 1 month ago
config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20231104/202311041952.XgfdAuan-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231104/202311041952.XgfdAuan-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/202311041952.XgfdAuan-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c: In function 'rvu_dbg_mcs_init':
>> drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:36: warning: '%d' directive writing between 1 and 11 bytes into a region of size 7 [-Wformat-overflow=]
     535 |                 sprintf(dname, "mcs%d", i);
         |                                    ^~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:32: note: directive argument in the range [-2147483641, 2147483646]
     535 |                 sprintf(dname, "mcs%d", i);
         |                                ^~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:17: note: 'sprintf' output between 5 and 15 bytes into a destination of size 10
     535 |                 sprintf(dname, "mcs%d", i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~


vim +535 drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c

   520	
   521	static void rvu_dbg_mcs_init(struct rvu *rvu)
   522	{
   523		struct mcs *mcs;
   524		char dname[10];
   525		int i;
   526	
   527		if (!rvu->mcs_blk_cnt)
   528			return;
   529	
   530		rvu->rvu_dbg.mcs_root = debugfs_create_dir("mcs", rvu->rvu_dbg.root);
   531	
   532		for (i = 0; i < rvu->mcs_blk_cnt; i++) {
   533			mcs = mcs_get_pdata(i);
   534	
 > 535			sprintf(dname, "mcs%d", i);
   536			rvu->rvu_dbg.mcs = debugfs_create_dir(dname,
   537							      rvu->rvu_dbg.mcs_root);
   538	
   539			rvu->rvu_dbg.mcs_rx = debugfs_create_dir("rx_stats", rvu->rvu_dbg.mcs);
   540	
   541			debugfs_create_file("flowid", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   542					    &rvu_dbg_mcs_rx_flowid_stats_fops);
   543	
   544			debugfs_create_file("secy", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   545					    &rvu_dbg_mcs_rx_secy_stats_fops);
   546	
   547			debugfs_create_file("sc", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   548					    &rvu_dbg_mcs_rx_sc_stats_fops);
   549	
   550			debugfs_create_file("sa", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   551					    &rvu_dbg_mcs_rx_sa_stats_fops);
   552	
   553			debugfs_create_file("port", 0600, rvu->rvu_dbg.mcs_rx, mcs,
   554					    &rvu_dbg_mcs_rx_port_stats_fops);
   555	
   556			rvu->rvu_dbg.mcs_tx = debugfs_create_dir("tx_stats", rvu->rvu_dbg.mcs);
   557	
   558			debugfs_create_file("flowid", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   559					    &rvu_dbg_mcs_tx_flowid_stats_fops);
   560	
   561			debugfs_create_file("secy", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   562					    &rvu_dbg_mcs_tx_secy_stats_fops);
   563	
   564			debugfs_create_file("sc", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   565					    &rvu_dbg_mcs_tx_sc_stats_fops);
   566	
   567			debugfs_create_file("sa", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   568					    &rvu_dbg_mcs_tx_sa_stats_fops);
   569	
   570			debugfs_create_file("port", 0600, rvu->rvu_dbg.mcs_tx, mcs,
   571					    &rvu_dbg_mcs_tx_port_stats_fops);
   572		}
   573	}
   574	

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-04 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18 13:27 drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c:535:36: warning: '%d' directive writing between 1 and 11 bytes into a region of size 7 kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-11-04 11:48 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