From: kernel test robot <lkp@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>
Subject: [tip:irq/core 55/56] kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination
Date: Thu, 15 May 2025 10:37:19 +0800 [thread overview]
Message-ID: <202505151057.xbyXAbEn-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
head: 58eb5721a445ea0af310d1410d7117a1910627bc
commit: 47af06c9d31fe558493de4e04f9a07847dc4992f [55/56] genirq: Consistently use '%u' format specifier for unsigned int variables
config: x86_64-randconfig-123-20250515 (https://download.01.org/0day-ci/archive/20250515/202505151057.xbyXAbEn-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/20250515/202505151057.xbyXAbEn-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/202505151057.xbyXAbEn-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/irq/debugfs.c: In function 'irq_debugfs_init':
>> kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination [-Wformat-overflow=]
233 | sprintf(name, "%u", irq);
| ^
In function 'irq_add_debugfs_entry',
inlined from 'irq_add_debugfs_entry' at kernel/irq/debugfs.c:226:6,
inlined from 'irq_debugfs_init' at kernel/irq/debugfs.c:251:3:
kernel/irq/debugfs.c:233:9: note: 'sprintf' output between 2 and 11 bytes into a destination of size 10
233 | sprintf(name, "%u", irq);
| ^~~~~~~~~~~~~~~~~~~~~~~~
vim +/sprintf +233 kernel/irq/debugfs.c
225
226 void irq_add_debugfs_entry(unsigned int irq, struct irq_desc *desc)
227 {
228 char name [10];
229
230 if (!irq_dir || !desc || desc->debugfs_file)
231 return;
232
> 233 sprintf(name, "%u", irq);
234 desc->debugfs_file = debugfs_create_file(name, 0644, irq_dir, desc,
235 &dfs_irq_ops);
236 }
237
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2025-05-15 2:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 2:37 kernel test robot [this message]
2025-05-15 8:19 ` [tip:irq/core 55/56] kernel/irq/debugfs.c:233:26: warning: 'sprintf' may write a terminating nul past the end of the destination Andy Shevchenko
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=202505151057.xbyXAbEn-lkp@intel.com \
--to=lkp@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.