[tip:tmp.tmp2 255/364] include/linux/printk.h:505:9: error: type defaults to 'int' in declaration of 'DEFINE_RATELIMIT_STATE'

From: kernel test robot
Date: Mon Jun 14 2021 - 14:20:24 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git tmp.tmp2
head: adcceb5eb7aee38e4a9c15bdf599655f0e1b1324
commit: a490873e1d58c0b339bb50ee382dc1fe95c6d9a4 [255/364] sched/headers, printk: Reduce <linux/printk.h> header dependencies
config: x86_64-rhel-8.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=a490873e1d58c0b339bb50ee382dc1fe95c6d9a4
git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
git fetch --no-tags tip tmp.tmp2
git checkout a490873e1d58c0b339bb50ee382dc1fe95c6d9a4
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

In file included from include/linux/kernel.h:7,
from include/linux/crypto.h:16,
from include/crypto/algapi.h:10,
from crypto/arc4.c:10:
crypto/arc4.c: In function 'crypto_arc4_init':
>> include/linux/printk.h:505:9: error: type defaults to 'int' in declaration of 'DEFINE_RATELIMIT_STATE' [-Werror=implicit-int]
505 | static DEFINE_RATELIMIT_STATE(_rs, \
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:526:2: note: in expansion of macro 'printk_ratelimited'
526 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~
crypto/arc4.c:46:2: note: in expansion of macro 'pr_warn_ratelimited'
46 | pr_warn_ratelimited("\"%s\" (%ld) uses obsolete ecb(arc4) skcipher\n",
| ^~~~~~~~~~~~~~~~~~~
>> crypto/arc4.c:46:2: warning: parameter names (without types) in function declaration
In file included from include/linux/kernel.h:7,
from include/linux/crypto.h:16,
from include/crypto/algapi.h:10,
from crypto/arc4.c:10:
>> include/linux/printk.h:505:9: error: invalid storage class for function 'DEFINE_RATELIMIT_STATE'
505 | static DEFINE_RATELIMIT_STATE(_rs, \
| ^~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:526:2: note: in expansion of macro 'printk_ratelimited'
526 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~
crypto/arc4.c:46:2: note: in expansion of macro 'pr_warn_ratelimited'
46 | pr_warn_ratelimited("\"%s\" (%ld) uses obsolete ecb(arc4) skcipher\n",
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/printk.h:509:6: error: implicit declaration of function '__ratelimit' [-Werror=implicit-function-declaration]
509 | if (__ratelimit(&_rs)) \
| ^~~~~~~~~~~
include/linux/printk.h:526:2: note: in expansion of macro 'printk_ratelimited'
526 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~
crypto/arc4.c:46:2: note: in expansion of macro 'pr_warn_ratelimited'
46 | pr_warn_ratelimited("\"%s\" (%ld) uses obsolete ecb(arc4) skcipher\n",
| ^~~~~~~~~~~~~~~~~~~
>> include/linux/printk.h:509:19: error: '_rs' undeclared (first use in this function)
509 | if (__ratelimit(&_rs)) \
| ^~~
include/linux/printk.h:526:2: note: in expansion of macro 'printk_ratelimited'
526 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~
crypto/arc4.c:46:2: note: in expansion of macro 'pr_warn_ratelimited'
46 | pr_warn_ratelimited("\"%s\" (%ld) uses obsolete ecb(arc4) skcipher\n",
| ^~~~~~~~~~~~~~~~~~~
include/linux/printk.h:509:19: note: each undeclared identifier is reported only once for each function it appears in
509 | if (__ratelimit(&_rs)) \
| ^~~
include/linux/printk.h:526:2: note: in expansion of macro 'printk_ratelimited'
526 | printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~~~~~~~~
crypto/arc4.c:46:2: note: in expansion of macro 'pr_warn_ratelimited'
46 | pr_warn_ratelimited("\"%s\" (%ld) uses obsolete ecb(arc4) skcipher\n",
| ^~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +505 include/linux/printk.h

16cb839f133249 Joe Perches 2011-01-12 497
968ab1838a5d48 Linus Torvalds 2010-11-15 498 /*
968ab1838a5d48 Linus Torvalds 2010-11-15 499 * ratelimited messages with local ratelimit_state,
968ab1838a5d48 Linus Torvalds 2010-11-15 500 * no local ratelimit_state used in the !PRINTK case
968ab1838a5d48 Linus Torvalds 2010-11-15 501 */
968ab1838a5d48 Linus Torvalds 2010-11-15 502 #ifdef CONFIG_PRINTK
6ec42a56e25846 Joe Perches 2011-01-12 503 #define printk_ratelimited(fmt, ...) \
6ec42a56e25846 Joe Perches 2011-01-12 504 ({ \
968ab1838a5d48 Linus Torvalds 2010-11-15 @505 static DEFINE_RATELIMIT_STATE(_rs, \
968ab1838a5d48 Linus Torvalds 2010-11-15 506 DEFAULT_RATELIMIT_INTERVAL, \
968ab1838a5d48 Linus Torvalds 2010-11-15 507 DEFAULT_RATELIMIT_BURST); \
968ab1838a5d48 Linus Torvalds 2010-11-15 508 \
968ab1838a5d48 Linus Torvalds 2010-11-15 @509 if (__ratelimit(&_rs)) \
968ab1838a5d48 Linus Torvalds 2010-11-15 510 printk(fmt, ##__VA_ARGS__); \
968ab1838a5d48 Linus Torvalds 2010-11-15 511 })
968ab1838a5d48 Linus Torvalds 2010-11-15 512 #else
6ec42a56e25846 Joe Perches 2011-01-12 513 #define printk_ratelimited(fmt, ...) \
6ec42a56e25846 Joe Perches 2011-01-12 514 no_printk(fmt, ##__VA_ARGS__)
968ab1838a5d48 Linus Torvalds 2010-11-15 515 #endif
968ab1838a5d48 Linus Torvalds 2010-11-15 516

:::::: The code at line 505 was first introduced by commit
:::::: 968ab1838a5d48f02f5b471aa1d0e59e2cc2ccbc include/linux/kernel.h: Move logging bits to include/linux/printk.h

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip