Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbdG0PMH (ORCPT ); Thu, 27 Jul 2017 11:12:07 -0400 Received: from mx2.suse.de ([195.135.220.15]:39314 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751491AbdG0PMG (ORCPT ); Thu, 27 Jul 2017 11:12:06 -0400 From: Juergen Gross To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: boris.ostrovsky@oracle.com, Juergen Gross Subject: [PATCH] xen: cleanup xen.h Date: Thu, 27 Jul 2017 17:11:58 +0200 Message-Id: <20170727151158.1739-1-jgross@suse.com> X-Mailer: git-send-email 2.12.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1334 Lines: 47 The macros for testing domain types are more complicated then they need to. Simplify them. Signed-off-by: Juergen Gross --- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/include/xen/xen.h b/include/xen/xen.h index 6e8b7fc79801..28c59ca529d7 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -13,11 +13,16 @@ extern enum xen_domain_type xen_domain_type; #define xen_domain_type XEN_NATIVE #endif +#ifdef CONFIG_XEN_PVH +extern bool xen_pvh; +#else +#define xen_pvh 0 +#endif + #define xen_domain() (xen_domain_type != XEN_NATIVE) -#define xen_pv_domain() (xen_domain() && \ - xen_domain_type == XEN_PV_DOMAIN) -#define xen_hvm_domain() (xen_domain() && \ - xen_domain_type == XEN_HVM_DOMAIN) +#define xen_pv_domain() (xen_domain_type == XEN_PV_DOMAIN) +#define xen_hvm_domain() (xen_domain_type == XEN_HVM_DOMAIN) +#define xen_pvh_domain() (xen_pvh) #ifdef CONFIG_XEN_DOM0 #include @@ -29,11 +34,4 @@ extern enum xen_domain_type xen_domain_type; #define xen_initial_domain() (0) #endif /* CONFIG_XEN_DOM0 */ -#ifdef CONFIG_XEN_PVH -extern bool xen_pvh; -#define xen_pvh_domain() (xen_hvm_domain() && xen_pvh) -#else -#define xen_pvh_domain() (0) -#endif - #endif /* _XEN_XEN_H */ -- 2.12.3