linux-stable/arch
Arnd Bergmann c2e6df3eaa ARM: 9142/1: kasan: work around LPAE build warning
pgd_page_vaddr() returns an 'unsigned long' address, causing a warning
with the memcpy() call in kasan_init():

arch/arm/mm/kasan_init.c: In function 'kasan_init':
include/asm-generic/pgtable-nop4d.h:44:50: error: passing argument 2 of '__memcpy' makes pointer from integer without a cast [-Werror=int-conversion]
   44 | #define pgd_page_vaddr(pgd)                     ((unsigned long)(p4d_pgtable((p4d_t){ pgd })))
      |                                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                  |
      |                                                  long unsigned int
arch/arm/include/asm/string.h:58:45: note: in definition of macro 'memcpy'
   58 | #define memcpy(dst, src, len) __memcpy(dst, src, len)
      |                                             ^~~
arch/arm/mm/kasan_init.c:229:16: note: in expansion of macro 'pgd_page_vaddr'
  229 |                pgd_page_vaddr(*pgd_offset_k(KASAN_SHADOW_START)),
      |                ^~~~~~~~~~~~~~
arch/arm/include/asm/string.h:21:47: note: expected 'const void *' but argument is of type 'long unsigned int'
   21 | extern void *__memcpy(void *dest, const void *src, __kernel_size_t n);
      |                                   ~~~~~~~~~~~~^~~

Avoid this by adding an explicit typecast.

Link: https://lore.kernel.org/all/CACRpkdb3DMvof3-xdtss0Pc6KM36pJA-iy=WhvtNVnsDpeJ24Q@mail.gmail.com/

Fixes: 5615f69bc2 ("ARM: 9016/2: Initialize the mapping of KASan shadow memory")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2021-10-25 13:12:35 +01:00
..
alpha Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
arc Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
arm ARM: 9142/1: kasan: work around LPAE build warning 2021-10-25 13:12:35 +01:00
arm64 Merge branch 'linus' into smp/urgent 2021-09-11 00:38:47 +02:00
csky Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
h8300 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
ia64 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
m68k Merge branch 'akpm' (patches from Andrew) 2021-09-03 10:08:28 -07:00
microblaze Microblaze patches for 5.15-rc1 2021-09-08 16:02:13 -07:00
mips Merge branch 'linus' into smp/urgent 2021-09-11 00:38:47 +02:00
nds32 nds32/setup: remove unused memblock_region variable in setup_memory() 2021-09-08 18:45:53 -07:00
nios2 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
openrisc Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
parisc parisc: Implement __get/put_kernel_nofault() 2021-09-09 22:53:09 +02:00
powerpc arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
riscv Updates for the SMP and CPU hotplug: 2021-09-12 12:42:51 -07:00
s390 2nd batch of s390 updates for 5.15 merge window 2021-09-09 12:55:12 -07:00
sh Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
sparc arch: remove compat_alloc_user_space 2021-09-08 15:32:35 -07:00
um This pull request contains the following changes for UML: 2021-09-09 13:45:26 -07:00
x86 Merge branch 'linus' into smp/urgent 2021-09-11 00:38:47 +02:00
xtensa Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
.gitignore
Kconfig Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00