Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: kernel test robot <lkp@intel.com>
Cc: Jori Koolstra <jkoolstra@xs4all.nl>,
	llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Christian Brauner <christianvanbrauner@gmail.com>,
	Christian Brauner <brauner@kernel.org>,
	Jeff Layton <jlayton@kernel.org>
Subject: Re: [brauner-github:vfs-7.2.misc 28/28] fs/open.c:112:29: warning: converting the result of '<<' to a boolean always evaluates to true
Date: Sat, 6 Jun 2026 21:14:14 -0700	[thread overview]
Message-ID: <20260607041414.GA2161204@ax162> (raw)
In-Reply-To: <202606071029.DKCs8WOs-lkp@intel.com>

On Sun, Jun 07, 2026 at 10:49:04AM +0800, kernel test robot wrote:
> Hi Jori,
> 
> FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
> 
> tree:   https://github.com/brauner/linux.git vfs-7.2.misc
> head:   0da79c259ad0554b36761a7135d4f92eb7c46263
> commit: 0da79c259ad0554b36761a7135d4f92eb7c46263 [28/28] vfs: uapi: retire octal and hex numbers in favor of (1 << n) for O_ flags
> config: powerpc64-randconfig-001-20260607 (https://download.01.org/0day-ci/archive/20260607/202606071029.DKCs8WOs-lkp@intel.com/config)
> compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 7917772d7d61384696c61102c08c2ea158e610fa)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260607/202606071029.DKCs8WOs-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/202606071029.DKCs8WOs-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
> >> fs/open.c:112:29: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
>      112 |         error = break_lease(inode, O_WRONLY);
>          |                                    ^
>    include/uapi/asm-generic/fcntl.h:20:21: note: expanded from macro 'O_WRONLY'
>       20 | #define O_WRONLY        (1 << 0)
>          |                            ^

Hmmm, this appears to be pointing out an inconsistency between the
different versions of break_lease(), depending on whether
CONFIG_FILE_LOCKING is set or not.  The CONFIG_FILE_LOCKING=n stub has a
second parameter of 'bool wait' whereas the CONFIG_FILE_LOCKING=y case
has a second parameter of 'unsigned int mode'. 4be9f3cc582a ("filelock:
rework the __break_lease API to use flags") changed this, which seems
incorrect to me.

-- 
Cheers,
Nathan

  reply	other threads:[~2026-06-07  4:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-07  2:49 [brauner-github:vfs-7.2.misc 28/28] fs/open.c:112:29: warning: converting the result of '<<' to a boolean always evaluates to true kernel test robot
2026-06-07  4:14 ` Nathan Chancellor [this message]
2026-06-07 10:07   ` Jeff Layton

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=20260607041414.GA2161204@ax162 \
    --to=nathan@kernel.org \
    --cc=brauner@kernel.org \
    --cc=christianvanbrauner@gmail.com \
    --cc=jkoolstra@xs4all.nl \
    --cc=jlayton@kernel.org \
    --cc=lkp@intel.com \
    --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