[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250701030842.1136519-8-maobibo@loongson.cn>
Date: Tue, 1 Jul 2025 11:08:36 +0800
From: Bibo Mao <maobibo@...ngson.cn>
To: Tianrui Zhao <zhaotianrui@...ngson.cn>,
Huacai Chen <chenhuacai@...nel.org>,
Xianglai Li <lixianglai@...ngson.cn>
Cc: kvm@...r.kernel.org,
loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH v5 07/13] LoongArch: KVM: Remove some unnecessary local variables
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@...ngson.cn>
---
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
Powered by blists - more mailing lists