lib: utils/irqchip: plic: Fix the off-by-one error in context save/restore helpers
authorBin Meng <bmeng@tinylab.org>
Sun, 11 Dec 2022 06:54:23 +0000 (14:54 +0800)
committerAnup Patel <anup@brainfault.org>
Sat, 17 Dec 2022 03:32:40 +0000 (09:02 +0530)
commitfabbc006687a0fddeabb7a3effabb3a8e1c81c48
tree574dbf81a813f6c39b33aa5d238fed15cf3ff6dd
parent91c8a7d5cef1e9729c1c2bad549ebc69afeadb3b
lib: utils/irqchip: plic: Fix the off-by-one error in context save/restore helpers

plic->num_src holds the number of interrupt sources without interrupt
source 0 but the interrupt enable register includes a bit for the
interrupt source 0 in the first word.

Fixes: 415ecf28f7ad ("lib: irqchip/plic: Add context save/restore helpers")
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Samuel Holland <samuel@sholland.org>
lib/utils/irqchip/plic.c