Skip to content

Commit 1e72ba5

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/mm: Get rid of RELOC_HIDE()
Since __va(0) does not translate to NULL anymore remove RELOC_HIDE() which was only added to get rid of a compile warning with clang W=1: arch/s390/mm/vmem.c:666:36: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 666 | __set_memory_4k(__va(0), __va(0) + ident_map_size); | ~~~~~~~ ^ Reviewed-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 7e12284 commit 1e72ba5

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

arch/s390/mm/vmem.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,8 @@ void __init vmem_map_init(void)
670670
*/
671671
if (!static_key_enabled(&cpu_has_bear))
672672
set_memory_x(0, 1);
673-
if (debug_pagealloc_enabled()) {
674-
/*
675-
* Use RELOC_HIDE() as long as __va(0) translates to NULL,
676-
* since performing pointer arithmetic on a NULL pointer
677-
* has undefined behavior and generates compiler warnings.
678-
*/
679-
__set_memory_4k(__va(0), RELOC_HIDE(__va(0), ident_map_size));
680-
}
673+
if (debug_pagealloc_enabled())
674+
__set_memory_4k(__va(0), __va(0) + ident_map_size);
681675
if (MACHINE_HAS_NX)
682676
system_ctl_set_bit(0, CR0_INSTRUCTION_EXEC_PROTECTION_BIT);
683677
pr_info("Write protected kernel read-only data: %luk\n",

0 commit comments

Comments
 (0)