All of lore.kernel.org
 help / color / mirror / Atom feed
* [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)'
@ 2026-11-05 21:57 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-05 21:57 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>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-05 21:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-05 21:57 [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)' 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.