Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	David Hildenbrand <david@kernel.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	mm-commits@vger.kernel.org, Davidlohr Bueso <dave@stgolabs.net>
Subject: [akpm-mm:mm-new 117/130] arch/riscv/mm/init.c:116:22: warning: implicit conversion from 'unsigned long long' to 'u32' (aka 'unsigned int') changes value from 1099511627776 to 0
Date: Thu, 30 Apr 2026 08:49:15 +0800	[thread overview]
Message-ID: <202604300817.QeXlZapz-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-new
head:   0587fb0c820d86e5b77a975680d79b5176d09abb
commit: 93580c23bb3da5dd2926d6ae991ef04c2cdacaf2 [117/130] include/asm-generic/fixmap.h: reimplement nasty macros in C
config: riscv-allyesconfig (https://download.01.org/0day-ci/archive/20260430/202604300817.QeXlZapz-lkp@intel.com/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260430/202604300817.QeXlZapz-lkp@intel.com/reproduce)

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/202604300817.QeXlZapz-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/riscv/mm/init.c:27:
   In file included from arch/riscv/include/asm/fixmap.h:64:
   include/asm-generic/fixmap.h:93:26: error: use of undeclared identifier 'PAGE_KERNEL_NOCACHE'
           __set_fixmap(idx, phys, FIXMAP_PAGE_NOCACHE);
                                   ^
   include/asm-generic/fixmap.h:54:29: note: expanded from macro 'FIXMAP_PAGE_NOCACHE'
   #define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE
                               ^
   include/asm-generic/fixmap.h:99:33: error: use of undeclared identifier 'PAGE_KERNEL_NOCACHE'
           __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NOCACHE);
                                          ^
   include/asm-generic/fixmap.h:54:29: note: expanded from macro 'FIXMAP_PAGE_NOCACHE'
   #define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE
                               ^
