Skip to contentSkip to conversation

xen: cleanup for xen_pv_domain()/xen_hvm_domain()

PATCH In review Xiao Guangrong 2 participants 2 messages Nov 30, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: cleanup for xen_pv_domain()/xen_hvm_domain()

Remove unnecessary judgment in xen_pv_domain() and xen_hvm_domain()

---
 arch/x86/include/asm/xen/hypervisor.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
arch/x86/include/asm/xen/hypervisor.h +2 -4
index d5b7e90..f94bd0a 100644
@@ -50,10 +50,8 @@ extern enum xen_domain_type xen_domain_type;
 #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)
 
 #ifdef CONFIG_XEN_DOM0
 #include <xen/interface/xen.h>
Signature · 1 line
1.6.1.2
#1 lore raw
Quoted 2 lines · Xiao Guangrong

Remove unnecessary judgment in xen_pv_domain() and xen_hvm_domain()

I'd prefer not to change it. These changes make no difference to the generated code, and I see a small semantic difference between "is this a Xen domain?" and "what kind of Xen domain is it?", as the latter on really makes sense if it is in fact a Xen domain; the fact that xen_domain() is also implemented in terms of xen_domain_type is just a detail.

J

Quoted 23 lines
---
 arch/x86/include/asm/xen/hypervisor.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
arch/x86/include/asm/xen/hypervisor.h +2 -4
index d5b7e90..f94bd0a 100644
@@ -50,10 +50,8 @@ extern enum xen_domain_type xen_domain_type;
 #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)
 
 #ifdef CONFIG_XEN_DOM0
 #include <xen/interface/xen.h>