Skip to content

Commit fd0cd59

Browse files
ConchuODavpatel
authored andcommitted
riscv: kvm: vcpu_timer: fix unused variable warnings
In two places, csr is set but never used: arch/riscv/kvm/vcpu_timer.c:302:23: warning: variable 'csr' set but not used [-Wunused-but-set-variable] struct kvm_vcpu_csr *csr; ^ arch/riscv/kvm/vcpu_timer.c:327:23: warning: variable 'csr' set but not used [-Wunused-but-set-variable] struct kvm_vcpu_csr *csr; ^ Remove the variable. Fixes: 8f5cb44 ("RISC-V: KVM: Support sstc extension") Reviewed-by: Palmer Dabbelt <[email protected]> Signed-off-by: Conor Dooley <[email protected]> Signed-off-by: Anup Patel <[email protected]>
1 parent 568035b commit fd0cd59

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

arch/riscv/kvm/vcpu_timer.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,13 @@ static void kvm_riscv_vcpu_update_timedelta(struct kvm_vcpu *vcpu)
299299

300300
void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu)
301301
{
302-
struct kvm_vcpu_csr *csr;
303302
struct kvm_vcpu_timer *t = &vcpu->arch.timer;
304303

305304
kvm_riscv_vcpu_update_timedelta(vcpu);
306305

307306
if (!t->sstc_enabled)
308307
return;
309308

310-
csr = &vcpu->arch.guest_csr;
311309
#if defined(CONFIG_32BIT)
312310
csr_write(CSR_VSTIMECMP, (u32)t->next_cycles);
313311
csr_write(CSR_VSTIMECMPH, (u32)(t->next_cycles >> 32));
@@ -324,13 +322,11 @@ void kvm_riscv_vcpu_timer_restore(struct kvm_vcpu *vcpu)
324322

325323
void kvm_riscv_vcpu_timer_save(struct kvm_vcpu *vcpu)
326324
{
327-
struct kvm_vcpu_csr *csr;
328325
struct kvm_vcpu_timer *t = &vcpu->arch.timer;
329326

330327
if (!t->sstc_enabled)
331328
return;
332329

333-
csr = &vcpu->arch.guest_csr;
334330
t = &vcpu->arch.timer;
335331
#if defined(CONFIG_32BIT)
336332
t->next_cycles = csr_read(CSR_VSTIMECMP);

0 commit comments

Comments
 (0)