Skip to contentSkip to conversation

hw/intc/riscv_aplic: Remove redundant masking of hart_idx in riscv_aplic_msi_send()

PATCH New Huang Borong 1 participant 1 message Jan 10, 2025 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/intc/riscv_aplic: Remove redundant masking of hart_idx in riscv_aplic_msi_send()

The line "hart_idx &= APLIC_xMSICFGADDR_PPN_LHX_MASK(lhxw);" was removed because the same operation is performed later in the address calculation. This change improves code clarity and avoids unnecessary operations.

---
 hw/intc/riscv_aplic.c | 1 -
 1 file changed, 1 deletion(-)
hw/intc/riscv_aplic.c +0 -1
index 4866649115..0974c6a5db 100644
@@ -421,7 +421,6 @@ static void riscv_aplic_msi_send(RISCVAPLICState *aplic,
             APLIC_xMSICFGADDRH_HHXW_MASK;
 
     group_idx = hart_idx >> lhxw;
-    hart_idx &= APLIC_xMSICFGADDR_PPN_LHX_MASK(lhxw);
 
     addr = msicfgaddr;
     addr |= ((uint64_t)(msicfgaddrH & APLIC_xMSICFGADDRH_BAPPN_MASK)) << 32;
Signature · 1 line
2.34.1