[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202512061600.89CKQ3ag-lkp@intel.com>
Date: Sat, 6 Dec 2025 16:12:02 +0800
From: kernel test robot <lkp@...el.com>
To: Tamir Duberstein <tamird@...il.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Kees Cook <kees@...nel.org>, Petr Mladek <pmladek@...e.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'
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@...el.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@...ux.intel.com>
:::::: CC: Alexandre Belloni <alexandre.belloni@...tlin.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists