linux/arch/powerpc/mm/ptdump
Michael Ellerman 961f649fb3 powerpc/ptdump: Fix sparse warning in hashpagetable.c
As reported by sparse:

  arch/powerpc/mm/ptdump/hashpagetable.c:264:29: warning: restricted __be64 degrades to integer
  arch/powerpc/mm/ptdump/hashpagetable.c:265:49: warning: restricted __be64 degrades to integer
  arch/powerpc/mm/ptdump/hashpagetable.c:267:36: warning: incorrect type in assignment (different base types)
  arch/powerpc/mm/ptdump/hashpagetable.c:267:36:    expected unsigned long long [usertype]
  arch/powerpc/mm/ptdump/hashpagetable.c:267:36:    got restricted __be64 [usertype] v
  arch/powerpc/mm/ptdump/hashpagetable.c:268:36: warning: incorrect type in assignment (different base types)
  arch/powerpc/mm/ptdump/hashpagetable.c:268:36:    expected unsigned long long [usertype]
  arch/powerpc/mm/ptdump/hashpagetable.c:268:36:    got restricted __be64 [usertype] r

The values returned by plpar_pte_read_4() are CPU endian, not __be64, so
assigning them to struct hash_pte confuses sparse. As a minimal fix open
code a struct to hold the values with CPU endian types.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220202053039.691917-1-mpe@ellerman.id.au
2022-02-02 20:32:11 +11:00
..
8xx.c powerpc/ptdump: Reduce level numbers by 1 in note_page() and add p4d level 2021-08-25 13:35:48 +10:00
bats.c powerpc/ptdump: Use DEFINE_SHOW_ATTRIBUTE() 2021-08-25 13:35:48 +10:00
book3s64.c powerpc/ptdump: Reduce level numbers by 1 in note_page() and add p4d level 2021-08-25 13:35:48 +10:00
hashpagetable.c powerpc/ptdump: Fix sparse warning in hashpagetable.c 2022-02-02 20:32:11 +11:00
Makefile powerpc/64s: Move hash MMU support code under CONFIG_PPC_64S_HASH_MMU 2021-12-09 22:41:13 +11:00
ptdump.c powerpc updates for 5.17 2022-01-14 15:17:26 +01:00
ptdump.h powerpc/ptdump: Display size of BATs 2020-05-26 22:22:18 +10:00
segment_regs.c powerpc/ptdump: Use DEFINE_SHOW_ATTRIBUTE() 2021-08-25 13:35:48 +10:00
shared.c powerpc/ptdump: Reduce level numbers by 1 in note_page() and add p4d level 2021-08-25 13:35:48 +10:00