[PATCH 1/2] ARM: assembler: simplify ldr_this_cpu for !SMP builds

Linus Walleij linus.walleij at linaro.org
Wed Mar 2 03:33:27 PST 2022


On Tue, Mar 1, 2022 at 1:04 PM Ard Biesheuvel <ardb at kernel.org> wrote:

> When CONFIG_SMP is not defined, the CPU offset is always zero, and so
> we can simplify the sequence to load a per-CPU variable.
>
> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>

Maybe mention that you add an optional tmp parameter to
ldr_va as well?

>         /*
>          * ldr_va - load a 32-bit word from the virtual address of \sym
>          */
> -       .macro          ldr_va, rd:req, sym:req, cond
> +       .macro          ldr_va, rd:req, sym:req, cond, tmp

The text above this macro could explain what cond and tmp are for,
took me some time to figure it out.

Anyway, it's not like this code was simple to read in the first place, so:
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list