mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Daniel Zahka <daniel.zahka@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Paolo Abeni <pabeni@redhat.com>
Subject: drivers/net/ethernet/meta/mpnic/mpnic_txrx.c:273:48: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 6 and 21
Date: Sun, 25 Oct 2026 05:33:48 +0100	[thread overview]
Message-ID: <202610250507.qjcLBj0W-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   330517c63aa9b48227b6ab45f01003effac77ae4
commit: 3d4e4ad43aa455353067cf004d0618009ac39205 eth: mpnic: implement Tx queue allocation and cleanup
date:   4 weeks ago
config: arm64-randconfig-r2301-20261025 (https://download.01.org/0day-ci/archive/20261025/202610250507.qjcLBj0W-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
sparse: v0.6.5-rc1-1-gc4640450
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261025/202610250507.qjcLBj0W-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
| Fixes: 3d4e4ad43aa4 ("eth: mpnic: implement Tx queue allocation and cleanup")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202610250507.qjcLBj0W-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/meta/mpnic/mpnic_txrx.c: In function 'mpnic_alloc_napi_vectors':
>> drivers/net/ethernet/meta/mpnic/mpnic_txrx.c:273:48: warning: '%u' directive output may be truncated writing between 1 and 10 bytes into a region of size between 6 and 21 [-Wformat-truncation=]
     snprintf(nv->name, sizeof(nv->name), "%s-TxRx-%u",
                                                   ^~
   drivers/net/ethernet/meta/mpnic/mpnic_txrx.c:273:39: note: directive argument in the range [0, 4294967294]
     snprintf(nv->name, sizeof(nv->name), "%s-TxRx-%u",
                                          ^~~~~~~~~~~~
   drivers/net/ethernet/meta/mpnic/mpnic_txrx.c:273:2: note: 'snprintf' output between 8 and 32 bytes into a destination of size 27
     snprintf(nv->name, sizeof(nv->name), "%s-TxRx-%u",
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       mpn->netdev->name, idx);
       ~~~~~~~~~~~~~~~~~~~~~~~


vim +273 drivers/net/ethernet/meta/mpnic/mpnic_txrx.c

   244	
   245	static int mpnic_alloc_napi_vector(struct mpnic_dev *mpd,
   246					   struct mpnic_net *mpn, unsigned int idx)
   247	{
   248		u32 __iomem *uc_addr = READ_ONCE(mpd->uc_addr0);
   249		struct mpnic_napi_vector *nv;
   250		int err;
   251	
   252		/* Doorbells are plain pointers into the register window, they have
   253		 * no way of noticing that it went away.
   254		 */
   255		if (!uc_addr)
   256			return -EIO;
   257	
   258		nv = kzalloc_flex(*nv, qt, 1);
   259		if (!nv)
   260			return -ENOMEM;
   261	
   262		nv->txt_count = 1;
   263		nv->mpd = mpd;
   264		nv->dev = mpd->dev;
   265		nv->v_idx = idx + MPNIC_NON_NAPI_VECTORS;
   266	
   267		mpn->napi[idx] = nv;
   268		netif_napi_add_config_locked(mpn->netdev, &nv->napi, mpnic_poll, idx);
   269		netif_napi_set_irq_locked(&nv->napi,
   270					  pci_irq_vector(to_pci_dev(mpd->dev),
   271							 nv->v_idx));
   272	
 > 273		snprintf(nv->name, sizeof(nv->name), "%s-TxRx-%u",
   274			 mpn->netdev->name, idx);
   275	
   276		err = mpnic_request_irq(mpd, nv->v_idx, mpnic_msix_clean_rings, 0,
   277					nv->name, nv);
   278		if (err)
   279			goto err_napi_del;
   280	
   281		mpnic_ring_init(&nv->qt[0].sub0, &uc_addr[MPNIC_TWQ_TAIL(idx, 0)], idx);
   282		mpnic_ring_init(&nv->qt[0].cmpl, &uc_addr[MPNIC_TCQ_HEAD(idx)], idx);
   283		mpn->tx[idx] = &nv->qt[0].sub0;
   284	
   285		return 0;
   286	
   287	err_napi_del:
   288		netif_napi_del_locked(&nv->napi);
   289		mpn->napi[idx] = NULL;
   290		kfree(nv);
   291		return err;
   292	}
   293	

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

                 reply	other threads:[~2026-10-25  4:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202610250507.qjcLBj0W-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=daniel.zahka@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®