public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Aleksandr Loktionov <aleksandr.loktionov@intel.com>,
	Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>
Subject: drivers/net/ethernet/intel/i40e/i40e_ptp.c:1375:27: warning: '%s' directive output may be truncated writing up to 287 bytes into a region of size 64
Date: Thu, 27 Feb 2025 16:57:43 +0800	[thread overview]
Message-ID: <202502271608.TTHgj7OB-lkp@intel.com> (raw)

Hi Piotr,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd83757f6e686a2188997cb58b5975f744bb7786
commit: 1050713026a08d605b61f039700b67aab646371f i40e: add support for PTP external synchronization clock
date:   3 years, 7 months ago
config: alpha-randconfig-p001-20211207 (https://download.01.org/0day-ci/archive/20250227/202502271608.TTHgj7OB-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250227/202502271608.TTHgj7OB-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/202502271608.TTHgj7OB-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/intel/i40e/i40e_ptp.c: In function 'i40e_ptp_init':
>> drivers/net/ethernet/intel/i40e/i40e_ptp.c:1375:27: warning: '%s' directive output may be truncated writing up to 287 bytes into a region of size 64 [-Wformat-truncation=]
    1375 |                          "%s", sdp_desc[i].name);
         |                           ^~
   In function 'i40e_init_pin_config',
       inlined from 'i40e_ptp_create_clock' at drivers/net/ethernet/intel/i40e/i40e_ptp.c:1414:13,
       inlined from 'i40e_ptp_init' at drivers/net/ethernet/intel/i40e/i40e_ptp.c:1519:8:
   drivers/net/ethernet/intel/i40e/i40e_ptp.c:1373:17: note: 'snprintf' output between 1 and 288 bytes into a destination of size 64
    1373 |                 snprintf(pf->ptp_caps.pin_config[i].name,
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1374 |                          sizeof(pf->ptp_caps.pin_config[i].name),
         |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1375 |                          "%s", sdp_desc[i].name);
         |                          ~~~~~~~~~~~~~~~~~~~~~~~


vim +1375 drivers/net/ethernet/intel/i40e/i40e_ptp.c

  1349	
  1350	/**
  1351	 * i40e_init_pin_config - initialize pins.
  1352	 * @pf: private board structure
  1353	 *
  1354	 * Initialize pins for external clock source.
  1355	 * Return 0 on success or error code on failure.
  1356	 **/
  1357	static int i40e_init_pin_config(struct i40e_pf *pf)
  1358	{
  1359		int i;
  1360	
  1361		pf->ptp_caps.n_pins = 3;
  1362		pf->ptp_caps.n_ext_ts = 2;
  1363		pf->ptp_caps.pps = 1;
  1364		pf->ptp_caps.n_per_out = 2;
  1365	
  1366		pf->ptp_caps.pin_config = kcalloc(pf->ptp_caps.n_pins,
  1367						  sizeof(*pf->ptp_caps.pin_config),
  1368						  GFP_KERNEL);
  1369		if (!pf->ptp_caps.pin_config)
  1370			return -ENOMEM;
  1371	
  1372		for (i = 0; i < pf->ptp_caps.n_pins; i++) {
  1373			snprintf(pf->ptp_caps.pin_config[i].name,
  1374				 sizeof(pf->ptp_caps.pin_config[i].name),
> 1375				 "%s", sdp_desc[i].name);
  1376			pf->ptp_caps.pin_config[i].index = sdp_desc[i].index;
  1377			pf->ptp_caps.pin_config[i].func = PTP_PF_NONE;
  1378			pf->ptp_caps.pin_config[i].chan = sdp_desc[i].chan;
  1379		}
  1380	
  1381		pf->ptp_caps.verify = i40e_ptp_verify;
  1382		pf->ptp_caps.enable = i40e_ptp_feature_enable;
  1383	
  1384		pf->ptp_caps.pps = 1;
  1385	
  1386		return 0;
  1387	}
  1388	

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

             reply	other threads:[~2025-02-27  8:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  8:57 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-02-11 16:10 drivers/net/ethernet/intel/i40e/i40e_ptp.c:1375:27: warning: '%s' directive output may be truncated writing up to 287 bytes into a region of size 64 kernel test robot
2025-01-16  1:19 kernel test robot
2025-01-08 11:06 kernel test robot

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=202502271608.TTHgj7OB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=aleksandr.loktionov@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=piotr.kwapulinski@intel.com \
    /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