On 15.08.2025 22:41, Andrew Cooper wrote:
> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2733,8 +2733,8 @@ static uint64_t cf_check vmx_get_reg(struct vcpu *v, 
> unsigned int reg)
>      case MSR_SHADOW_GS_BASE:
>          if ( v != curr )
>              return v->arch.hvm.vmx.shadow_gs;
> -        rdmsrl(MSR_SHADOW_GS_BASE, val);
> -        return val;
> +        else
> +            return rdmsr(MSR_SHADOW_GS_BASE);
>      }

Here and below, can we please do without the pointless "else"? Strictly
speaking in Misra's terms that's "dead code" (things working identically
without), and I'm quite happy that I can now use this argument to
support my personal antipathy to this style of coding. Or else use the
conditional operator in such cases (where applicable).

Jan

Reply via email to