summaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_ipi.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-02-22 09:20:55 +0300
committerAnup Patel <anup@brainfault.org>2020-02-24 06:40:04 +0300
commitf8b3bb826d488847009f74409b1898d88b5a6cc7 (patch)
treefdac7aaa37c172ac05e7cb9a753d2b48de9068f3 /lib/sbi/sbi_ipi.c
parent393624377a45d0fc20a376db60fb136a3b1fd685 (diff)
downloadopensbi-f8b3bb826d488847009f74409b1898d88b5a6cc7.tar.xz
lib: Simplify the for-loop in sbi_ipi_send_many()
We don't need to separately call sbi_ipi_send() for current HART in sbi_ipi_send_many(). Instead, we can simplify the for-loop in sbi_ipi_send_many() and call sbi_ipi_send() for all HARTs in the for-loop itself. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'lib/sbi/sbi_ipi.c')
-rw-r--r--lib/sbi/sbi_ipi.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/sbi/sbi_ipi.c b/lib/sbi/sbi_ipi.c
index 62eba87..d3b48fe 100644
--- a/lib/sbi/sbi_ipi.c
+++ b/lib/sbi/sbi_ipi.c
@@ -76,7 +76,6 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong hmask, ulong hbase,
ulong i, m;
ulong mask = sbi_hart_available_mask();
ulong tempmask;
- u32 hartid = sbi_current_hartid();
unsigned long last_bit = __fls(mask);
if (hbase != -1UL) {
@@ -98,16 +97,9 @@ int sbi_ipi_send_many(struct sbi_scratch *scratch, ulong hmask, ulong hbase,
/* Send IPIs to every other hart on the set */
for (i = 0, m = mask; m; i++, m >>= 1)
- if ((m & 1UL) && (i != hartid))
+ if (m & 1UL)
sbi_ipi_send(scratch, i, event, data);
- /*
- * If the current hart is on the set, send an IPI
- * to it as well
- */
- if (mask & (1UL << hartid))
- sbi_ipi_send(scratch, hartid, event, data);
-
return 0;
}