public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: cleanup for xen_pv_domain()/xen_hvm_domain()
@ 2009-11-30  6:17 Xiao Guangrong
  2009-11-30 19:07 ` Jeremy Fitzhardinge
  0 siblings, 1 reply; 2+ messages in thread
From: Xiao Guangrong @ 2009-11-30  6:17 UTC (permalink / raw)
  To: Ingo Molnar, Jeremy Fitzhardinge; +Cc: xen-devel@lists.xensource.com, LKML

Remove unnecessary judgment in xen_pv_domain() and xen_hvm_domain()

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
 arch/x86/include/asm/xen/hypervisor.h |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h
index d5b7e90..f94bd0a 100644
--- a/arch/x86/include/asm/xen/hypervisor.h
+++ b/arch/x86/include/asm/xen/hypervisor.h
@@ -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>
-- 
1.6.1.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xen: cleanup for xen_pv_domain()/xen_hvm_domain()
  2009-11-30  6:17 [PATCH] xen: cleanup for xen_pv_domain()/xen_hvm_domain() Xiao Guangrong
@ 2009-11-30 19:07 ` Jeremy Fitzhardinge
  0 siblings, 0 replies; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2009-11-30 19:07 UTC (permalink / raw)
  To: Xiao Guangrong; +Cc: Ingo Molnar, xen-devel@lists.xensource.com, LKML

On 11/29/09 22:17, Xiao Guangrong wrote:
> 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

> Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
> ---
>  arch/x86/include/asm/xen/hypervisor.h |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h
> index d5b7e90..f94bd0a 100644
> --- a/arch/x86/include/asm/xen/hypervisor.h
> +++ b/arch/x86/include/asm/xen/hypervisor.h
> @@ -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>
>   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-30 19:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30  6:17 [PATCH] xen: cleanup for xen_pv_domain()/xen_hvm_domain() Xiao Guangrong
2009-11-30 19:07 ` Jeremy Fitzhardinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox