]> git.baikalelectronics.ru Git - kernel.git/commit
sh: pgtable-3level: Fix cast to pointer from integer of different size
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 15 Sep 2021 13:50:04 +0000 (15:50 +0200)
committerRich Felker <dalias@libc.org>
Wed, 27 Oct 2021 20:56:34 +0000 (16:56 -0400)
commit2a9dc5257c843644d3a5a9e1818723b3a1754ef1
tree414f6389c93a6ed0695ab4517dae81f4912a4204
parent0a66f5c00281f494474eaf9b0696adeb02bc2105
sh: pgtable-3level: Fix cast to pointer from integer of different size

If X2TLB=y (CPU_SHX2=y or CPU_SHX3=y, e.g. migor_defconfig), pgd_t.pgd
is "unsigned long long", causing:

    In file included from arch/sh/include/asm/pgtable.h:13,
     from include/linux/pgtable.h:6,
     from include/linux/mm.h:33,
     from arch/sh/kernel/asm-offsets.c:14:
    arch/sh/include/asm/pgtable-3level.h: In function ‘pud_pgtable’:
    arch/sh/include/asm/pgtable-3level.h:37:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       37 |  return (pmd_t *)pud_val(pud);
  |         ^

Fix this by adding an intermediate cast to "unsigned long", which is
basically what the old code did before.

Fixes: 95cd91e68cc4703e ("mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Daniel Palmer <daniel@thingy.jp>
Acked-by: Rob Landley <rob@landley.net>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Rich Felker <dalias@libc.org>
arch/sh/include/asm/pgtable-3level.h