>> arch/riscv/mm/init.c:116:22: warning: implicit conversion from 'unsigned long long' to 'u32' (aka 'unsigned int') changes value from 1099511627776 to 0 [-Wconstant-conversion]
                      (((t) - (b)) >> LOG2_SZ_1T));
                                      ^~~~~~~~~~
   include/linux/printk.h:574:36: note: expanded from macro 'pr_notice'
           printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
                                             ^~~~~~~~~~~
   include/linux/printk.h:511:60: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                                                              ^~~~~~~~~~~
   include/linux/printk.h:483:19: note: expanded from macro 'printk_index_wrap'
                   _p_func(_fmt, ##__VA_ARGS__);                           \
                                   ^~~~~~~~~~~
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/uapi/linux/const.h:20:20: note: expanded from macro '__AC'
   #define __AC(X,Y)       (X##Y)
                            ^~~~
   <scratch space>:6:1: note: expanded from here
   0x10000000000ULL
   ^~~~~~~~~~~~~~~~
   include/linux/log2.h:162:14: note: expanded from macro 'ilog2'
           __ilog2_u32(n) :                \
           ~~~~~~~~~~~ ^
   arch/riscv/mm/init.c:126:43: warning: implicit conversion from 'unsigned long long' to 'u32' (aka 'unsigned int') changes value from 1099511627776 to 0 [-Wconstant-conversion]
           if (IS_ENABLED(CONFIG_64BIT) && (diff >> LOG2_SZ_1T) >= 10)
                                                    ^~~~~~~~~~
   arch/riscv/mm/init.c:92:27: note: expanded from macro 'LOG2_SZ_1T'
   #define LOG2_SZ_1T  ilog2(SZ_1T)
                       ~~~~~~^~~~~~
   include/linux/sizes.h:63:18: note: expanded from macro 'SZ_1T'
   #define SZ_1T                           _AC(0x10000000000, ULL)
                                           ^~~~~~~~~~~~~~~~~~~~~~~
   include/uapi/linux/const.h:21:18: note: expanded from macro '_AC'
   #define _AC(X,Y)        __AC(X,Y)
                           ^~~~~~~~~
   include/uapi/linux/const.h:20:20: note: expanded from macro '__AC'
   #define __AC(X,Y)       (X##Y)
                            ^~~~
   <scratch space>:11:1: note: expanded from here
   0x10000000000ULL
   ^~~~~~~~~~~~~~~~
   include/linux/log2.h:162:14: note: expanded from macro 'ilog2'
           __ilog2_u32(n) :                \
           ~~~~~~~~~~~ ^
   arch/riscv/mm/init.c:245:49: warning: implicit conversion from 'unsigned long long' to 'u32' (aka 'unsigned int') changes value from 17179869184 to 0 [-Wconstant-conversion]
                   vmemmap_start_pfn = round_down(phys_ram_base, VMEMMAP_ADDR_ALIGN) >> PAGE_SHIFT;
                                                                 ^~~~~~~~~~~~~~~~~~
   arch/riscv/mm/init.c:67:9: note: expanded from macro 'VMEMMAP_ADDR_ALIGN'
                                       MAX_FOLIO_VMEMMAP_ALIGN)
                                       ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:108:3: note: expanded from macro 'MAX_FOLIO_VMEMMAP_ALIGN'
            MAX_FOLIO_NR_PAGES * sizeof(struct page) : 0)
            ^~~~~~~~~~~~~~~~~~
   include/linux/mmzone.h:97:36: note: expanded from macro 'MAX_FOLIO_NR_PAGES'
   #define MAX_FOLIO_NR_PAGES      (1UL << MAX_FOLIO_ORDER)
                                           ^~~~~~~~~~~~~~~
   note: (skipping 8 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/minmax.h:92:28: note: expanded from macro '__careful_cmp_once'
           auto ux = (x); auto uy = (y);                   \
                                     ^
   include/linux/math.h:35:50: note: expanded from macro 'round_down'
   #define round_down(x, y) ((x) & ~__round_mask(x, y))
                                                    ^
   include/linux/math.h:15:46: note: expanded from macro '__round_mask'
   #define __round_mask(x, y) ((__typeof__(x))((y)-1))
                                                ^
   3 warnings and 2 errors generated.


vim +116 arch/riscv/mm/init.c

26b8f69edda85a Alexandre Ghiti 2021-12-06  111  
26b8f69edda85a Alexandre Ghiti 2021-12-06  112  #ifdef CONFIG_64BIT
26b8f69edda85a Alexandre Ghiti 2021-12-06  113  static inline void print_mlt(char *name, unsigned long b, unsigned long t)
26b8f69edda85a Alexandre Ghiti 2021-12-06  114  {
26b8f69edda85a Alexandre Ghiti 2021-12-06  115  	pr_notice("%12s : 0x%08lx - 0x%08lx   (%4ld TB)\n", name, b, t,
26b8f69edda85a Alexandre Ghiti 2021-12-06 @116  		   (((t) - (b)) >> LOG2_SZ_1T));
26b8f69edda85a Alexandre Ghiti 2021-12-06  117  }
26b8f69edda85a Alexandre Ghiti 2021-12-06  118  #else
26b8f69edda85a Alexandre Ghiti 2021-12-06  119  #define print_mlt(n, b, t) do {} while (0)
26b8f69edda85a Alexandre Ghiti 2021-12-06  120  #endif
26b8f69edda85a Alexandre Ghiti 2021-12-06  121  

:::::: The code at line 116 was first introduced by commit
:::::: 26b8f69edda85a7942fa580360690c2d5c74f765 riscv: Improve virtual kernel memory layout dump

:::::: TO: Alexandre Ghiti <alexandre.ghiti@canonical.com>
:::::: CC: Palmer Dabbelt <palmer@rivosinc.com>

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


                 reply	other threads:[~2026-04-30  0:50 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=202604300817.QeXlZapz-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=david@kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llvm@lists.linux.dev \
    --cc=mm-commits@vger.kernel.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