All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tiejun Chen <tiejun.chen@intel.com>
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	[thread overview]
Message-ID: <1414737940-4106-1-git-send-email-tiejun.chen@intel.com> (raw)

Return value should be as bool type as this function declaration,
static inline bool vmcs12_read_any().

Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
---
 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. */
 	}
 }
 
-- 
1.9.1


             reply	other threads:[~2014-10-31  6:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31  6:45 Tiejun Chen [this message]
2014-11-04 17:34 ` [PATCH] kvm: x86: vmx: return 'bool' type from vmcs12_read_any() Paolo Bonzini
2014-11-05  1:52   ` Chen, Tiejun

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=1414737940-4106-1-git-send-email-tiejun.chen@intel.com \
    --to=tiejun.chen@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.