* arch/arm/include/asm/memory.h:298:23: warning: array subscript -1 is outside array bounds of 'const void[2147483647]'
@ 2023-10-19 0:21 kernel test robot
2023-11-06 13:16 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-10-19 0:21 UTC (permalink / raw)
To: Linus Walleij; +Cc: oe-kbuild-all, linux-kernel
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd72f9c7e512da377074d47d990564959b772643
commit: a9ff6961601d9aa0c42b6eb7d850371f31b1f5e6 ARM: mm: Make virt_to_pfn() a static inline
date: 5 months ago
config: arm-randconfig-r022-20230725 (https://download.01.org/0day-ci/archive/20231019/202310190854.yTRUMqLL-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231019/202310190854.yTRUMqLL-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/202310190854.yTRUMqLL-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from arch/arm/include/asm/page.h:166,
from arch/arm/include/asm/thread_info.h:14,
from include/linux/thread_info.h:60,
from include/asm-generic/preempt.h:5,
from ./arch/arm/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:78,
from include/linux/spinlock.h:56,
from include/linux/mmzone.h:8,
from include/linux/gfp.h:7,
from include/linux/mm.h:7,
from arch/arm/kernel/hibernate.c:17:
In function 'virt_to_pfn',
inlined from 'pfn_is_nosave' at arch/arm/kernel/hibernate.c:29:33:
>> arch/arm/include/asm/memory.h:298:23: warning: array subscript -1 is outside array bounds of 'const void[2147483647]' [-Warray-bounds=]
298 | unsigned long kaddr = (unsigned long)p;
| ^~~~~
In file included from arch/arm/include/asm/sections.h:5,
from include/linux/interrupt.h:21,
from include/linux/kernel_stat.h:9,
from include/linux/cgroup.h:26,
from include/linux/memcontrol.h:13,
from include/linux/swap.h:9,
from include/linux/suspend.h:5,
from arch/arm/kernel/hibernate.c:18:
include/asm-generic/sections.h: In function 'pfn_is_nosave':
include/asm-generic/sections.h:59:45: note: at offset -1 into object '__nosave_end' of size [0, 2147483647]
59 | extern __visible const void __nosave_begin, __nosave_end;
| ^~~~~~~~~~~~
vim +298 arch/arm/include/asm/memory.h
295
296 static inline unsigned long virt_to_pfn(const void *p)
297 {
> 298 unsigned long kaddr = (unsigned long)p;
299 return (((kaddr - PAGE_OFFSET) >> PAGE_SHIFT) +
300 PHYS_PFN_OFFSET);
301 }
302 #define __pa_symbol_nodebug(x) __virt_to_phys_nodebug((x))
303
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: arch/arm/include/asm/memory.h:298:23: warning: array subscript -1 is outside array bounds of 'const void[2147483647]'
2023-10-19 0:21 arch/arm/include/asm/memory.h:298:23: warning: array subscript -1 is outside array bounds of 'const void[2147483647]' kernel test robot
@ 2023-11-06 13:16 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2023-11-06 13:16 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-kbuild-all, linux-kernel
Hi Robot,
On Thu, Oct 19, 2023 at 2:22 AM kernel test robot <lkp@intel.com> wrote:
> In function 'virt_to_pfn',
> inlined from 'pfn_is_nosave' at arch/arm/kernel/hibernate.c:29:33:
> >> arch/arm/include/asm/memory.h:298:23: warning: array subscript -1 is outside array bounds of 'const void[2147483647]' [-Warray-bounds=]
> 298 | unsigned long kaddr = (unsigned long)p;
What does this even mean?
> 296 static inline unsigned long virt_to_pfn(const void *p)
> 297 {
> > 298 unsigned long kaddr = (unsigned long)p;
> 299 return (((kaddr - PAGE_OFFSET) >> PAGE_SHIFT) +
> 300 PHYS_PFN_OFFSET);
> 301 }
Array out of bounds? It's not even an array! What's up with this warning?
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-06 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-19 0:21 arch/arm/include/asm/memory.h:298:23: warning: array subscript -1 is outside array bounds of 'const void[2147483647]' kernel test robot
2023-11-06 13:16 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®