linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Matthias Kaehlcke <mka@chromium.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Guenter Roeck <groeck@chromium.org>
Subject: Re: [PATCH] KVM: x86: Make enum conversion explicit in kvm_pdptr_read()
Date: Wed, 7 Mar 2018 19:23:28 +0100	[thread overview]
Message-ID: <20180307182328.GG12290@flask> (raw)
In-Reply-To: <20180226224224.244247-1-mka@chromium.org>

2018-02-26 14:42-0800, Matthias Kaehlcke:
> The type 'enum kvm_reg_ex' is an extension of 'enum kvm_reg', however
> the extension is only semantical and the compiler doesn't know about the
> relationship between the two types. In kvm_pdptr_read() a value of the
> extended type is passed to kvm_x86_ops->cache_reg(), which expects a
> value of the base type. Clang raises the following warning about the
> type mismatch:

Yeah, expressing this in C type system seems impossible.

> arch/x86/kvm/kvm_cache_regs.h:44:32: warning: implicit conversion from
>   enumeration type 'enum kvm_reg_ex' to different enumeration type
>   'enum kvm_reg' [-Wenum-conversion]
>     kvm_x86_ops->cache_reg(vcpu, VCPU_EXREG_PDPTR);
> 
> Cast VCPU_EXREG_PDPTR to 'enum kvm_reg' to make the compiler happy.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> ---

Applied, thanks.

      parent reply	other threads:[~2018-03-07 18:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 22:42 [PATCH] KVM: x86: Make enum conversion explicit in kvm_pdptr_read() Matthias Kaehlcke
2018-02-26 22:46 ` Guenter Roeck
2018-03-07 18:23 ` Radim Krčmář [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180307182328.GG12290@flask \
    --to=rkrcmar@redhat.com \
    --cc=groeck@chromium.org \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mka@chromium.org \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).