Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1698097 > unrolled thread

[PATCH] xen: cleanup xen.h

Started byJuergen Gross <jgross@suse.com>
First post2017-07-27 17:20 +0200
Last post2017-07-27 17:50 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] xen: cleanup xen.h Juergen Gross <jgross@suse.com> - 2017-07-27 17:20 +0200
    Re: [PATCH] xen: cleanup xen.h Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-07-27 17:40 +0200
      Re: [PATCH] xen: cleanup xen.h Juergen Gross <jgross@suse.com> - 2017-07-27 17:50 +0200

#1698097 — [PATCH] xen: cleanup xen.h

FromJuergen Gross <jgross@suse.com>
Date2017-07-27 17:20 +0200
Subject[PATCH] xen: cleanup xen.h
Message-ID<u7SJZ-7Iw-47@gated-at.bofh.it>
The macros for testing domain types are more complicated then they
need to. Simplify them.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 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 <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 */
-- 
2.12.3

[toc] | [next] | [standalone]


#1698106

FromBoris Ostrovsky <boris.ostrovsky@oracle.com>
Date2017-07-27 17:40 +0200
Message-ID<u7T3j-7P8-3@gated-at.bofh.it>
In reply to#1698097
On 07/27/2017 11:11 AM, Juergen Gross wrote:
> The macros for testing domain types are more complicated then they
> need to. Simplify them.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  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)

Stray tab.

> +#define xen_hvm_domain()	(xen_domain_type == XEN_HVM_DOMAIN)
> +#define xen_pvh_domain()	(xen_pvh)

Not sure we need parentheses here.

Either way


Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>


>  
>  #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 */

[toc] | [prev] | [next] | [standalone]


#1698118

FromJuergen Gross <jgross@suse.com>
Date2017-07-27 17:50 +0200
Message-ID<u7Td0-7SK-27@gated-at.bofh.it>
In reply to#1698106
On 27/07/17 17:37, Boris Ostrovsky wrote:
> On 07/27/2017 11:11 AM, Juergen Gross wrote:
>> The macros for testing domain types are more complicated then they
>> need to. Simplify them.
>>
>> Signed-off-by: Juergen Gross <jgross@suse.com>
>> ---
>>  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)
> 
> Stray tab.

No. This is just due to the '+' of the patch.


Juergen

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web