xen/arm: vtimer: fix return value to void for virt_timer_[save|restore]
PATCH 1/1 xen/arm: vtimer: fix return value to void for virt_timer_[save|restore]
The original type is int and not used at all so fix to void.
--- xen/arch/arm/vtimer.c | 6 ++---- xen/include/asm-arm/vtimer.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-)
xen/arch/arm/vtimer.c +2 -4
@@ -136,7 +136,7 @@ void vcpu_timer_destroy(struct vcpu *v)kill_timer (&v->arch.phys_timer.timer); } -int virt_timer_save (struct vcpu *v) +void virt_timer_save (struct vcpu *v) {ASSERT (!is_idle_vcpu (v));
@@ -149,10 +149,9 @@ int virt_timer_save(struct vcpu *v)set_timer (&v->arch.virt_timer.timer,ticks_to_ns (v->arch.virt_timer.cval + v->domain->arch.virt_timer_base.offset - boot_count)); } -return 0 ; } -int virt_timer_restore (struct vcpu *v) +void virt_timer_restore (struct vcpu *v) {ASSERT (!is_idle_vcpu (v));
@@ -163,7 +162,6 @@ int virt_timer_restore(struct vcpu *v)WRITE_SYSREG64 (v->domain->arch.virt_timer_base.offset,CNTVOFF_EL2 );WRITE_SYSREG64 (v->arch.virt_timer.cval,CNTV_CVAL_EL0 );WRITE_SYSREG32 (v->arch.virt_timer.ctl,CNTV_CTL_EL0 ); -return 0 ; }static bool vtimer_cntp_ctl (struct cpu_user_regs *regs,uint32_t *r,bool read)
xen/include/asm-arm/vtimer.h +2 -2
@@ -24,8 +24,8 @@ extern int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config);extern int vcpu_vtimer_init (struct vcpu *v);extern bool vtimer_emulate (struct cpu_user_regs *regs,union hsr hsr); -extern int virt_timer_save (struct vcpu *v); -extern int virt_timer_restore (struct vcpu *v); +extern void virt_timer_save (struct vcpu *v); +extern void virt_timer_restore (struct vcpu *v);extern void vcpu_timer_destroy (struct vcpu *v);void vtimer_update_irqs (struct vcpu *v);
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
NIT: I would use "change" instead of "fix". I feel "fix" is more when there are an actual bug.
Quoted 1 line · Baodong Chen
The original type is int and not used at all so fix to void.
The commit message is a bit unclear, you mention the type whereas the key point is none of the callers are using the return value. So how about:
"virt_timer_{save, return} always return 0 and none of the caller actually check it. So change the return type to void."
If you are happy with it, I can make the modifications them on commit.
Cheers,
Quoted 56 lines
Signed-off-by Baodong Chen <[email protected]>--- xen/arch/arm/vtimer.c | 6 ++---- xen/include/asm-arm/vtimer.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-)xen/arch/arm/vtimer.c +2
-4@@ -136,7 +136,7 @@ void vcpu_timer_destroy(struct vcpu *v)kill_timer (&v->arch.phys_timer.timer); } -int virt_timer_save (struct vcpu *v) +void virt_timer_save (struct vcpu *v) {ASSERT (!is_idle_vcpu (v));@@ -149,10 +149,9 @@ int virt_timer_save(struct vcpu *v)set_timer (&v->arch.virt_timer.timer,ticks_to_ns (v->arch.virt_timer.cval + v->domain->arch.virt_timer_base.offset - boot_count)); } -return 0 ; } -int virt_timer_restore (struct vcpu *v) +void virt_timer_restore (struct vcpu *v) {ASSERT (!is_idle_vcpu (v));@@ -163,7 +162,6 @@ int virt_timer_restore(struct vcpu *v)WRITE_SYSREG64 (v->domain->arch.virt_timer_base.offset,CNTVOFF_EL2 );WRITE_SYSREG64 (v->arch.virt_timer.cval,CNTV_CVAL_EL0 );WRITE_SYSREG32 (v->arch.virt_timer.ctl,CNTV_CTL_EL0 ); -return 0 ; }static bool vtimer_cntp_ctl (struct cpu_user_regs *regs,uint32_t *r,bool read)xen/include/asm-arm/vtimer.h +2
-2@@ -24,8 +24,8 @@ extern int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config);extern int vcpu_vtimer_init (struct vcpu *v);extern bool vtimer_emulate (struct cpu_user_regs *regs,union hsr hsr); -extern int virt_timer_save (struct vcpu *v); -extern int virt_timer_restore (struct vcpu *v); +extern void virt_timer_save (struct vcpu *v); +extern void virt_timer_restore (struct vcpu *v);extern void vcpu_timer_destroy (struct vcpu *v);void vtimer_update_irqs (struct vcpu *v);
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 3 lines · Julien Grall
Hi,
NIT: I would use "change" instead of "fix". I feel "fix" is more when there are an actual bug.
Sound good to me.
Quoted 9 lines · Baodong Chen
Quoted 1 line
The original type is int and not used at all so fix to void.
The commit message is a bit unclear, you mention the type whereas the key point is none of the callers are using the return value. So how about:
"virt_timer_{save, return} always return 0 and none of the caller actually check it. So change the return type to void."
If you are happy with it, I can make the modifications them on commit.
happy with it, please.
Quoted 45 lines
Cheers,
Quoted 42 lines
Signed-off-by Baodong Chen <[email protected]>---
xen/arch/arm/vtimer.c | 6 ++----
xen/include/asm-arm/vtimer.h| 4 ++--2 files changed, 4 insertions(+), 6 deletions(-)xen/arch/arm/vtimer.c +1
-0@@ -136,7 +136,7 @@ void vcpu_timer_destroy(struct vcpu *v) kill_timer(&v->arch.phys_timer.timer); } -int virt_timer_save(struct vcpu *v) +void virt_timer_save(struct vcpu *v) { ASSERT(!is_idle_vcpu(v)); @@ -149,10 +149,9 @@ int virt_timer_save(struct vcpu *v)set_timer(&v->arch.virt_timer.timer,
ticks_to_ns(v->arch.virt_timer.cval + v->domain->arch.virt_timer_base.offset - boot_count)); }
- return 0;
}
-intvirt_timer_restore(struct vcpu *v)
+voidvirt_timer_restore(struct vcpu *v)
{
ASSERT(!is_idle_vcpu(v));
@@ -163,7 +162,6 @@ intvirt_timer_restore(struct vcpu *v)WRITE_SYSREG64(v->domain->arch.virt_timer_base.offset, CNTVOFF_EL2);WRITE_SYSREG64(v->arch.virt_timer.cval, CNTV_CVAL_EL0);WRITE_SYSREG32(v->arch.virt_timer.ctl, CNTV_CTL_EL0);
- return 0;
}
static boolvtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, bool read)xen/include/asm-arm/vtimer.h +0
-0@@ -24,8 +24,8 @@ extern int domain_vtimer_init(struct domain *d, struct xen_arch_domainconfig *config); extern int vcpu_vtimer_init(struct vcpu *v);
Quoted 9 lines
xen/include/asm-arm/vtimer.h extern int domain_vtimer_init(struct domain *d, · line 31
Quoted 8 lines
xen/include/asm-arm/vtimer.h +2
-2extern bool vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr); -extern int virt_timer_save (struct vcpu *v); -extern int virt_timer_restore (struct vcpu *v); +extern void virt_timer_save (struct vcpu *v); +extern void virt_timer_restore (struct vcpu *v); extern void vcpu_timer_destroy(struct vcpu *v); void vtimer_update_irqs(struct vcpu *v);
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 8 lines · chenbaodong
Quoted 3 lines · Julien Grall
Hi,
NIT: I would use "change" instead of "fix". I feel "fix" is more when there are an actual bug.
Sound good to me.
Quoted 2 lines · Baodong Chen
Quoted 8 lines
Quoted 7 lines
Quoted 1 line
The original type is int and not used at all so fix to void.
The commit message is a bit unclear, you mention the type whereas the key point is none of the callers are using the return value. So how about:
"virt_timer_{save, return} always return 0 and none of the caller actually check it. So change the return type to void."
If you are happy with it, I can make the modifications them on commit.
happy with it, please.
Committed, thank you!
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel