[PATCH v5 07/13] LoongArch: KVM: Remove some unnecessary local variables
From: Bibo Mao
Date: Mon Jun 30 2025 - 23:10:37 EST
Local variable coreisr and old_coreisr is replaced with data and
old_data, and the latter is widely used in other sentences.
Signed-off-by: Bibo Mao <maobibo@xxxxxxxxxxx>
---
arch/loongarch/kvm/intc/eiointc.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/loongarch/kvm/intc/eiointc.c b/arch/loongarch/kvm/intc/eiointc.c
index b49611c00b0e..31f2c7476d6f 100644
--- a/arch/loongarch/kvm/intc/eiointc.c
+++ b/arch/loongarch/kvm/intc/eiointc.c
@@ -474,7 +474,6 @@ static int loongarch_eiointc_writeq(struct kvm_vcpu *vcpu,
int i, index, irq, bits, ret = 0;
u8 cpu;
u64 data, old_data;
- u64 coreisr, old_coreisr;
gpa_t offset;
data = *(u64 *)val;
@@ -525,17 +524,16 @@ static int loongarch_eiointc_writeq(struct kvm_vcpu *vcpu,
index = (offset - EIOINTC_COREISR_START) >> 3;
/* use attrs to get current cpu index */
cpu = vcpu->vcpu_id;
- coreisr = data;
- old_coreisr = s->coreisr.reg_u64[cpu][index];
+ old_data = s->coreisr.reg_u64[cpu][index];
/* write 1 to clear interrupt */
- s->coreisr.reg_u64[cpu][index] = old_coreisr & ~coreisr;
- coreisr &= old_coreisr;
+ s->coreisr.reg_u64[cpu][index] = old_data & ~data;
+ data &= old_data;
bits = sizeof(data) * 8;
- irq = find_first_bit((void *)&coreisr, bits);
+ irq = find_first_bit((void *)&data, bits);
while (irq < bits) {
eiointc_update_irq(s, irq + index * bits, 0);
- bitmap_clear((void *)&coreisr, irq, 1);
- irq = find_first_bit((void *)&coreisr, bits);
+ bitmap_clear((void *)&data, irq, 1);
+ irq = find_first_bit((void *)&data, bits);
}
break;
case EIOINTC_COREMAP_START ... EIOINTC_COREMAP_END:
--
2.39.3