diff mbox series

[-fixes] riscv: Fix unused variable warning when BUILTIN_DTB is set

Message ID 20230519131311.391960-1-alexghiti@rivosinc.com (mailing list archive)
State Accepted
Commit 33d418da6f476b15e4510e0a590062583f63cd36
Headers show
Series [-fixes] riscv: Fix unused variable warning when BUILTIN_DTB is set | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be fixes at HEAD 3b90b09af5be
conchuod/fixes_present success Fixes tag present in non-next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 6 and now 6
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 8 this patch: 8
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 9 this patch: 9
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 3 this patch: 3
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
conchuod/build_rv64_nommu_k210_defconfig success Build OK
conchuod/verify_fixes success Fixes tag looks correct
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Alexandre Ghiti May 19, 2023, 1:13 p.m. UTC
commit ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap
region") wrongly moved the #ifndef CONFIG_BUILTIN_DTB surrounding the pa
variable definition in create_fdt_early_page_table(), so move it back to
its right place to quiet the following warning:

../arch/riscv/mm/init.c: In function ‘create_fdt_early_page_table’:
../arch/riscv/mm/init.c:925:12: warning: unused variable ‘pa’ [-Wunused-variable]
  925 |  uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);

Fixes: ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap region")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
 arch/riscv/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Conor Dooley May 19, 2023, 1:54 p.m. UTC | #1
On Fri, May 19, 2023 at 03:13:11PM +0200, Alexandre Ghiti wrote:
> commit ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap
> region") wrongly moved the #ifndef CONFIG_BUILTIN_DTB surrounding the pa
> variable definition in create_fdt_early_page_table(), so move it back to
> its right place to quiet the following warning:
> 
> ../arch/riscv/mm/init.c: In function ‘create_fdt_early_page_table’:
> ../arch/riscv/mm/init.c:925:12: warning: unused variable ‘pa’ [-Wunused-variable]
>   925 |  uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
> 
> Fixes: ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap region")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

Thanks Alex.
patchwork-bot+linux-riscv@kernel.org May 31, 2023, 3:10 p.m. UTC | #2
Hello:

This patch was applied to riscv/linux.git (fixes)
by Palmer Dabbelt <palmer@rivosinc.com>:

On Fri, 19 May 2023 15:13:11 +0200 you wrote:
> commit ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap
> region") wrongly moved the #ifndef CONFIG_BUILTIN_DTB surrounding the pa
> variable definition in create_fdt_early_page_table(), so move it back to
> its right place to quiet the following warning:
> 
> ../arch/riscv/mm/init.c: In function ‘create_fdt_early_page_table’:
> ../arch/riscv/mm/init.c:925:12: warning: unused variable ‘pa’ [-Wunused-variable]
>   925 |  uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
> 
> [...]

Here is the summary with links:
  - [-fixes] riscv: Fix unused variable warning when BUILTIN_DTB is set
    https://git.kernel.org/riscv/c/33d418da6f47

You are awesome, thank you!
diff mbox series

Patch

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 747e5b1ef02d..c6bb966e4123 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -922,9 +922,9 @@  static void __init create_kernel_page_table(pgd_t *pgdir, bool early)
 static void __init create_fdt_early_page_table(uintptr_t fix_fdt_va,
 					       uintptr_t dtb_pa)
 {
+#ifndef CONFIG_BUILTIN_DTB
 	uintptr_t pa = dtb_pa & ~(PMD_SIZE - 1);
 
-#ifndef CONFIG_BUILTIN_DTB
 	/* Make sure the fdt fixmap address is always aligned on PMD size */
 	BUILD_BUG_ON(FIX_FDT % (PMD_SIZE / PAGE_SIZE));