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 <jgarber1@ualberta.ca>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
This commit is contained in:
Jacob Garber
2019-08-09 17:13:57 -06:00
committed by Anup Patel
parent 88c87f0af4
commit 3f738f5897

View File

@@ -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);
}