All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [kasong:master 14/19] include/linux/mm_inline.h:117 lru_get_gen_flags() warn: mask and shift to zero: expr='(flags & ((((((1))) << (0)) - 1) << (((((((4 * 8) - (32 - 28)) - 0) - 1) - 0) - 0) - 0))) >> (((((((4 * 8) - (32 - 28)) - 0) - 1) - 0) - 0) - 0)'
Date: Thu, 05 Nov 2026 22:57:13 +0100	[thread overview]
Message-ID: <202611052230.DlZJeyer-lkp@intel.com> (raw)

Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Kairui Song <kasong@tencent.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kasong/linux.git master
head:   8101629262ca78b97e4c62eb7257d7b0a27e879c
commit: 7f923cfff2c5a85e53b07f0377c275d23d635314 [14/19] mm/mglru: folio LRU refs based active/inactive number accounting
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: arm-randconfig-2200-20261105 (https://download.01.org/0day-ci/archive/20261105/202611052230.DlZJeyer-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 15.3.0
smatch: v0.5.0-9187-g5189e3fb

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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202611052230.DlZJeyer-lkp@intel.com/

smatch warnings:
include/linux/mm_inline.h:117 lru_get_gen_flags() warn: mask and shift to zero: expr='(flags & ((((((1))) << (0)) - 1) << (((((((4 * 8) - (32 - 28)) - 0) - 1) - 0) - 0) - 0))) >> (((((((4 * 8) - (32 - 28)) - 0) - 1) - 0) - 0) - 0)'

vim +117 include/linux/mm_inline.h

f90d8191ac864d Yu Zhao     2021-02-24  107  
7f923cfff2c5a8 Kairui Song 2026-10-15  108  /**
7f923cfff2c5a8 Kairui Song 2026-10-15  109   * lru_get_gen_flags - Return the LRU generation number from folio flags.
7f923cfff2c5a8 Kairui Song 2026-10-15  110   * @flags: folio flags
7f923cfff2c5a8 Kairui Song 2026-10-15  111   *
7f923cfff2c5a8 Kairui Song 2026-10-15  112   * Returns: A number between 0 and (MAX_NR_GENS - 1), inclusive. Returns
7f923cfff2c5a8 Kairui Song 2026-10-15  113   * -1 if the flags indicate the folio is off the list (e.g., isolated).
7f923cfff2c5a8 Kairui Song 2026-10-15  114   */
7f923cfff2c5a8 Kairui Song 2026-10-15  115  static inline int lru_get_gen_flags(unsigned long flags)
7f923cfff2c5a8 Kairui Song 2026-10-15  116  {
7f923cfff2c5a8 Kairui Song 2026-10-15 @117  	int gen = (flags & LRU_GEN_MASK) >> LRU_GEN_PGOFF;
7f923cfff2c5a8 Kairui Song 2026-10-15  118  
7f923cfff2c5a8 Kairui Song 2026-10-15  119  	/* The gen is stored offset by one, so zero means off-list */
7f923cfff2c5a8 Kairui Song 2026-10-15  120  	VM_WARN_ON_ONCE(gen > MAX_NR_GENS);
7f923cfff2c5a8 Kairui Song 2026-10-15  121  	return gen - 1;
7f923cfff2c5a8 Kairui Song 2026-10-15  122  }
7f923cfff2c5a8 Kairui Song 2026-10-15  123  

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

                 reply	other threads:[~2026-11-05 21:57 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=202611052230.DlZJeyer-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.