From 0932210ac0956fe0ce6f23cf73f56d7c2f9bc5df Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Wed, 27 Jun 2018 13:26:36 +0100 Subject: [PATCH] x86: Address "Bitwise-and with zero CONSTANT_EXPRESSION_RESULT" Coverity issues Coverity complains at code which which performs a bitwise and with a constant that happens to be zero. Rearrange the C to test the constant first and short circuit the bitwise and. No functional change. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- xen/arch/x86/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 4629bcaa47..a1a1f5f3c3 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1225,7 +1225,7 @@ void put_page_from_l1e(l1_pgentry_t l1e, struct domain *l1e_owner) * (Note that the undestroyable active grants are not a security hole in * Xen. All active grants can safely be cleaned up when the domain dies.) */ - if ( (l1e_get_flags(l1e) & _PAGE_GNTTAB) && + if ( _PAGE_GNTTAB && (l1e_get_flags(l1e) & _PAGE_GNTTAB) && !l1e_owner->is_shutting_down && !l1e_owner->is_dying ) { gdprintk(XENLOG_WARNING, -- 2.30.2