mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/net/ethernet/freescale/enetc/enetc.c:2713:3: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 110
@ 2024-01-07  5:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-01-07  5:55 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: llvm, oe-kbuild-all, linux-kernel, Jakub Kicinski, Simon Horman

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   52b1853b080a082ec3749c3a9577f6c71b1d4a90
commit: 800db2d125c2bc22c448e2386c3518e663d6db71 net: enetc: ensure we always have a minimum number of TXQs for stack
date:   11 months ago
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20240107/202401071345.gs4ThqGA-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 7e186d366d6c7def0543acc255931f617e76dff0)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240107/202401071345.gs4ThqGA-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/202401071345.gs4ThqGA-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/freescale/enetc/enetc.c:2713:3: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 110 [-Wformat-truncation]
    2713 |                 NL_SET_ERR_MSG_FMT_MOD(extack,
         |                 ^
   include/linux/netlink.h:131:2: note: expanded from macro 'NL_SET_ERR_MSG_FMT_MOD'
     131 |         NL_SET_ERR_MSG_FMT((extack), KBUILD_MODNAME ": " fmt, ##args)
         |         ^
   include/linux/netlink.h:116:6: note: expanded from macro 'NL_SET_ERR_MSG_FMT'
     116 |         if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN,               \
         |             ^
   1 warning generated.


vim +/snprintf +2713 drivers/net/ethernet/freescale/enetc/enetc.c

  2703	
  2704	static int enetc_setup_xdp_prog(struct net_device *ndev, struct bpf_prog *prog,
  2705					struct netlink_ext_ack *extack)
  2706	{
  2707		int num_xdp_tx_queues = prog ? num_possible_cpus() : 0;
  2708		struct enetc_ndev_priv *priv = netdev_priv(ndev);
  2709		bool extended;
  2710	
  2711		if (priv->min_num_stack_tx_queues + num_xdp_tx_queues >
  2712		    priv->num_tx_rings) {
> 2713			NL_SET_ERR_MSG_FMT_MOD(extack,
  2714					       "Reserving %d XDP TXQs does not leave a minimum of %d TXQs for network stack (total %d available)",
  2715					       num_xdp_tx_queues,
  2716					       priv->min_num_stack_tx_queues,
  2717					       priv->num_tx_rings);
  2718			return -EBUSY;
  2719		}
  2720	
  2721		extended = !!(priv->active_offloads & ENETC_F_RX_TSTAMP);
  2722	
  2723		/* The buffer layout is changing, so we need to drain the old
  2724		 * RX buffers and seed new ones.
  2725		 */
  2726		return enetc_reconfigure(priv, extended, enetc_reconfigure_xdp_cb, prog);
  2727	}
  2728	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-07  5:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-07  5:55 drivers/net/ethernet/freescale/enetc/enetc.c:2713:3: warning: 'snprintf' will always be truncated; specified size is 80, but format string expands to at least 110 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®