Skip to content
Permalink
Browse files

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>
  • Loading branch information...
Jacob Garber authored and avpatel committed Aug 9, 2019
1 parent 88c87f0 commit 3f738f5897a6694b8630d3a9c6751f49c3c7d540
Showing with 1 addition and 1 deletion.
  1. +1 −1 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);
}

0 comments on commit 3f738f5

Please sign in to comment.
You can’t perform that action at this time.