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:
Huihuang Shi
2018-06-19 14:45:30 +08:00
committed by lijinxia
parent fe0314e8c3
commit 23921384d0
8 changed files with 50 additions and 49 deletions

View File

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