[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cace40f9-2d90-c27b-675d-4d12a4e2ddc6@redhat.com>
Date: Fri, 30 Jun 2017 12:46:07 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Nick Desaulniers <nick.desaulniers@...il.com>
Cc: Radim Krčmář <rkrcmar@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] KVM: x86: remove ignored type attribute
On 28/06/2017 04:37, Nick Desaulniers wrote:
> The macro insn_fetch marks the 'type' argument as having a specified
> alignment. Type attributes can only be applied to structs, unions, or
> enums, but insn_fetch is only ever invoked with integral types, so Clang
> produces 19 -Wignored-attributes warnings for this source file.
>
> Signed-off-by: Nick Desaulniers <nick.desaulniers@...il.com>
> ---
> Changes in v2:
> * prefer memcpy
> * fix up trailing tabs
>
> arch/x86/kvm/emulate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 7611c034bf95..f9c0359f3fdd 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -900,7 +900,7 @@ static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt,
> if (rc != X86EMUL_CONTINUE) \
> goto done; \
> ctxt->_eip += sizeof(_type); \
> - _x = *(_type __aligned(1) *) ctxt->fetch.ptr; \
> + memcpy(&_x, ctxt->fetch.ptr, sizeof(_type)); \
> ctxt->fetch.ptr += sizeof(_type); \
> _x; \
> })
>
Fixed up the tab and pushed, thanks.
Paolo
Powered by blists - more mailing lists