summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2019-02-18 16:09:02 +0300
committerAnup Patel <anup@brainfault.org>2019-02-18 16:09:02 +0300
commit4e774f5470d567c33b620fff7b37622174f8949a (patch)
tree905cb08768c5a1cd5143c678160af2973aea0449 /lib
parent148423d14132df71a0ed26b34c7f81a180cb1308 (diff)
downloadopensbi-4e774f5470d567c33b620fff7b37622174f8949a.tar.xz
lib: Fix mask shift in sbi_ipi_send_many()
The mask shift in for-loop of sbi_ipi_send_many() is broken with commit 918c1354b75c74b62f67c4e929551d643f035443 ("lib: Improve delivery of SBI_IPI_EVENT_HALT") This patch fix it. Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi_ipi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi_ipi.c b/lib/sbi_ipi.c
index a72f75b..5f189c8 100644
--- a/lib/sbi_ipi.c
+++ b/lib/sbi_ipi.c
@@ -51,7 +51,7 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch,
mask &= load_ulong(pmask, csr_read(CSR_MEPC));
/* send IPIs to every other hart on the set */
- for (i = 0, m = mask; m > 0; m >>= ++i)
+ for (i = 0, m = mask; m; i++, m >>= 1)
if ((m & 1UL) && (i != hartid))
sbi_ipi_send(scratch, i, event);