* 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)'
@ 2026-10-08 3:16 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-10-08 3:16 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-08 3:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-08 3:16 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)' kernel test robot
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.