Skip to contentSkip to conversation

include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int'

PATCH kernel test robot 1 participant 1 message Feb 2

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor.git apparmor-next
head:   173a18bf6c87bb337d2fe8d59b5a41b3cfa38fda
commit: c140dcd1246bfe705921ca881bbb247ff1ba2bca [9/29] apparmor: make str table more generic and be able to have multiple entries
config: microblaze-randconfig-r073-20260202 (https://download.01.org/0day-ci/archive/20260202/[email protected]/config)
compiler: microblaze-linux-gcc (GCC) 8.5.0
smatch version: v0.5.0-8994-gd50c5a4c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260202/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from include/asm-generic/bug.h:31,
from ./arch/microblaze/include/generated/asm/bug.h:1, from include/linux/bug.h:5,
from include/linux/thread_info.h:13,
from include/linux/sched.h:14,
from include/linux/audit.h:12,
from security/apparmor/include/audit.h:14, from security/apparmor/policy_unpack.c:23:
security/apparmor/policy_unpack.c: In function 'process_strs_entry':

>> include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
    #define KERN_SOH "\001"  /* ASCII Start Of Header */
                     ^~~~~~
   include/linux/printk.h:484:11: note: in definition of macro 'printk_index_wrap'
      _p_func(_fmt, ##__VA_ARGS__);    \
              ^~~~
   include/linux/printk.h:706:3: note: in expansion of macro 'printk'
      printk(fmt, ##__VA_ARGS__);    \
      ^~~~~~
   include/linux/printk.h:722:2: note: in expansion of macro 'printk_ratelimited'
     printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
     ^~~~~~~~~~~~~~~~~~
   include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
    #define KERN_WARNING KERN_SOH "4" /* warning conditions */
                         ^~~~~~~~
   include/linux/printk.h:722:21: note: in expansion of macro 'KERN_WARNING'
     printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                        ^~~~~~~~~~~~
   security/apparmor/include/lib.h:44:4: note: in expansion of macro 'pr_warn_ratelimited'
       pr_warn_ratelimited("%s: " fmt, __func__, ##args); \
       ^~~~~~~~~~~~~~~~~~~
   security/apparmor/policy_unpack.c:475:5: note: in expansion of macro 'AA_DEBUG'
        AA_DEBUG(DEBUG_UNPACK,
        ^~~~~~~~
   security/apparmor/policy_unpack.c:476:34: note: format string is defined here
          "starting with null save=%lu size %d c=%d",
                                   ~~^
                                   %u

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for CAN_DEV Depends on [n]: NETDEVICES [=n] && CAN [=y] Selected by [y]:
- CAN [=y] && NET [=y]

vim +5 include/linux/kern_levels.h

314ba3520e513a Joe Perches 2012-07-30 4
04d2c8c83d0e3a Joe Perches 2012-07-30 @5 #define KERN_SOH "\001" /* ASCII Start Of Header */
04d2c8c83d0e3a Joe Perches 2012-07-30 6 #define KERN_SOH_ASCII '\001'
04d2c8c83d0e3a Joe Perches 2012-07-30 7

:::::: The code at line 5 was first introduced by commit
:::::: 04d2c8c83d0e3ac5f78aeede51babb3236200112 printk: convert the format for KERN_<LEVEL> to a 2 byte pattern

:::::: TO: Joe Perches <[email protected]>
:::::: CC: Linus Torvalds <[email protected]>

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