Re: [PATCH 4/4] x86/kvm: Resolve shadow warning from min macro

Paolo Bonzini
2014-07-25T14:06:13Z

Il 25/07/2014 15:27, Jeff Kirsher ha scritto:
> From: Mark Rustad <mark.d.rustad@intel.com>
>
> Resolve a shadow warning generated in W=2 builds by the nested
> use of the min macro by instead using the min3 macro for the
> minimum of 3 values.
>
> Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> arch/x86/kvm/emulate.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index e4e833d..2d6c97a 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -1315,8 +1315,7 @@ static int pio_in_emulated(struct x86_emulate_ctxt *ctxt,
> in_page = (ctxt->eflags & EFLG_DF) ?
> offset_in_page(reg_read(ctxt, VCPU_REGS_RDI)) :
> PAGE_SIZE - offset_in_page(reg_read(ctxt, VCPU_REGS_RDI));
> - n = min(min(in_page, (unsigned int)sizeof(rc->data)) / size,
> - count);
> + n = min3(in_page, (unsigned int)sizeof(rc->data) / size, count);
> if (n == 0)
> n = 1;
> rc->pos = rc->end = 0;
>

Applied.

Paolo