[1/2] riscv: Mark KASAN tmp* page tables variables as static

Message ID 20230704074357.233982-1-alexghiti@rivosinc.com
State New
Headers
Series [1/2] riscv: Mark KASAN tmp* page tables variables as static |

Commit Message

Alexandre Ghiti July 4, 2023, 7:43 a.m. UTC
  tmp_pg_dir, tmp_p4d and tmp_pud are only used in kasan_init.c so they
should be declared as static.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306282202.bODptiGE-lkp@intel.com/
Fixes: 96f9d4daf745 ("riscv: Rework kasan population functions")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
 arch/riscv/mm/kasan_init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

patchwork-bot+linux-riscv@kernel.org Aug. 30, 2023, 1:20 p.m. UTC | #1
Hello:

This series was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Tue,  4 Jul 2023 09:43:56 +0200 you wrote:
> tmp_pg_dir, tmp_p4d and tmp_pud are only used in kasan_init.c so they
> should be declared as static.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202306282202.bODptiGE-lkp@intel.com/
> Fixes: 96f9d4daf745 ("riscv: Rework kasan population functions")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> 
> [...]

Here is the summary with links:
  - [1/2] riscv: Mark KASAN tmp* page tables variables as static
    https://git.kernel.org/riscv/c/56e1803d9de0
  - [2/2] riscv: Move create_tmp_mapping() to init sections
    https://git.kernel.org/riscv/c/d616fce3f100

You are awesome, thank you!
  

Patch

diff --git a/arch/riscv/mm/kasan_init.c b/arch/riscv/mm/kasan_init.c
index 8fc0efcf905c..b88914741f3d 100644
--- a/arch/riscv/mm/kasan_init.c
+++ b/arch/riscv/mm/kasan_init.c
@@ -23,9 +23,9 @@ 
  */
 
 extern pgd_t early_pg_dir[PTRS_PER_PGD];
-pgd_t tmp_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
-p4d_t tmp_p4d[PTRS_PER_P4D] __page_aligned_bss;
-pud_t tmp_pud[PTRS_PER_PUD] __page_aligned_bss;
+static pgd_t tmp_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
+static p4d_t tmp_p4d[PTRS_PER_P4D] __page_aligned_bss;
+static pud_t tmp_pud[PTRS_PER_PUD] __page_aligned_bss;
 
 static void __init kasan_populate_pte(pmd_t *pmd, unsigned long vaddr, unsigned long end)
 {