public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: liujing <liujing@cmss.chinamobile.com>,
	tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	mat.jonczyk@o2.pl, rdunlap@infradead.org
Cc: oe-kbuild-all@lists.linux.dev, bhelgaas@google.com,
	mario.limonciello@amd.com, linux-kernel@vger.kernel.org,
	liujing <liujing@cmss.chinamobile.com>
Subject: Re: [PATCH] arch/x86: Fix the wrong format specifier
Date: Thu, 5 Dec 2024 05:22:12 +0800	[thread overview]
Message-ID: <202412050541.CvNgnYXM-lkp@intel.com> (raw)
In-Reply-To: <20241204143322.7772-1-liujing@cmss.chinamobile.com>

Hi liujing,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/master]
[also build test WARNING on tip/x86/core tip/auto-latest linus/master v6.13-rc1 next-20241204]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/liujing/arch-x86-Fix-the-wrong-format-specifier/20241204-225811
base:   tip/master
patch link:    https://lore.kernel.org/r/20241204143322.7772-1-liujing%40cmss.chinamobile.com
patch subject: [PATCH] arch/x86: Fix the wrong format specifier
config: x86_64-buildonly-randconfig-006-20241205 (https://download.01.org/0day-ci/archive/20241205/202412050541.CvNgnYXM-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/20241205/202412050541.CvNgnYXM-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/202412050541.CvNgnYXM-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/x86/kernel/hpet.c: In function 'hpet_late_init':
>> arch/x86/kernel/hpet.c:731:40: warning: '%u' directive writing between 1 and 10 bytes into a region of size 6 [-Wformat-overflow=]
     731 |                 sprintf(hc->name, "hpet%u", i);
         |                                        ^~
   In function 'hpet_select_clockevents',
       inlined from 'hpet_late_init' at arch/x86/kernel/hpet.c:1146:2:
   arch/x86/kernel/hpet.c:731:35: note: directive argument in the range [0, 4294967294]
     731 |                 sprintf(hc->name, "hpet%u", i);
         |                                   ^~~~~~~~
   arch/x86/kernel/hpet.c:731:17: note: 'sprintf' output between 6 and 15 bytes into a destination of size 10
     731 |                 sprintf(hc->name, "hpet%u", i);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +731 arch/x86/kernel/hpet.c

   703	
   704	static void __init hpet_select_clockevents(void)
   705	{
   706		unsigned int i;
   707	
   708		hpet_base.nr_clockevents = 0;
   709	
   710		/* No point if MSI is disabled or CPU has an Always Running APIC Timer */
   711		if (hpet_msi_disable || boot_cpu_has(X86_FEATURE_ARAT))
   712			return;
   713	
   714		hpet_print_config();
   715	
   716		hpet_domain = hpet_create_irq_domain(hpet_blockid);
   717		if (!hpet_domain)
   718			return;
   719	
   720		for (i = 0; i < hpet_base.nr_channels; i++) {
   721			struct hpet_channel *hc = hpet_base.channels + i;
   722			int irq;
   723	
   724			if (hc->mode != HPET_MODE_UNUSED)
   725				continue;
   726	
   727			/* Only consider HPET channel with MSI support */
   728			if (!(hc->boot_cfg & HPET_TN_FSB_CAP))
   729				continue;
   730	
 > 731			sprintf(hc->name, "hpet%u", i);
   732	
   733			irq = hpet_assign_irq(hpet_domain, hc, hc->num);
   734			if (irq <= 0)
   735				continue;
   736	
   737			hc->irq = irq;
   738			hc->mode = HPET_MODE_CLOCKEVT;
   739	
   740			if (++hpet_base.nr_clockevents == num_possible_cpus())
   741				break;
   742		}
   743	
   744		pr_info("%d channels of %d reserved for per-cpu timers\n",
   745			hpet_base.nr_channels, hpet_base.nr_clockevents);
   746	}
   747	

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

      reply	other threads:[~2024-12-04 21:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 14:33 [PATCH] arch/x86: Fix the wrong format specifier liujing
2024-12-04 21:22 ` kernel test robot [this message]

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=202412050541.CvNgnYXM-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liujing@cmss.chinamobile.com \
    --cc=mario.limonciello@amd.com \
    --cc=mat.jonczyk@o2.pl \
    --cc=mingo@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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