linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* include/linux/ioremap.h:21 is_ioremap_addr() warn: always true condition '(addr >= (0)) => (0-u32max >= 0)'
@ 2024-10-31 10:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-10-31 10:55 UTC (permalink / raw)
  To: Baoquan He
  Cc: oe-kbuild-all, linux-kernel, Andrew Morton, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0fc810ae3ae110f9e2fcccce80fc8c8d62f97907
commit: ac88ff6b9d7dea9f0907c86bdae204dde7d5c0e6 riscv: fix VMALLOC_START definition
date:   11 months ago
config: riscv-randconfig-r071-20241030 (https://download.01.org/0day-ci/archive/20241031/202410311824.fJAhvOUy-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)

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/202410311824.fJAhvOUy-lkp@intel.com/

smatch warnings:
include/linux/ioremap.h:21 is_ioremap_addr() warn: always true condition '(addr >= (0)) => (0-u32max >= 0)'

vim +21 include/linux/ioremap.h

016fec91013cfb Baoquan He 2023-07-06   7  
016fec91013cfb Baoquan He 2023-07-06   8  #if defined(CONFIG_HAS_IOMEM) || defined(CONFIG_GENERIC_IOREMAP)
016fec91013cfb Baoquan He 2023-07-06   9  /*
016fec91013cfb Baoquan He 2023-07-06  10   * Ioremap often, but not always uses the generic vmalloc area. E.g on
016fec91013cfb Baoquan He 2023-07-06  11   * Power ARCH, it could have different ioremap space.
016fec91013cfb Baoquan He 2023-07-06  12   */
016fec91013cfb Baoquan He 2023-07-06  13  #ifndef IOREMAP_START
016fec91013cfb Baoquan He 2023-07-06  14  #define IOREMAP_START   VMALLOC_START
016fec91013cfb Baoquan He 2023-07-06  15  #define IOREMAP_END     VMALLOC_END
016fec91013cfb Baoquan He 2023-07-06  16  #endif
016fec91013cfb Baoquan He 2023-07-06  17  static inline bool is_ioremap_addr(const void *x)
016fec91013cfb Baoquan He 2023-07-06  18  {
016fec91013cfb Baoquan He 2023-07-06  19  	unsigned long addr = (unsigned long)kasan_reset_tag(x);
016fec91013cfb Baoquan He 2023-07-06  20  
016fec91013cfb Baoquan He 2023-07-06 @21  	return addr >= IOREMAP_START && addr < IOREMAP_END;
016fec91013cfb Baoquan He 2023-07-06  22  }
016fec91013cfb Baoquan He 2023-07-06  23  #else
016fec91013cfb Baoquan He 2023-07-06  24  static inline bool is_ioremap_addr(const void *x)
016fec91013cfb Baoquan He 2023-07-06  25  {
016fec91013cfb Baoquan He 2023-07-06  26  	return false;
016fec91013cfb Baoquan He 2023-07-06  27  }
016fec91013cfb Baoquan He 2023-07-06  28  #endif
016fec91013cfb Baoquan He 2023-07-06  29  

:::::: The code at line 21 was first introduced by commit
:::::: 016fec91013cfb27c9f5a101a87ae8266537fed1 mm: move is_ioremap_addr() into new header file

:::::: TO: Baoquan He <bhe@redhat.com>
:::::: CC: Andrew Morton <akpm@linux-foundation.org>

-- 
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:[~2024-10-31 10:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-31 10:55 include/linux/ioremap.h:21 is_ioremap_addr() warn: always true condition '(addr >= (0)) => (0-u32max >= 0)' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox