[s390:for-next 68/91] arch/s390/mm/vmem.c:665:36: warning: performing pointer arithmetic on a null pointer has undefined behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git for-next
head:   6abcbcab29996eba5d4bc5df20ed0bb4800effa9
commit: d7bebcb4a898bd214bbd71107f975b7b9f0bde32 [68/91] s390: Optimize __pa/__va when RANDOMIZE_IDENTITY_BASE is off
config: s390-randconfig-001-20250127 (https://download.01.org/0day-ci/archive/20250127/202501270309.HzsVNo3o-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 19306351a2c45e266fa11b41eb1362b20b6ca56d)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250127/202501270309.HzsVNo3o-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501270309.HzsVNo3o-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   In file included from arch/s390/mm/vmem.c:7:
   In file included from include/linux/memblock.h:12:
   In file included from include/linux/mm.h:2223:
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> arch/s390/mm/vmem.c:665:36: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     665 |                 __set_memory_4k(__va(0), __va(0) + ident_map_size);
         |                                          ~~~~~~~ ^
   2 warnings generated.


vim +665 arch/s390/mm/vmem.c

4df29d2b9024d6 Alexander Gordeev 2022-07-20  651  
f4eb07c17df2e6 Heiko Carstens    2006-12-08  652  void __init vmem_map_init(void)
f4eb07c17df2e6 Heiko Carstens    2006-12-08  653  {
a7eb28801b692d Heiko Carstens    2023-08-25  654  	__set_memory_rox(_stext, _etext);
a7eb28801b692d Heiko Carstens    2023-08-25  655  	__set_memory_ro(_etext, __end_rodata);
a7eb28801b692d Heiko Carstens    2023-08-25  656  	__set_memory_rox(__stext_amode31, __etext_amode31);
a6e49f10f4411e Heiko Carstens    2023-08-25  657  	/*
a6e49f10f4411e Heiko Carstens    2023-08-25  658  	 * If the BEAR-enhancement facility is not installed the first
a6e49f10f4411e Heiko Carstens    2023-08-25  659  	 * prefix page is used to return to the previous context with
a6e49f10f4411e Heiko Carstens    2023-08-25  660  	 * an LPSWE instruction and therefore must be executable.
a6e49f10f4411e Heiko Carstens    2023-08-25  661  	 */
c0f1d478121131 Heiko Carstens    2023-08-25  662  	if (!static_key_enabled(&cpu_has_bear))
c0f1d478121131 Heiko Carstens    2023-08-25  663  		set_memory_x(0, 1);
1e72ba5566d90a Heiko Carstens    2024-07-29  664  	if (debug_pagealloc_enabled())
1e72ba5566d90a Heiko Carstens    2024-07-29 @665  		__set_memory_4k(__va(0), __va(0) + ident_map_size);

:::::: The code at line 665 was first introduced by commit
:::::: 1e72ba5566d90a668c1c0fbde319cec03454fd20 s390/mm: Get rid of RELOC_HIDE()

:::::: TO: Heiko Carstens <hca@xxxxxxxxxxxxx>
:::::: CC: Vasily Gorbik <gor@xxxxxxxxxxxxx>

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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux