xen/arm: vtimer: Switch the read variable in the emulation from int to bool
authorJulien Grall <julien.grall@arm.com>
Wed, 7 Dec 2016 12:33:42 +0000 (12:33 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Wed, 7 Dec 2016 21:44:56 +0000 (13:44 -0800)
The read variable can only take two values: 1 => read, 0 => write. Use
bool instead to make clear the variable can only take 2 values.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/vtimer.c

index f8d32956cc67b224183f9129a88b41a55b1d3c02..3fc97b34511dc99087ffb78655b90b30cba3c5b3 100644 (file)
@@ -164,7 +164,7 @@ int virt_timer_restore(struct vcpu *v)
     return 0;
 }
 
-static bool vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
+static bool vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, bool read)
 {
     struct vcpu *v = current;
 
@@ -193,7 +193,8 @@ static bool vtimer_cntp_ctl(struct cpu_user_regs *regs, uint32_t *r, int read)
     return true;
 }
 
-static bool vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
+static bool vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r,
+                             bool read)
 {
     struct vcpu *v = current;
     s_time_t now;
@@ -221,7 +222,8 @@ static bool vtimer_cntp_tval(struct cpu_user_regs *regs, uint32_t *r, int read)
     return true;
 }
 
-static bool vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r, int read)
+static bool vtimer_cntp_cval(struct cpu_user_regs *regs, uint64_t *r,
+                             bool read)
 {
     struct vcpu *v = current;
 
@@ -320,9 +322,9 @@ static bool vtimer_emulate_cp64(struct cpu_user_regs *regs, union hsr hsr)
 
 #ifdef CONFIG_ARM_64
 typedef bool (*vtimer_sysreg32_fn_t)(struct cpu_user_regs *regs, uint32_t *r,
-                                     int read);
+                                     bool read);
 typedef bool (*vtimer_sysreg64_fn_t)(struct cpu_user_regs *regs, uint64_t *r,
-                                     int read);
+                                     bool read);
 
 static bool vtimer_emulate_sysreg32(struct cpu_user_regs *regs, union hsr hsr,
                                     vtimer_sysreg32_fn_t fn)