xen: cleanup xen.h
Juergen Gross
maintainerPATCH 1/1 xen: cleanup xen.h
The macros for testing domain types are more complicated then they need to. Simplify them.
--- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
include/xen/xen.h +9 -11
@@ -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 */
Signature · 1 line
2.12.3
Quoted 18 lines · Juergen Gross
The macros for testing domain types are more complicated then they need to. Simplify them.
Signed-off-by Juergen Gross <[email protected]>--- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)include/xen/xen.h +2
-0@@ -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;
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 23
Quoted 10 lines
include/xen/xen.h +5
-4+#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.
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 25
Quoted 2 lines
include/xen/xen.h +2
-0+#define xen_hvm_domain () (xen_domain_type == XEN_HVM_DOMAIN) +#define xen_pvh_domain () (xen_pvh)
Not sure we need parentheses here.
Either way
Quoted 5 lines
include/xen/xen.h +0
-0#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)
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 37
Quoted 10 lines
include/xen/xen.h +0
-7#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 */
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 18 lines · Juergen Gross
The macros for testing domain types are more complicated then they need to. Simplify them.
Signed-off-by Juergen Gross <[email protected]>--- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)include/xen/xen.h +2
-0@@ -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;
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 23
Quoted 10 lines
include/xen/xen.h +5
-4+#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.
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 25
Quoted 2 lines
include/xen/xen.h +2
-0+#define xen_hvm_domain () (xen_domain_type == XEN_HVM_DOMAIN) +#define xen_pvh_domain () (xen_pvh)
Not sure we need parentheses here.
Either way
Quoted 15 lines
include/xen/xen.h +0
-7#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 */
Juergen Gross
maintainerQuoted 17 lines · Boris Ostrovsky
Quoted 16 lines · Juergen Gross
The macros for testing domain types are more complicated then they need to. Simplify them.
Signed-off-by Juergen Gross <[email protected]>--- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)include/xen/xen.h +0
-0@@ -13,11 +13,16 @@ extern enum xen_domain_type xen_domain_type;#define xen_domain_type XEN_NATIVE#endif
Quoted 14 lines
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 23
Quoted 12 lines
include/xen/xen.h +7
-4+#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
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 17 lines · Boris Ostrovsky
Quoted 16 lines · Juergen Gross
The macros for testing domain types are more complicated then they need to. Simplify them.
Signed-off-by Juergen Gross <[email protected]>--- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)include/xen/xen.h +0
-0@@ -13,11 +13,16 @@ extern enum xen_domain_type xen_domain_type;#define xen_domain_type XEN_NATIVE#endif
Quoted 14 lines
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 23
Quoted 12 lines
include/xen/xen.h +7
-4+#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
Boris Ostrovsky
AppliedQuoted 31 lines · Juergen Gross
Quoted 17 lines · Boris Ostrovsky
Quoted 16 lines · Juergen Gross
The macros for testing domain types are more complicated then they need to. Simplify them.
Signed-off-by Juergen Gross <[email protected]>--- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)include/xen/xen.h +0
-0@@ -13,11 +13,16 @@ extern enum xen_domain_type xen_domain_type;#define xen_domain_type XEN_NATIVE#endif Quoted 13 lines
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 23
Quoted 12 lines
include/xen/xen.h +7
-4+#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.
Quoted 1 line
No. This is just due to the '+' of the patch.
Applied to for-linus-4.14
-boris
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Boris Ostrovsky
AppliedQuoted 31 lines · Juergen Gross
Quoted 17 lines · Boris Ostrovsky
Quoted 16 lines · Juergen Gross
The macros for testing domain types are more complicated then they need to. Simplify them.
Signed-off-by Juergen Gross <[email protected]>--- include/xen/xen.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)include/xen/xen.h +0
-0@@ -13,11 +13,16 @@ extern enum xen_domain_type xen_domain_type;#define xen_domain_type XEN_NATIVE#endif Quoted 13 lines
include/xen/xen.h extern enum xen_domain_type xen_domain_type; · line 23
Quoted 12 lines
include/xen/xen.h +7
-4+#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.
Quoted 1 line
No. This is just due to the '+' of the patch.
Applied to for-linus-4.14
-boris