Skip to content

Commit

Permalink
RISC-V: Fix up a cherry-pick warning in setup_vm_final()
Browse files Browse the repository at this point in the history
This triggers a -Wdeclaration-after-statement as the code has changed a
bit since upstream.  It might be better to hoist the whole block up, but
this is a smaller change so I went with it.

arch/riscv/mm/init.c:755:16: warning: mixing declarations and code is a C99 extension [-Wdeclaration-after-statement]
             unsigned long idx = pgd_index(__fix_to_virt(FIX_FDT));
                           ^
     1 warning generated.

Fixes: bbf94b0 ("riscv: Move early dtb mapping into the fixmap region")
Reported-by: kernel test robot <[email protected]>
Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Palmer Dabbelt <[email protected]>
Signed-off-by: Alexandre Ghiti <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Alexandre Ghiti authored and gregkh committed May 17, 2023
1 parent 3c9b08a commit de9a3ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/riscv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ static void __init setup_vm_final(void)
{
uintptr_t va, map_size;
phys_addr_t pa, start, end;
unsigned long idx __maybe_unused;
u64 i;

/**
Expand All @@ -733,7 +734,7 @@ static void __init setup_vm_final(void)
* directly in swapper_pg_dir in addition to the pgd entry that points
* to fixmap_pte.
*/
unsigned long idx = pgd_index(__fix_to_virt(FIX_FDT));
idx = pgd_index(__fix_to_virt(FIX_FDT));

set_pgd(&swapper_pg_dir[idx], early_pg_dir[idx]);
#endif
Expand Down

0 comments on commit de9a3ed

Please sign in to comment.