powerpc/book3e: Fix sparse report in mm/nohash/fsl_book3e.c
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Sun, 13 Mar 2022 19:41:41 +0000 (20:41 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 May 2022 09:37:46 +0000 (19:37 +1000)
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: kernel test robot <lkp@intel.com>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/fd0cc30b5556428ce1d8a1fc0f983b462e88a956.1647200488.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/mmu_decl.h
arch/powerpc/mm/nohash/fsl_book3e.c

index 0dd4c18f836312064ac94edeb386355b9bd602c3..63c4b1a4d43540da6e3d5d68d18f1c8a18defdeb 100644 (file)
@@ -155,6 +155,10 @@ struct tlbcam {
        u32     MAS3;
        u32     MAS7;
 };
+
+#define NUM_TLBCAMS    64
+
+extern struct tlbcam TLBCAM[NUM_TLBCAMS];
 #endif
 
 #if defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_FSL_BOOKE) || defined(CONFIG_PPC_8xx)
index dfe715e0f70ac741ffb93f630d9bc155c900df0e..9c5387647d1c334781f470a921443397d162730e 100644 (file)
 
 unsigned int tlbcam_index;
 
-#define NUM_TLBCAMS    (64)
 struct tlbcam TLBCAM[NUM_TLBCAMS];
 
-struct tlbcamrange {
+static struct {
        unsigned long start;
        unsigned long limit;
        phys_addr_t phys;
@@ -274,7 +273,7 @@ void __init adjust_total_lowmem(void)
 
        i = switch_to_as1();
        __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: ");
        for (i = 0; i < tlbcam_index - 1; i++)