public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Yury Norov <yury.norov@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: arch/powerpc/platforms/pseries/lpar.c:2032:36: error: '%ld' directive writing between 1 and 20 bytes into a region of size 12
Date: Thu, 19 Oct 2023 07:30:10 +0800	[thread overview]
Message-ID: <202310190736.sgDpsRRj-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd72f9c7e512da377074d47d990564959b772643
commit: 33e67710beda78aed38a2fe10be6088d4aeb1c53 cpumask: switch for_each_cpu{,_not} to use for_each_bit()
date:   1 year, 1 month ago
config: powerpc64-randconfig-r003-20220418 (https://download.01.org/0day-ci/archive/20231019/202310190736.sgDpsRRj-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/20231019/202310190736.sgDpsRRj-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/202310190736.sgDpsRRj-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/powerpc/platforms/pseries/lpar.c: In function '__machine_initcall_pseries_vpa_debugfs_init':
>> arch/powerpc/platforms/pseries/lpar.c:2032:36: error: '%ld' directive writing between 1 and 20 bytes into a region of size 12 [-Werror=format-overflow=]
    2032 |                 sprintf(name, "cpu-%ld", i);
         |                                    ^~~
   In function 'vpa_debugfs_init',
       inlined from '__machine_initcall_pseries_vpa_debugfs_init' at arch/powerpc/platforms/pseries/lpar.c:2038:1:
   arch/powerpc/platforms/pseries/lpar.c:2032:31: note: directive argument in the range [-9223372036854775808, 4294967294]
    2032 |                 sprintf(name, "cpu-%ld", i);
         |                               ^~~~~~~~~
   arch/powerpc/platforms/pseries/lpar.c:2032:17: note: 'sprintf' output between 6 and 25 bytes into a destination of size 16
    2032 |                 sprintf(name, "cpu-%ld", i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors
--
   arch/powerpc/sysdev/xive/common.c: In function 'xive_core_debug_init':
>> arch/powerpc/sysdev/xive/common.c:1845:50: error: '%ld' directive output may be truncated writing between 1 and 20 bytes into a region of size 13 [-Werror=format-truncation=]
    1845 |                 snprintf(name, sizeof(name), "cpu%ld", cpu);
         |                                                  ^~~
   In function 'xive_core_debugfs_create',
       inlined from 'xive_core_debug_init' at arch/powerpc/sysdev/xive/common.c:1861:3:
   arch/powerpc/sysdev/xive/common.c:1845:46: note: directive argument in the range [-9223372036854775808, 4294967294]
    1845 |                 snprintf(name, sizeof(name), "cpu%ld", cpu);
         |                                              ^~~~~~~~
   arch/powerpc/sysdev/xive/common.c:1845:17: note: 'snprintf' output between 5 and 24 bytes into a destination of size 16
    1845 |                 snprintf(name, sizeof(name), "cpu%ld", cpu);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: all warnings being treated as errors


vim +2032 arch/powerpc/platforms/pseries/lpar.c

c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2018  
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2019  static int __init vpa_debugfs_init(void)
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2020  {
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2021  	char name[16];
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2022  	long i;
11dd34f3eae5a4 YueHaibing       2019-02-18  2023  	struct dentry *vpa_dir;
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2024  
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2025  	if (!firmware_has_feature(FW_FEATURE_SPLPAR))
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2026  		return 0;
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2027  
dbf77fed8b302e Aneesh Kumar K.V 2021-08-12  2028  	vpa_dir = debugfs_create_dir("vpa", arch_debugfs_dir);
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2029  
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2030  	/* set up the per-cpu vpa file*/
c6c26fb55e8e4b Aravinda Prasad  2018-10-16  2031  	for_each_possible_cpu(i) {
c6c26fb55e8e4b Aravinda Prasad  2018-10-16 @2032  		sprintf(name, "cpu-%ld", i);

:::::: The code at line 2032 was first introduced by commit
:::::: c6c26fb55e8e4b3fc376be5611685990a17de27a powerpc/pseries: Export raw per-CPU VPA data via debugfs

:::::: TO: Aravinda Prasad <aravinda@linux.vnet.ibm.com>
:::::: CC: Michael Ellerman <mpe@ellerman.id.au>

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

                 reply	other threads:[~2023-10-18 23:30 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=202310190736.sgDpsRRj-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=yury.norov@gmail.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