Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kent Overstreet <kent.overstreet@linux.dev>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Kent Overstreet <kent.overstreet@linux.dev>
Subject: [bcachefs:master 16/108] lib/closure.c:22:32: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int'
Date: Fri, 21 Jun 2024 20:34:10 +0800	[thread overview]
Message-ID: <202406212026.4RHSfZqx-lkp@intel.com> (raw)

tree:   https://evilpiepirate.org/git/bcachefs.git master
head:   1fc1956483665158853d3d1d5f5f54e9c0416758
commit: e5dbf4c912b9e0bae5b19460eba000bbeafc4b3f [16/108] closures: Change BUG_ON() to WARN_ON()
config: arm64-randconfig-002-20240621 (https://download.01.org/0day-ci/archive/20240621/202406212026.4RHSfZqx-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project ad79a14c9e5ec4a369eed4adf567c22cc029863f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240621/202406212026.4RHSfZqx-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/202406212026.4RHSfZqx-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> lib/closure.c:22:32: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
      21 |                  "closure has guard bits set: %x (%lu)",
         |                                                   ~~~
         |                                                   %u
      22 |                  flags & CLOSURE_GUARD_MASK, __fls(r)))
         |                                              ^~~~~~~~
   include/asm-generic/bug.h:134:29: note: expanded from macro 'WARN'
     134 |                 __WARN_printf(TAINT_WARN, format);                      \
         |                                           ^~~~~~
   include/asm-generic/bug.h:106:17: note: expanded from macro '__WARN_printf'
     106 |                 __warn_printk(arg);                                     \
         |                               ^~~
   lib/closure.c:30:37: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
      29 |                      "closure ref hit 0 with incorrect flags set: %x (%lu)",
         |                                                                       ~~~
         |                                                                       %u
      30 |                      flags & ~CLOSURE_DESTRUCTOR, __fls(flags));
         |                                                   ^~~~~~~~~~~~
   include/asm-generic/bug.h:134:29: note: expanded from macro 'WARN'
     134 |                 __WARN_printf(TAINT_WARN, format);                      \
         |                                           ^~~~~~
   include/asm-generic/bug.h:106:17: note: expanded from macro '__WARN_printf'
     106 |                 __warn_printk(arg);                                     \
         |                               ^~~
   2 warnings generated.


vim +22 lib/closure.c

    15	
    16	static inline void closure_put_after_sub(struct closure *cl, int flags)
    17	{
    18		int r = flags & CLOSURE_REMAINING_MASK;
    19	
    20		if (WARN(flags & CLOSURE_GUARD_MASK,
    21			 "closure has guard bits set: %x (%lu)",
  > 22			 flags & CLOSURE_GUARD_MASK, __fls(r)))
    23			r &= ~CLOSURE_GUARD_MASK;
    24	
    25		if (!r) {
    26			smp_acquire__after_ctrl_dep();
    27	
    28			WARN(flags & ~CLOSURE_DESTRUCTOR,
    29			     "closure ref hit 0 with incorrect flags set: %x (%lu)",
    30			     flags & ~CLOSURE_DESTRUCTOR, __fls(flags));
    31	
    32			cl->closure_get_happened = false;
    33	
    34			if (cl->fn && !(flags & CLOSURE_DESTRUCTOR)) {
    35				atomic_set(&cl->remaining,
    36					   CLOSURE_REMAINING_INITIALIZER);
    37				closure_queue(cl);
    38			} else {
    39				struct closure *parent = cl->parent;
    40				closure_fn *destructor = cl->fn;
    41	
    42				closure_debug_destroy(cl);
    43	
    44				if (destructor)
    45					destructor(&cl->work);
    46	
    47				if (parent)
    48					closure_put(parent);
    49			}
    50		}
    51	}
    52	

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

                 reply	other threads:[~2024-06-21 12:35 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=202406212026.4RHSfZqx-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kent.overstreet@linux.dev \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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