From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: Re: [PATCH v4 05/32] arm64: KVM: Basic ESR_EL2 helpers and vcpu register access Date: Mon, 20 May 2013 16:45:15 +0100 Message-ID: <519A450B.5030309@arm.com> References: <1368540840-26750-1-git-send-email-marc.zyngier@arm.com> <1368540840-26750-6-git-send-email-marc.zyngier@arm.com> <20130520154142.GD3639@MacBook-Pro.local> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Cc: "linux-arm-kernel@lists.infradead.org" , "kvmarm@lists.cs.columbia.edu" , "kvm@vger.kernel.org" , Will Deacon , "pbonzini@redhat.com" , "gleb@redhat.com" , Christopher Covington To: Catalin Marinas Return-path: Received: from service87.mimecast.com ([91.220.42.44]:38042 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756028Ab3ETPpS convert rfc822-to-8bit (ORCPT ); Mon, 20 May 2013 11:45:18 -0400 In-Reply-To: <20130520154142.GD3639@MacBook-Pro.local> Sender: kvm-owner@vger.kernel.org List-ID: On 20/05/13 16:41, Catalin Marinas wrote: > On Tue, May 14, 2013 at 03:13:33PM +0100, Marc Zyngier wrote: >> Implements helpers for dealing with the EL2 syndrome register as >> well as accessing the vcpu registers. >> >> Reviewed-by: Christopher Covington >> Signed-off-by: Marc Zyngier > ... >> +static inline bool kvm_vcpu_dabt_isvalid(const struct kvm_vcpu *vcpu) >> +{ >> + return !!(kvm_vcpu_get_hsr(vcpu) & ESR_EL2_ISV); >> +} > > You kept these '!!' ;). BTW, would the compiler handle the conversion > between the integer and bool here? I like them very much. The compiler handles the conversion perfectly fine, but the '!!' makes the intent explicit, and someone reviewing the code won't be tempted to change the return type to u64 or something similar. > Either way is fine by me: > > Reviewed-by: Catalin Marinas Thanks, M. -- Jazz is not dead. It just smells funny...