Commit 87ccc668 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/book3e: Fix sparse report in mm/nohash/fsl_book3e.c

Make tlbcam_addrs[] static.

Declare TLBCAM[] in mm/mmu_decl.h

And use NULL instead of 0 as pointer when calling restore_to_as0().
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/fd0cc30b5556428ce1d8a1fc0f983b462e88a956.1647200488.git.christophe.leroy@csgroup.eu
parent 5e6ec1ad
...@@ -155,6 +155,10 @@ struct tlbcam { ...@@ -155,6 +155,10 @@ struct tlbcam {
u32 MAS3; u32 MAS3;
u32 MAS7; u32 MAS7;
}; };
#define NUM_TLBCAMS 64
extern struct tlbcam TLBCAM[NUM_TLBCAMS];
#endif #endif
#if defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_FSL_BOOKE) || defined(CONFIG_PPC_8xx) #if defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_FSL_BOOKE) || defined(CONFIG_PPC_8xx)
......
...@@ -51,10 +51,9 @@ ...@@ -51,10 +51,9 @@
unsigned int tlbcam_index; unsigned int tlbcam_index;
#define NUM_TLBCAMS (64)
struct tlbcam TLBCAM[NUM_TLBCAMS]; struct tlbcam TLBCAM[NUM_TLBCAMS];
struct tlbcamrange { static struct {
unsigned long start; unsigned long start;
unsigned long limit; unsigned long limit;
phys_addr_t phys; phys_addr_t phys;
...@@ -274,7 +273,7 @@ void __init adjust_total_lowmem(void) ...@@ -274,7 +273,7 @@ void __init adjust_total_lowmem(void)
i = switch_to_as1(); i = switch_to_as1();
__max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, false, true); __max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, false, true);
restore_to_as0(i, 0, 0, 1); restore_to_as0(i, 0, NULL, 1);
pr_info("Memory CAM mapping: "); pr_info("Memory CAM mapping: ");
for (i = 0; i < tlbcam_index - 1; i++) for (i = 0; i < tlbcam_index - 1; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment