From: Juergen Gross Subject: [PATCH 3/5] xen: use masking operation instead of test_bit for VGCF bits Date: Fri, 2 Oct 2015 06:40:28 +0200 Message-ID: <1443760830-29095-4-git-send-email-jgross@suse.com> References: <1443760830-29095-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1443760830-29095-1-git-send-email-jgross@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: keir@xen.org, jbeulich@suse.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, george.dunlap@eu.citrix.com, xen-devel@lists.xen.org Cc: Juergen Gross List-Id: xen-devel@lists.xenproject.org Use a bit mask for testing of a set bit instead of test_bit in case no atomic operation is needed, as this will lead to smaller and more effective code. Signed-off-by: Juergen Gross --- xen/arch/x86/domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index dc3bb08..4e96f6c 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1352,7 +1352,7 @@ static void load_segments(struct vcpu *n) domain_crash(n->domain); } - if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) ) + if ( n->arch.vgc_flags & VGCF_failsafe_disables_events ) vcpu_info(n, evtchn_upcall_mask) = 1; regs->entry_vector |= TRAP_syscall; @@ -1394,7 +1394,7 @@ static void load_segments(struct vcpu *n) domain_crash(n->domain); } - if ( test_bit(_VGCF_failsafe_disables_events, &n->arch.vgc_flags) ) + if ( n->arch.vgc_flags & VGCF_failsafe_disables_events ) vcpu_info(n, evtchn_upcall_mask) = 1; regs->entry_vector |= TRAP_syscall; -- 2.1.4