public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* arch/powerpc/platforms/ps3/setup.c:229:24: warning: '%u' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12
@ 2023-12-03  6:07 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-03  6:07 UTC (permalink / raw)
  To: Geoff Levand; +Cc: oe-kbuild-all, linux-kernel, Michael Ellerman

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   815fb87b753055df2d9e50f6cd80eb10235fe3e9
commit: 07e2d6cf91079ca01db7fb989a02edd8009dcacd powerpc/ps3: Add firmware version to sysfs
date:   2 years, 6 months ago
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20231202/202312021810.bCVHtweA-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231202/202312021810.bCVHtweA-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/202312021810.bCVHtweA-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/powerpc/platforms/ps3/setup.c: In function 'ps3_setup_arch':
>> arch/powerpc/platforms/ps3/setup.c:229:24: warning: '%u' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12 [-Wformat-truncation=]
     229 |                 "%u.%u.%u", ps3_firmware_version.major,
         |                        ^~
   arch/powerpc/platforms/ps3/setup.c:229:17: note: directive argument in the range [0, 65535]
     229 |                 "%u.%u.%u", ps3_firmware_version.major,
         |                 ^~~~~~~~~~
   arch/powerpc/platforms/ps3/setup.c:228:9: note: 'snprintf' output between 6 and 18 bytes into a destination of size 16
     228 |         snprintf(ps3_firmware_version_str, sizeof(ps3_firmware_version_str),
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     229 |                 "%u.%u.%u", ps3_firmware_version.major,
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     230 |                 ps3_firmware_version.minor, ps3_firmware_version.rev);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +229 arch/powerpc/platforms/ps3/setup.c

   219	
   220	static void __init ps3_setup_arch(void)
   221	{
   222		u64 tmp;
   223	
   224		DBG(" -> %s:%d\n", __func__, __LINE__);
   225	
   226		lv1_get_version_info(&ps3_firmware_version.raw, &tmp);
   227	
   228		snprintf(ps3_firmware_version_str, sizeof(ps3_firmware_version_str),
 > 229			"%u.%u.%u", ps3_firmware_version.major,
   230			ps3_firmware_version.minor, ps3_firmware_version.rev);
   231	
   232		printk(KERN_INFO "PS3 firmware version %s\n", ps3_firmware_version_str);
   233	
   234		ps3_spu_set_platform();
   235	

-- 
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-12-03  6:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-03  6:07 arch/powerpc/platforms/ps3/setup.c:229:24: warning: '%u' directive output may be truncated writing between 1 and 5 bytes into a region of size between 4 and 12 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