mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:43: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12
@ 2025-01-10 23:01 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-01-10 23:01 UTC (permalink / raw)
  To: Vadym Kochan; +Cc: oe-kbuild-all, linux-kernel

Hi Vadym,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e0daef7de1acecdb64c1fa31abc06529abb98710
commit: 34dd1710f5a3c9a7dc78e1ff6de69a19d407db25 net: marvell: prestera: Add basic devlink support
date:   4 years, 4 months ago
config: powerpc64-randconfig-002-20231105 (https://download.01.org/0day-ci/archive/20250111/202501110646.aGxZ97Ug-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250111/202501110646.aGxZ97Ug-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/202501110646.aGxZ97Ug-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/marvell/prestera/prestera_devlink.c: In function 'prestera_dl_info_get':
>> drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:43: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12 [-Wformat-truncation=]
      20 |         snprintf(buf, sizeof(buf), "%d.%d.%d",
         |                                           ^~
   drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:36: note: directive argument in the range [0, 65535]
      20 |         snprintf(buf, sizeof(buf), "%d.%d.%d",
         |                                    ^~~~~~~~~~
   drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:9: note: 'snprintf' output between 6 and 18 bytes into a destination of size 16
      20 |         snprintf(buf, sizeof(buf), "%d.%d.%d",
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      21 |                  sw->dev->fw_rev.maj,
         |                  ~~~~~~~~~~~~~~~~~~~~
      22 |                  sw->dev->fw_rev.min,
         |                  ~~~~~~~~~~~~~~~~~~~~
      23 |                  sw->dev->fw_rev.sub);
         |                  ~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for HOTPLUG_PCI_POWERNV
   Depends on [n]: PCI [=y] && HOTPLUG_PCI [=n] && PPC_POWERNV [=y] && EEH [=y]
   Selected by [y]:
   - OCXL [=y] && PPC_POWERNV [=y] && PCI [=y] && EEH [=y]


vim +20 drivers/net/ethernet/marvell/prestera/prestera_devlink.c

     7	
     8	static int prestera_dl_info_get(struct devlink *dl,
     9					struct devlink_info_req *req,
    10					struct netlink_ext_ack *extack)
    11	{
    12		struct prestera_switch *sw = devlink_priv(dl);
    13		char buf[16];
    14		int err;
    15	
    16		err = devlink_info_driver_name_put(req, PRESTERA_DRV_NAME);
    17		if (err)
    18			return err;
    19	
  > 20		snprintf(buf, sizeof(buf), "%d.%d.%d",
    21			 sw->dev->fw_rev.maj,
    22			 sw->dev->fw_rev.min,
    23			 sw->dev->fw_rev.sub);
    24	
    25		return devlink_info_version_running_put(req,
    26						       DEVLINK_INFO_VERSION_GENERIC_FW,
    27						       buf);
    28	}
    29	

-- 
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/prestera/prestera_devlink.c:20:43: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12
@ 2025-01-28  8:16 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-01-28  8:16 UTC (permalink / raw)
  To: Vadym Kochan; +Cc: oe-kbuild-all, linux-kernel

Hi Vadym,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6d61a53dd6f55405ebcaea6ee38d1ab5a8856c2c
commit: 34dd1710f5a3c9a7dc78e1ff6de69a19d407db25 net: marvell: prestera: Add basic devlink support
date:   4 years, 4 months ago
config: powerpc64-randconfig-002-20231105 (https://download.01.org/0day-ci/archive/20250128/202501281659.uLgq0KDb-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250128/202501281659.uLgq0KDb-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/202501281659.uLgq0KDb-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/marvell/prestera/prestera_devlink.c: In function 'prestera_dl_info_get':
>> drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:43: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12 [-Wformat-truncation=]
      20 |         snprintf(buf, sizeof(buf), "%d.%d.%d",
         |                                           ^~
   drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:36: note: directive argument in the range [0, 65535]
      20 |         snprintf(buf, sizeof(buf), "%d.%d.%d",
         |                                    ^~~~~~~~~~
   drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:9: note: 'snprintf' output between 6 and 18 bytes into a destination of size 16
      20 |         snprintf(buf, sizeof(buf), "%d.%d.%d",
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      21 |                  sw->dev->fw_rev.maj,
         |                  ~~~~~~~~~~~~~~~~~~~~
      22 |                  sw->dev->fw_rev.min,
         |                  ~~~~~~~~~~~~~~~~~~~~
      23 |                  sw->dev->fw_rev.sub);
         |                  ~~~~~~~~~~~~~~~~~~~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for HOTPLUG_PCI_POWERNV
   Depends on [n]: PCI [=y] && HOTPLUG_PCI [=n] && PPC_POWERNV [=y] && EEH [=y]
   Selected by [y]:
   - OCXL [=y] && PPC_POWERNV [=y] && PCI [=y] && EEH [=y]


vim +20 drivers/net/ethernet/marvell/prestera/prestera_devlink.c

     7	
     8	static int prestera_dl_info_get(struct devlink *dl,
     9					struct devlink_info_req *req,
    10					struct netlink_ext_ack *extack)
    11	{
    12		struct prestera_switch *sw = devlink_priv(dl);
    13		char buf[16];
    14		int err;
    15	
    16		err = devlink_info_driver_name_put(req, PRESTERA_DRV_NAME);
    17		if (err)
    18			return err;
    19	
  > 20		snprintf(buf, sizeof(buf), "%d.%d.%d",
    21			 sw->dev->fw_rev.maj,
    22			 sw->dev->fw_rev.min,
    23			 sw->dev->fw_rev.sub);
    24	
    25		return devlink_info_version_running_put(req,
    26						       DEVLINK_INFO_VERSION_GENERIC_FW,
    27						       buf);
    28	}
    29	

-- 
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:[~2025-01-28  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-10 23:01 drivers/net/ethernet/marvell/prestera/prestera_devlink.c:20:43: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12 kernel test robot
2025-01-28  8:16 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®