Skip to content

Commit 3274a6e

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: mm: init: remove _pt_ops and use pt_ops directly
Except "pt_ops", other global vars when CONFIG_XIP_KERNEL=y is defined as below: |foo_type foo; |#ifdef CONFIG_XIP_KERNEL |#define foo (*(foo_type *)XIP_FIXUP(&foo)) |#endif Follow the same way for pt_ops to unify the style and to simplify code. Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Reviewed-by: Alexandre Ghiti <alex@ghiti.fr> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 07aabe8 commit 3274a6e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

arch/riscv/mm/init.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,10 @@ static void __init setup_bootmem(void)
227227
}
228228

229229
#ifdef CONFIG_MMU
230-
static struct pt_alloc_ops _pt_ops __initdata;
230+
static struct pt_alloc_ops pt_ops __initdata;
231231

232232
#ifdef CONFIG_XIP_KERNEL
233-
#define pt_ops (*(struct pt_alloc_ops *)XIP_FIXUP(&_pt_ops))
234-
#else
235-
#define pt_ops _pt_ops
233+
#define pt_ops (*(struct pt_alloc_ops *)XIP_FIXUP(&pt_ops))
236234
#endif
237235

238236
unsigned long riscv_pfn_base __ro_after_init;

0 commit comments

Comments
 (0)