Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2028782ybv; Fri, 14 Feb 2020 10:06:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwDa5/LQ+psLGszRtIhGR68yQbkZS9JyycaWsio1rX5vS/5DRXMPK6n+Y25QNe3cez5A/GX X-Received: by 2002:aca:dc8b:: with SMTP id t133mr2768415oig.98.1581703572766; Fri, 14 Feb 2020 10:06:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581703572; cv=none; d=google.com; s=arc-20160816; b=GG73B8i5K6v3Fsto2jItXE5T6h+cfWoPlYxKY5EfyaYb1Or+tVlhvj2a58xjjn48SY ycSfoN9R485JEBdlYMl6l2CRonCelk+k5nIuUrlD67A/8UvMK4H6HpCHyBTgVUK/6lEe uAP6IINHMfUTEkAi1wMeML/5OOZ8weig1i/g7q/nA99gHfVX7uAr7wlQ5T5CrSC/fu6g RNDsIl4wzMT3jT0hkqmh2RuQjUxZXFFT0EhacBACuKIQ0zjO4tfiZQEazew8KfsPQmUY 6eMZv4Jpkv5jYDMiIlUFCF0GNy5evnOfyRoslCUgubXwaQipQsuy5a8tdwciOMVKMYwh 5wxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6jSjfGtvFx4do4NAPL9uHx8+n+x5lxROSkL2jkHQC4Y=; b=pXtw+LFc44+tGAXqmEmHiCgxfhB9i0UD+XHpEf4cDC+vWVXTrNq84KV0mdIG3l/whC PCMN/muN+MB8YDzxmEt8lX9yUQF3/HqAHtTv0j+6VkzymuagwHeDWgI0tS7nhLQVKIh4 T2qaVyVOn58cIGS9MK1vNj7PSzFKj/9rvRuHdqZYf0Sz18bO0Gj/V62+0JMYkd8WUinM UF5YYjoyJso6HHOC4TsgwpiuX8UYdcwYgPMJGSYQz5/XOa/wlgEwW02nUYN2XQ4VEdyx 5VgkKFzc7SUO6ztedW93yL2Y1Dx0PZ8WFd34Nr+AubZu6AFxWhD900nRtDgt4YTWDdap Hx+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=ovPYHpFI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si3307313otd.1.2020.02.14.10.06.00; Fri, 14 Feb 2020 10:06:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=ovPYHpFI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388798AbgBNSAu (ORCPT + 99 others); Fri, 14 Feb 2020 13:00:50 -0500 Received: from mail-qt1-f194.google.com ([209.85.160.194]:42339 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387756AbgBNP4V (ORCPT ); Fri, 14 Feb 2020 10:56:21 -0500 Received: by mail-qt1-f194.google.com with SMTP id r5so7242020qtt.9 for ; Fri, 14 Feb 2020 07:56:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=from:to:cc:subject:date:message-id; bh=6jSjfGtvFx4do4NAPL9uHx8+n+x5lxROSkL2jkHQC4Y=; b=ovPYHpFItMqqLAWAG5S/QB+rnCBig0/hdfLXqhp+WoudHfMZv8ItTZEURE/T2JN/fG hHlcOAIA6218GMm8dOC2tX+c6bzmMfE/SCjST9/1qO+PvQogsKtLhwgPlvrdl+4i2OVp BSIo5nZaGtE3HuqY9vBT9rWd+INyAaitqr5Itn9gVkjQ94r/bJ9+I9rGK1cpDJ/0sfq+ IuxNGkagkPX5nxsu0eN3Aoh2LHQaBA1/Ds3xFYqRMQjs5QmLCZd2Om9GbVTvk2ZJrl4U 1nJHOAQz+8VSrN0npIApaha+jOG5/VVTiYLsoZQYOA63vasiwiFWXZieLBmcvPvZThio JyOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6jSjfGtvFx4do4NAPL9uHx8+n+x5lxROSkL2jkHQC4Y=; b=gYo0q7XIM4ml2p8O5eIxg80Pg66Sw3shiZCdjjHd9rrVqvjOAn/moH8OdV5xPKxXIJ phkLgzfyyy6Bg2ECWJO2LaInY1gAebSuLVt9+aUggo24Frk31fW+/PON4EBNlO7OuB9x wvpnQ85SN3/aUneWN80eXncQvfza/iOZyYjH4oO+RfKN5ovw734R27Xjwl7BShLClLie b/gE/iJCopN5w830s9x7u1JYD4/qPsL4THK3KSGdQDNIG7pqG5wdM4pYKYOElWsnEGuD Q51bRxnAHkP3VwDKSwvtzBNwl2gWlDI8WzYYq3OlwmMyK9AGOhTS1huFxJBUI1//tl5j Vi4A== X-Gm-Message-State: APjAAAWKmOwi7zG+axHJZZTwkx1p2nHvn845s5QErYLWZpXW7LlKwp0m JA4jBDEi614FihADrTwdQjrY0A== X-Received: by 2002:ac8:33f8:: with SMTP id d53mr3067141qtb.86.1581695780463; Fri, 14 Feb 2020 07:56:20 -0800 (PST) Received: from qcai.nay.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id w9sm3449497qka.71.2020.02.14.07.56.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Feb 2020 07:56:20 -0800 (PST) From: Qian Cai To: pbonzini@redhat.com Cc: sean.j.christopherson@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, joro@8bytes.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [PATCH] kvm/emulate: fix a -Werror=cast-function-type Date: Fri, 14 Feb 2020 10:56:08 -0500 Message-Id: <1581695768-6123-1-git-send-email-cai@lca.pw> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org arch/x86/kvm/emulate.c: In function 'x86_emulate_insn': arch/x86/kvm/emulate.c:5686:22: error: cast between incompatible function types from 'int (*)(struct x86_emulate_ctxt *)' to 'void (*)(struct fastop *)' [-Werror=cast-function-type] rc = fastop(ctxt, (fastop_t)ctxt->execute); Fixes: 3009afc6e39e ("KVM: x86: Use a typedef for fastop functions") Signed-off-by: Qian Cai --- arch/x86/kvm/emulate.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index ddbc61984227..17ae820cf59d 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -5682,10 +5682,12 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt) ctxt->eflags &= ~X86_EFLAGS_RF; if (ctxt->execute) { - if (ctxt->d & Fastop) - rc = fastop(ctxt, (fastop_t)ctxt->execute); - else + if (ctxt->d & Fastop) { + fastop_t fop = (void *)ctxt->execute; + rc = fastop(ctxt, fop); + } else { rc = ctxt->execute(ctxt); + } if (rc != X86EMUL_CONTINUE) goto done; goto writeback; -- 1.8.3.1