xen: change the type of xen_vcpu_id to uint32_t
Subsystems (5)
PATCH v2 1/1 xen: change the type of xen_vcpu_id to uint32_t
We pass xen_vcpu_id mapping information to hypercalls which require uint32_t type so it would be cleaner to have it as uint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway.
---
Changes since v2:
- Change the return value type of xen_vcpu_nr to uint32_t [David Vrabel]
--- arch/arm/xen/enlighten.c | 2 +- arch/x86/xen/enlighten.c | 2 +- include/xen/xen-ops.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/xen/enlighten.c +1 -1
@@ -47,7 +47,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);static struct vcpu_info __percpu *xen_vcpu_info;/* Linux <-> Xen vCPU id mapping */ -DEFINE_PER_CPU (int, xen_vcpu_id) =-1 ; +DEFINE_PER_CPU (uint32_t, xen_vcpu_id);EXPORT_PER_CPU_SYMBOL (xen_vcpu_id);/* These are unused until we support booting "pre-ballooned" */
arch/x86/xen/enlighten.c +1 -1
@@ -120,7 +120,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);/* Linux <-> Xen vCPU id mapping */ -DEFINE_PER_CPU (int, xen_vcpu_id) =-1 ; +DEFINE_PER_CPU (uint32_t, xen_vcpu_id);EXPORT_PER_CPU_SYMBOL (xen_vcpu_id);enum xen_domain_type xen_domain_type =XEN_NATIVE ;
include/xen/xen-ops.h +2 -2
@@ -9,8 +9,8 @@ DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); -DECLARE_PER_CPU (int, xen_vcpu_id); -static inline int xen_vcpu_nr (int cpu) +DECLARE_PER_CPU (uint32_t, xen_vcpu_id); +static inline uint32_t xen_vcpu_nr (int cpu) {return per_cpu (xen_vcpu_id, cpu); }
Signature · 1 line
2.7.4
Quoted 6 lines · Vitaly Kuznetsov
We pass
xen_vcpu_idmapping information to hypercalls which requireuint32_ttype so it would be cleaner to have it asuint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway.Signed-off-by Vitaly Kuznetsov <[email protected]>
It would probably be better to keep the initializer and add an assert to xen_vcpu_nr. But I don't want to be too picky, so:
Quoted 52 lines
Changes since v2:
- Change the return value type ofxen_vcpu_nrtouint32_t[David Vrabel]--- arch/arm/xen/enlighten.c | 2 +- arch/x86/xen/enlighten.c | 2 +- include/xen/xen-ops.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)arch/arm/xen/enlighten.c +1
-1@@ -47,7 +47,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);static struct vcpu_info __percpu *xen_vcpu_info;/* Linux <-> Xen vCPU id mapping */ -DEFINE_PER_CPU (int, xen_vcpu_id) =-1 ; +DEFINE_PER_CPU (uint32_t, xen_vcpu_id);EXPORT_PER_CPU_SYMBOL (xen_vcpu_id);/* These are unused until we support booting "pre-ballooned" */ arch/x86/xen/enlighten.c +1
-1@@ -120,7 +120,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);/* Linux <-> Xen vCPU id mapping */ -DEFINE_PER_CPU (int, xen_vcpu_id) =-1 ; +DEFINE_PER_CPU (uint32_t, xen_vcpu_id);EXPORT_PER_CPU_SYMBOL (xen_vcpu_id);enum xen_domain_type xen_domain_type =XEN_NATIVE ;include/xen/xen-ops.h +2
-2@@ -9,8 +9,8 @@ DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); -DECLARE_PER_CPU (int, xen_vcpu_id); -static inline int xen_vcpu_nr (int cpu) +DECLARE_PER_CPU (uint32_t, xen_vcpu_id); +static inline uint32_t xen_vcpu_nr (int cpu) {return per_cpu (xen_vcpu_id, cpu); }Signature · 1 line
2.7.4
Quoted 6 lines · Vitaly Kuznetsov
We pass
xen_vcpu_idmapping information to hypercalls which requireuint32_ttype so it would be cleaner to have it asuint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway.Signed-off-by Vitaly Kuznetsov <[email protected]>
It would probably be better to keep the initializer and add an assert to xen_vcpu_nr. But I don't want to be too picky, so:
Quoted 52 lines
Changes since v2:
- Change the return value type ofxen_vcpu_nrtouint32_t[David Vrabel]--- arch/arm/xen/enlighten.c | 2 +- arch/x86/xen/enlighten.c | 2 +- include/xen/xen-ops.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)arch/arm/xen/enlighten.c +1
-1@@ -47,7 +47,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu);static struct vcpu_info __percpu *xen_vcpu_info;/* Linux <-> Xen vCPU id mapping */ -DEFINE_PER_CPU (int, xen_vcpu_id) =-1 ; +DEFINE_PER_CPU (uint32_t, xen_vcpu_id);EXPORT_PER_CPU_SYMBOL (xen_vcpu_id);/* These are unused until we support booting "pre-ballooned" */ arch/x86/xen/enlighten.c +1
-1@@ -120,7 +120,7 @@ DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); DEFINE_PER_CPU(struct vcpu_info, xen_vcpu_info);/* Linux <-> Xen vCPU id mapping */ -DEFINE_PER_CPU (int, xen_vcpu_id) =-1 ; +DEFINE_PER_CPU (uint32_t, xen_vcpu_id);EXPORT_PER_CPU_SYMBOL (xen_vcpu_id);enum xen_domain_type xen_domain_type =XEN_NATIVE ;include/xen/xen-ops.h +2
-2@@ -9,8 +9,8 @@ DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); -DECLARE_PER_CPU (int, xen_vcpu_id); -static inline int xen_vcpu_nr (int cpu) +DECLARE_PER_CPU (uint32_t, xen_vcpu_id); +static inline uint32_t xen_vcpu_nr (int cpu) {return per_cpu (xen_vcpu_id, cpu); }Signature · 1 line
2.7.4
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 6 lines · Vitaly Kuznetsov
We pass
xen_vcpu_idmapping information to hypercalls which requireuint32_ttype so it would be cleaner to have it asuint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway.Signed-off-by Vitaly Kuznetsov <[email protected]>
Thanks,
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
David Vrabel
AppliedQuoted 4 lines · Vitaly Kuznetsov
We pass
xen_vcpu_idmapping information to hypercalls which requireuint32_ttype so it would be cleaner to have it asuint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway.
Applied to for-linus-4.8b, thanks.
David
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
David Vrabel
AppliedQuoted 4 lines · Vitaly Kuznetsov
We pass
xen_vcpu_idmapping information to hypercalls which requireuint32_ttype so it would be cleaner to have it asuint32_t. The initializer to -1 can be dropped as we always do the mapping before using it and we never check the 'not set' value anyway.
Applied to for-linus-4.8b, thanks.
David