xen: cleanup xen.h
authorJuergen Gross <jgross@suse.com>
Thu, 27 Jul 2017 15:11:58 +0000 (17:11 +0200)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Thu, 31 Aug 2017 13:45:55 +0000 (09:45 -0400)
The macros for testing domain types are more complicated then they
need to. Simplify them.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
include/xen/xen.h

index 6e8b7fc798017e4c13188339cf83b1e68fcd16e4..28c59ca529d74e09b4100201633c4e8b830de459 100644 (file)
@@ -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 <xen/interface/xen.h>
@@ -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 */