Re: [PATCH 16/20] x86/cpu: Use alternative_io() in amd_clear_divider()
From: Uros Bizjak
Date: Sat Mar 15 2025 - 05:03:42 EST
On Fri, Mar 14, 2025 at 10:42 PM Josh Poimboeuf <jpoimboe@xxxxxxxxxx> wrote:
>
> Use the standard alternative_io() interface.
>
> Signed-off-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
> ---
> arch/x86/include/asm/processor.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
> index b458ff0e4c79..d7f3f03594a2 100644
> --- a/arch/x86/include/asm/processor.h
> +++ b/arch/x86/include/asm/processor.h
> @@ -709,8 +709,10 @@ static inline u32 per_cpu_l2c_id(unsigned int cpu)
> */
> static __always_inline void amd_clear_divider(void)
> {
> - asm volatile(ALTERNATIVE("", "div %[one]\n\t", X86_BUG_DIV0)
> - :: "a" (0), "d" (0), [one] "r" (1));
> + alternative_io("",
> + "div %[one]\n\t", X86_BUG_DIV0,
A nit - can the above be in one line? Also no need for a trailing \n\t.
Thanks,
Uros.