linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Baoquan He <bhe@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: include/linux/ioremap.h:21 is_ioremap_addr() warn: always true condition '(addr >= (0)) => (0-u32max >= 0)'
Date: Thu, 31 Oct 2024 18:55:06 +0800	[thread overview]
Message-ID: <202410311824.fJAhvOUy-lkp@intel.com> (raw)

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


                 reply	other threads:[~2024-10-31 10:55 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=202410311824.fJAhvOUy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oe-kbuild-all@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox