mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Vadym Kochan <vadym.kochan@plvision.eu>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: 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
Date: Sat, 11 Jan 2025 07:01:43 +0800	[thread overview]
Message-ID: <202501110646.aGxZ97Ug-lkp@intel.com> (raw)

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

             reply	other threads:[~2025-01-10 23:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-10 23:01 kernel test robot [this message]
2025-01-28  8:16 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=202501110646.aGxZ97Ug-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=vadym.kochan@plvision.eu \
    /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®