From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: cleanup: change to use bool return values Date: Mon, 15 Mar 2010 10:29:21 +0200 Message-ID: <4B9DEFE1.9070504@redhat.com> References: <4B9DEE65.6040206@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: sheng@linux.intel.com, kvm@vger.kernel.org To: Gui Jianfeng Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337Ab0COI3b (ORCPT ); Mon, 15 Mar 2010 04:29:31 -0400 In-Reply-To: <4B9DEE65.6040206@cn.fujitsu.com> Sender: kvm-owner@vger.kernel.org List-ID: 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.