Skip to content

Commit

Permalink
driver: intc: plic: fix trigger type register bit calculation
Browse files Browse the repository at this point in the history
The bit position calculation for the trigger type is wrong,
fix that.

Signed-off-by: Yong Cong Sin <[email protected]>
  • Loading branch information
ycsin committed Dec 1, 2023
1 parent a6eef0b commit eb8793c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/interrupt_controller/intc_plic.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static int riscv_plic_is_edge_irq(uint32_t irq)
volatile uint32_t *trig = (volatile uint32_t *)PLIC_EDGE_TRIG_TYPE;

trig += (irq >> PLIC_EDGE_TRIG_SHIFT);
return *trig & BIT(irq);
return *trig & BIT(irq & BIT_MASK(PLIC_EDGE_TRIG_SHIFT));
}

/**
Expand Down

0 comments on commit eb8793c

Please sign in to comment.