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: include/linux/mm_inline.h:131 lru_get_gen_flags() warn: mask and shift to zero: expr='(flags & ((((((1))) << (0)) - 1) << (((((((4 * 8) - 0) - 0) - 1) - 0) - 0) - 0))) >> (((((((4 * 8) - 0) - 0) - 1) - 0) - 0) - 0)'
Date: Thu, 08 Oct 2026 05:16:02 +0200	[thread overview]
Message-ID: <202610080506.maQBOXyi-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>
CC: 0day robot <lkp@intel.com>

tree:   https://github.com/intel-lab-lkp/linux/commits/Kairui-Song-via-B4-Relay/mm-memcontrol-allow-update-of-LRU-statistic-without-holding-LRU-lock/20261003-205512
head:   fb7e985a90aa08774d1149de30384a36bb55bafb
commit: 484b378ce18958b2f1eef68305e242c351e2d2e5 mm/mglru: folio LRU refs based active/inactive number accounting
date:   5 days ago
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: openrisc-randconfig-r2202-20261008 (https://download.01.org/0day-ci/archive/20261008/202610080506.maQBOXyi-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.2.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/202610080506.maQBOXyi-lkp@intel.com/

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

vim +131 include/linux/mm_inline.h

49ccf47e2e054aa Kairui Song 2026-09-06  121  
49ccf47e2e054aa Kairui Song 2026-09-06  122  /**
49ccf47e2e054aa Kairui Song 2026-09-06  123   * lru_get_gen_flags - Return the LRU generation number from folio flags.
49ccf47e2e054aa Kairui Song 2026-09-06  124   * @flags: folio flags
49ccf47e2e054aa Kairui Song 2026-09-06  125   *
49ccf47e2e054aa Kairui Song 2026-09-06  126   * Returns: A number between 0 and (MAX_NR_GENS - 1), inclusive. Returns
49ccf47e2e054aa Kairui Song 2026-09-06  127   * -1 if the flags indicate the folio is off the list (e.g., isolated).
49ccf47e2e054aa Kairui Song 2026-09-06  128   */
49ccf47e2e054aa Kairui Song 2026-09-06  129  static inline int lru_get_gen_flags(unsigned long flags)
ac35a490237446b Yu Zhao     2022-09-18  130  {
49ccf47e2e054aa Kairui Song 2026-09-06 @131  	int gen = ((flags & LRU_GEN_MASK) >> LRU_GEN_PGOFF) - 1;
ac35a490237446b Yu Zhao     2022-09-18  132  
49ccf47e2e054aa Kairui Song 2026-09-06  133  	/* Exclude the legal -1 from the unsigned MAX_NR_GENS comparison */
49ccf47e2e054aa Kairui Song 2026-09-06  134  	VM_WARN_ON_ONCE(gen != -1 && gen >= MAX_NR_GENS);
49ccf47e2e054aa Kairui Song 2026-09-06  135  	return gen;
49ccf47e2e054aa Kairui Song 2026-09-06  136  }
49ccf47e2e054aa Kairui Song 2026-09-06  137  

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

                 reply	other threads:[~2026-10-08  3:16 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=202610080506.maQBOXyi-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.