Re: [PATCH] riscv: mm: init: Consolidate vars, functions

Jisheng Zhang
2021-05-17T14:45:49Z

On Sun, 16 May 2021 21:10:48 +0200
Alex Ghiti <alex@ghiti.fr> wrote:

> Hi Jisheng,
>
> On 16/05/2021 15:19, Jisheng Zhang wrote:
> > On Sun, 16 May 2021 21:15:56 +0800 Jisheng Zhang wrote:
> >
> >> From: Jisheng Zhang <jszhang@kernel.org>
> >>
> >> Consolidate the following items in init.c
> >>
> >> Staticize global vars as much as possible;
> >> Add __initdata mark if the global var isn't needed after init
> >> Add __init mark if the func isn't needed after init
> >> Add __ro_after_init if the global var is read only after init
> >
> > Hi Alexandre,
> >
> > I think kernel_virt_addr can be removed, users can directly use
> > the KERNEL_LINK_ADDR MACRO. Maybe I miss the reason of intrducing
> > it in commit 2bfc6cd81bd17e43 ("riscv: Move kernel mapping outside of
> > linear mapping"), could you please comment?
> >
> > Thanks in advance
>
> kernel_virt_addr will be used when I push my relocatable series since
> then, the kernel virtual address will be different from
> KERNEL_LINK_ADDR. I agree this was not needed in 2bfc6cd81bd17e43
> ("riscv: Move kernel mapping outside of linear mapping"), I'm a bit late
> in pushing the relocatable series.
>

Thanks for your information. I think kernel_virt_addr could be __ro_after_init
But I will keep it unchanged until your relocatable series.

thanks