[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202501081838.MgriAIka-lkp@intel.com>
Date: Wed, 8 Jan 2025 19:06:24 +0800
From: kernel test robot <lkp@...el.com>
To: Piotr Kwapulinski <piotr.kwapulinski@...el.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Aleksandr Loktionov <aleksandr.loktionov@...el.com>,
Arkadiusz Kubalewski <arkadiusz.kubalewski@...el.com>,
Tony Nguyen <anthony.l.nguyen@...el.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
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 09a0fa92e5b45e99cf435b2fbf5ebcf889cf8780
commit: 1050713026a08d605b61f039700b67aab646371f i40e: add support for PTP external synchronization clock
date: 3 years, 6 months ago
config: alpha-randconfig-p001-20211207 (https://download.01.org/0day-ci/archive/20250108/202501081838.MgriAIka-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/20250108/202501081838.MgriAIka-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501081838.MgriAIka-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
Powered by blists - more mailing lists