mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/net/ethernet/ti/cpsw_ethtool.c:244:21: warning: ': ' directive output may be truncated writing 2 bytes into a region of size between 1 and 19
@ 2023-11-06 16:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-11-06 16:36 UTC (permalink / raw)
  To: Grygorii Strashko; +Cc: oe-kbuild-all, linux-kernel, Andrew Lunn

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d2f51b3516dade79269ff45eae2a7668ae711b25
commit: c24eef283a23b85cbd755265539dc4dbe3fee949 net: ethernet: ti: cpsw: move ethtool func in separate file
date:   4 years, 6 months ago
config: x86_64-buildonly-randconfig-006-20230915 (https://download.01.org/0day-ci/archive/20231107/202311070051.jj6o85Vg-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231107/202311070051.jj6o85Vg-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/202311070051.jj6o85Vg-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/ti/cpsw_ethtool.c: In function 'cpsw_add_ch_strings':
>> drivers/net/ethernet/ti/cpsw_ethtool.c:244:21: warning: ': ' directive output may be truncated writing 2 bytes into a region of size between 1 and 19 [-Wformat-truncation=]
        "%s DMA chan %ld: %s", rx_dir ? "Rx" : "Tx",
                        ^~
   drivers/net/ethernet/ti/cpsw_ethtool.c:243:3: note: 'snprintf' output 16 or more bytes (assuming 34) into a destination of size 32
      snprintf(*p, ETH_GSTRING_LEN,
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        "%s DMA chan %ld: %s", rx_dir ? "Rx" : "Tx",
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        (long)(i / CPSW_STATS_CH_LEN),
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cpsw_gstrings_ch_stats[line].stat_string);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +244 drivers/net/ethernet/ti/cpsw_ethtool.c

   233	
   234	static void cpsw_add_ch_strings(u8 **p, int ch_num, int rx_dir)
   235	{
   236		int ch_stats_len;
   237		int line;
   238		int i;
   239	
   240		ch_stats_len = CPSW_STATS_CH_LEN * ch_num;
   241		for (i = 0; i < ch_stats_len; i++) {
   242			line = i % CPSW_STATS_CH_LEN;
   243			snprintf(*p, ETH_GSTRING_LEN,
 > 244				 "%s DMA chan %ld: %s", rx_dir ? "Rx" : "Tx",
   245				 (long)(i / CPSW_STATS_CH_LEN),
   246				 cpsw_gstrings_ch_stats[line].stat_string);
   247			*p += ETH_GSTRING_LEN;
   248		}
   249	}
   250	

-- 
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-06 16:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-06 16:36 drivers/net/ethernet/ti/cpsw_ethtool.c:244:21: warning: ': ' directive output may be truncated writing 2 bytes into a region of size between 1 and 19 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

all inboxes | Powered by JetHome®