mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Andrew Lunn <andrew@lunn.ch>
Subject: 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
Date: Tue, 7 Nov 2023 00:36:23 +0800	[thread overview]
Message-ID: <202311070051.jj6o85Vg-lkp@intel.com> (raw)

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

                 reply	other threads:[~2023-11-06 16:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202311070051.jj6o85Vg-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®