public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Gui Jianfeng <guijianfeng@cn.fujitsu.com>
Cc: sheng@linux.intel.com, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: cleanup: change to use bool return values
Date: Mon, 15 Mar 2010 10:29:21 +0200	[thread overview]
Message-ID: <4B9DEFE1.9070504@redhat.com> (raw)
In-Reply-To: <4B9DEE65.6040206@cn.fujitsu.com>

On 03/15/2010 10:23 AM, Gui Jianfeng wrote:
> Make use of bool as return valuses.
>
>
> -static inline int cpu_has_vmx_tpr_shadow(void)
> +static inline bool cpu_has_vmx_tpr_shadow(void)
>   {
> -	return vmcs_config.cpu_based_exec_ctrl&  CPU_BASED_TPR_SHADOW;
> +	return !!(vmcs_config.cpu_based_exec_ctrl&  CPU_BASED_TPR_SHADOW);
>   }
>
>    

Those !! are not required - demotion to bool is defined to convert 
nonzero to true.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  reply	other threads:[~2010-03-15  8:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-15  8:23 [PATCH] KVM: cleanup: change to use bool return values Gui Jianfeng
2010-03-15  8:29 ` Avi Kivity [this message]
2010-03-15  9:29   ` [PATCH] KVM: Cleanup: " Gui Jianfeng
2010-03-17 18:53     ` Marcelo Tosatti

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=4B9DEFE1.9070504@redhat.com \
    --to=avi@redhat.com \
    --cc=guijianfeng@cn.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=sheng@linux.intel.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