mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Tamir Duberstein <tamird@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Kees Cook <kees@kernel.org>, Petr Mladek <pmladek@suse.com>
Subject: lib/tests/printf_kunit.c:339:2: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'test_hashed'
Date: Sat, 6 Dec 2025 16:12:02 +0800	[thread overview]
Message-ID: <202512061600.89CKQ3ag-lkp@intel.com> (raw)

Hi Tamir,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   416f99c3b16f582a3fc6d64a1f77f39d94b76de5
commit: 7a79e7daa84e230266184a2018507551086c2317 printf: convert self-test to KUnit
date:   9 months ago
config: arm-randconfig-r072-20251206 (https://download.01.org/0day-ci/archive/20251206/202512061600.89CKQ3ag-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 6d8714b52375b3b7a7f269cd1ec4cc73baece38b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251206/202512061600.89CKQ3ag-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/202512061600.89CKQ3ag-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/tests/printf_kunit.c:339:2: warning: diagnostic behavior may be improved by adding the 'format(printf, 1, 2)' attribute to the declaration of 'test_hashed' [-Wmissing-format-attribute]
     325 | static void
         | __attribute__((format(printf, 1, 2))) 
     326 | test_hashed(const char *fmt, const void *p)
     327 | {
     328 |         char buf[PLAIN_BUF_SIZE];
     329 |         int ret;
     330 | 
     331 |         /*
     332 |          * No need to increase failed test counter since this is assumed
     333 |          * to be called after plain().
     334 |          */
     335 |         ret = plain_hash_to_buffer(p, buf, PLAIN_BUF_SIZE);
     336 |         if (ret)
     337 |                 return;
     338 | 
     339 |         test(buf, fmt, p);
         |         ^
   lib/tests/printf_kunit.c:147:51: note: expanded from macro 'test'
     147 |         __test(expect, strlen(expect), fmt, ##__VA_ARGS__)
         |                                                          ^
   lib/tests/printf_kunit.c:326:1: note: 'test_hashed' declared here
     326 | test_hashed(const char *fmt, const void *p)
         | ^
   1 warning generated.


vim +339 lib/tests/printf_kunit.c

707cc7280f452a lib/test_printf.c        Rasmus Villemoes 2015-11-06  324  
7a79e7daa84e23 lib/tests/printf_kunit.c Tamir Duberstein 2025-03-07  325  static void
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  326  test_hashed(const char *fmt, const void *p)
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  327  {
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  328  	char buf[PLAIN_BUF_SIZE];
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  329  	int ret;
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  330  
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  331  	/*
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  332  	 * No need to increase failed test counter since this is assumed
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  333  	 * to be called after plain().
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  334  	 */
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  335  	ret = plain_hash_to_buffer(p, buf, PLAIN_BUF_SIZE);
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  336  	if (ret)
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  337  		return;
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  338  
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04 @339  	test(buf, fmt, p);
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  340  }
4d42c44727a062 lib/test_printf.c        Andy Shevchenko  2018-12-04  341  

:::::: The code at line 339 was first introduced by commit
:::::: 4d42c44727a062e233e446c6c86da1c84d762d79 lib/vsprintf: Print time and date in human readable format via %pt

:::::: TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
:::::: CC: Alexandre Belloni <alexandre.belloni@bootlin.com>

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

                 reply	other threads:[~2025-12-06  8:12 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=202512061600.89CKQ3ag-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pmladek@suse.com \
    --cc=tamird@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

Powered by JetHome