public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/misc/pci_endpoint_test.c:38:41: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2
@ 2023-11-18 13:42 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-11-18 13:42 UTC (permalink / raw)
  To: Kishon Vijay Abraham I; +Cc: oe-kbuild-all, linux-kernel, Bjorn Helgaas

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   791c8ab095f71327899023223940dd52257a4173
commit: 2c156ac71c6b2518f3d589190f2a8872a8764faf misc: Add host side PCI driver for PCI test function device
date:   7 years ago
config: x86_64-buildonly-randconfig-001-20231012 (https://download.01.org/0day-ci/archive/20231118/202311182130.6duKTiLv-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231118/202311182130.6duKTiLv-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/202311182130.6duKTiLv-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/misc/pci_endpoint_test.c: In function 'pci_endpoint_test_probe':
>> drivers/misc/pci_endpoint_test.c:38:41: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
      38 | #define DRV_MODULE_NAME                 "pci-endpoint-test"
         |                                         ^~~~~~~~~~~~~~~~~~~
   drivers/misc/pci_endpoint_test.c:463:38: note: in expansion of macro 'DRV_MODULE_NAME'
     463 |         snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id);
         |                                      ^~~~~~~~~~~~~~~
   drivers/misc/pci_endpoint_test.c:503:57: note: format string is defined here
     503 |         if (sscanf(misc_device->name, DRV_MODULE_NAME ".%d", &id) != 1)
         |                                                         ^~
   drivers/misc/pci_endpoint_test.c:38:41: note: directive argument in the range [0, 2147483647]
      38 | #define DRV_MODULE_NAME                 "pci-endpoint-test"
         |                                         ^~~~~~~~~~~~~~~~~~~
   drivers/misc/pci_endpoint_test.c:463:38: note: in expansion of macro 'DRV_MODULE_NAME'
     463 |         snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id);
         |                                      ^~~~~~~~~~~~~~~
   drivers/misc/pci_endpoint_test.c:463:9: note: 'snprintf' output between 20 and 29 bytes into a destination of size 20
     463 |         snprintf(name, sizeof(name), DRV_MODULE_NAME ".%d", id);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +38 drivers/misc/pci_endpoint_test.c

    37	
  > 38	#define DRV_MODULE_NAME			"pci-endpoint-test"
    39	

-- 
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:[~2023-11-18 13:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-18 13:42 drivers/misc/pci_endpoint_test.c:38:41: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 2 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