From patchwork Fri Oct 31 06:45:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 5202571 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 760979F318 for ; Fri, 31 Oct 2014 06:50:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC1D420123 for ; Fri, 31 Oct 2014 06:50:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A6F8D20122 for ; Fri, 31 Oct 2014 06:50:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761147AbaJaGum (ORCPT ); Fri, 31 Oct 2014 02:50:42 -0400 Received: from mga11.intel.com ([192.55.52.93]:25586 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761143AbaJaGum (ORCPT ); Fri, 31 Oct 2014 02:50:42 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 30 Oct 2014 23:50:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,293,1413270000"; d="scan'208";a="614571958" Received: from tchen0-linux.bj.intel.com ([10.238.154.158]) by fmsmga001.fm.intel.com with ESMTP; 30 Oct 2014 23:50:40 -0700 From: Tiejun Chen To: pbonzini@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] kvm: x86: vmx: return 'bool' type from vmcs12_read_any() Date: Fri, 31 Oct 2014 14:45:40 +0800 Message-Id: <1414737940-4106-1-git-send-email-tiejun.chen@intel.com> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Return value should be as bool type as this function declaration, static inline bool vmcs12_read_any(). Signed-off-by: Tiejun Chen --- arch/x86/kvm/vmx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9fa1f46..9d44d6e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6499,25 +6499,25 @@ static inline bool vmcs12_read_any(struct kvm_vcpu *vcpu, char *p; if (offset < 0) - return 0; + return false; p = ((char *)(get_vmcs12(vcpu))) + offset; switch (vmcs_field_type(field)) { case VMCS_FIELD_TYPE_NATURAL_WIDTH: *ret = *((natural_width *)p); - return 1; + return true; case VMCS_FIELD_TYPE_U16: *ret = *((u16 *)p); - return 1; + return true; case VMCS_FIELD_TYPE_U32: *ret = *((u32 *)p); - return 1; + return true; case VMCS_FIELD_TYPE_U64: *ret = *((u64 *)p); - return 1; + return true; default: - return 0; /* can never happen. */ + return false; /* can never happen. */ } }