Re: [PATCH] KVM: Using macros instead of magic values

From: Paolo Bonzini
Date: Mon Jul 27 2020 - 10:40:25 EST


On 21/07/20 10:23, Haiwei Li wrote:
> From: Haiwei Li <lihaiwei@xxxxxxxxxxx>
>
> Instead of using magic values, use macros.
>
> Signed-off-by: Haiwei Li <lihaiwei@xxxxxxxxxxx>
> ---
> Âarch/x86/kvm/lapic.c | 3 ++-
> Â1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 47801a4..d5fb2ea 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -2083,7 +2083,8 @@ int kvm_lapic_reg_write(struct kvm_lapic *apic,
> u32 reg, u32 val)
>
> ÂÂÂÂ case APIC_SELF_IPI:
> ÂÂÂÂÂÂÂÂ if (apic_x2apic_mode(apic)) {
> -ÂÂÂÂÂÂÂÂÂÂÂ kvm_lapic_reg_write(apic, APIC_ICR, 0x40000 | (val & 0xff));
> +ÂÂÂÂÂÂÂÂÂÂÂ kvm_lapic_reg_write(apic, APIC_ICR,
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ APIC_DEST_SELF | (val & APIC_VECTOR_MASK));
> ÂÂÂÂÂÂÂÂ } else
> ÂÂÂÂÂÂÂÂÂÂÂÂ ret = 1;
> ÂÂÂÂÂÂÂÂ break;
> --
> 1.8.3.1
>

Queued, thanks.

Paolo