linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen: cleanup xen.h
@ 2017-07-27 15:11 Juergen Gross
  2017-07-27 15:37 ` Boris Ostrovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Gross @ 2017-07-27 15:11 UTC (permalink / raw)
  To: linux-kernel, xen-devel; +Cc: boris.ostrovsky, Juergen Gross

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

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

* Re: [PATCH] xen: cleanup xen.h
  2017-07-27 15:11 [PATCH] xen: cleanup xen.h Juergen Gross
@ 2017-07-27 15:37 ` Boris Ostrovsky
  2017-07-27 15:44   ` Juergen Gross
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Ostrovsky @ 2017-07-27 15:37 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, xen-devel

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

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

* Re: [PATCH] xen: cleanup xen.h
  2017-07-27 15:37 ` Boris Ostrovsky
@ 2017-07-27 15:44   ` Juergen Gross
  2017-08-16 14:56     ` Boris Ostrovsky
  0 siblings, 1 reply; 4+ messages in thread
From: Juergen Gross @ 2017-07-27 15:44 UTC (permalink / raw)
  To: Boris Ostrovsky, linux-kernel, xen-devel

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

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

* Re: [PATCH] xen: cleanup xen.h
  2017-07-27 15:44   ` Juergen Gross
@ 2017-08-16 14:56     ` Boris Ostrovsky
  0 siblings, 0 replies; 4+ messages in thread
From: Boris Ostrovsky @ 2017-08-16 14:56 UTC (permalink / raw)
  To: Juergen Gross, linux-kernel, xen-devel

On 07/27/2017 11:44 AM, Juergen Gross wrote:
> 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.


Applied to for-linus-4.14

-boris

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

end of thread, other threads:[~2017-08-16 14:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 15:11 [PATCH] xen: cleanup xen.h Juergen Gross
2017-07-27 15:37 ` Boris Ostrovsky
2017-07-27 15:44   ` Juergen Gross
2017-08-16 14:56     ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).