diff options
| author | Jacob Garber <[email protected]> | 2019-08-09 17:13:57 -0600 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2019-08-12 09:22:20 +0530 |
| commit | 3f738f5897a6694b8630d3a9c6751f49c3c7d540 (patch) | |
| tree | 0658222f6813f89549ba01140d6ecb2b1ca77c59 | |
| parent | 88c87f0af4bded7b1892bd68a6d59ed583d65641 (diff) | |
lib: Use bitwise & instead of boolean &&
!(mipval && MIP_MSIP) simplifies to !mipval, which checks if the entire
variable is zero, not just a single bit. Fix this to use bitwise &
instead.
Signed-off-by: Jacob Garber <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_hart.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 3be5b8a4..6bf0e136 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -339,7 +339,7 @@ void sbi_hart_wait_for_coldboot(struct sbi_scratch *scratch, u32 hartid) spin_lock(&coldboot_wait_bitmap_lock); coldboot_wait_bitmap &= ~(1UL << hartid); spin_unlock(&coldboot_wait_bitmap_lock); - } while (!(mipval && MIP_MSIP)); + } while (!(mipval & MIP_MSIP)); csr_clear(CSR_MIP, MIP_MSIP); } |
