mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-11-27 23:15:00 +00:00
HV:debug:fix "expression is not Boolean"
MISRA C explicit required expression should be boolean when in branch statements (if,while...). Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -45,13 +45,13 @@ struct shared_buf *sbuf_allocate(uint32_t ele_num, uint32_t ele_size)
|
||||
struct shared_buf *sbuf;
|
||||
uint32_t sbuf_allocate_size;
|
||||
|
||||
if (!ele_num || !ele_size) {
|
||||
if (ele_num == 0U || ele_size == 0U) {
|
||||
pr_err("%s invalid parameter!", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sbuf_allocate_size = sbuf_calculate_allocate_size(ele_num, ele_size);
|
||||
if (!sbuf_allocate_size)
|
||||
if (sbuf_allocate_size == 0U)
|
||||
return NULL;
|
||||
|
||||
sbuf = calloc(1, sbuf_allocate_size);
|
||||
@@ -133,7 +133,7 @@ int sbuf_put(struct shared_buf *sbuf, uint8_t *data)
|
||||
if (next_tail == sbuf->head) {
|
||||
/* accumulate overrun count if necessary */
|
||||
sbuf->overrun_cnt += sbuf->flags & OVERRUN_CNT_EN;
|
||||
if (!(sbuf->flags & OVERWRITE_EN)) {
|
||||
if ((sbuf->flags & OVERWRITE_EN) == 0U) {
|
||||
/* if not enable over write, return here. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user