linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Qian Cai <cai@lca.pw>, Jim Mattson <jmattson@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Joerg Roedel <joro@8bytes.org>, kvm list <kvm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kvm/emulate: fix a -Werror=cast-function-type
Date: Fri, 14 Feb 2020 11:54:55 -0800	[thread overview]
Message-ID: <20200214195454.GG20690@linux.intel.com> (raw)
In-Reply-To: <28680b99-d043-ee02-dab3-b5ce8c2e625b@redhat.com>

On Fri, Feb 14, 2020 at 08:33:50PM +0100, Paolo Bonzini wrote:
> On 14/02/20 20:14, Qian Cai wrote:
> >> It seems misguided to define a local variable just to get an implicit
> >> cast from (void *) to (fastop_t). Sean's first suggestion gives you
> >> the same implicit cast without the local variable. The second
> >> suggestion makes both casts explicit.
> > 
> > OK, I'll do a v2 using the first suggestion which looks simpler once it passed
> > compilations.
> > 
> 
> Another interesting possibility is to use an unnamed union of a
> (*execute) function pointer and a (*fastop) function pointer.

I considered that when introducing fastop_t.  I don't remember why I
didn't go that route.  It's entirely possible I completely forgot that
anonymous unions are allowed and thought it would mean changing a bunch
of use sites.

  reply	other threads:[~2020-02-14 19:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 15:56 [PATCH] kvm/emulate: fix a -Werror=cast-function-type Qian Cai
2020-02-14 16:59 ` Sean Christopherson
2020-02-14 17:08   ` Qian Cai
2020-02-14 17:40     ` Jim Mattson
2020-02-14 19:14       ` Qian Cai
2020-02-14 19:33         ` Paolo Bonzini
2020-02-14 19:54           ` Sean Christopherson [this message]
2020-02-17 14:47           ` Qian Cai
2020-02-17 16:32             ` Paolo Bonzini

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=20200214195454.GG20690@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=cai@lca.pw \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /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).