mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 01:37:44 +00:00
HV: logical and high level precedence expression needs brackets
Added brackets for expression to make it easy to understand and reduce the mistake of precedence. The rule is applied to the mixed same level of prevedence opeartors, high level presedence operators and logical expression. Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -23,7 +23,7 @@ static struct logmsg logmsg;
|
||||
static inline void alloc_earlylog_sbuf(uint16_t pcpu_id)
|
||||
{
|
||||
uint32_t ele_size = LOG_ENTRY_SIZE;
|
||||
uint32_t ele_num = ((HVLOG_BUF_SIZE >> 1) / phys_cpu_num
|
||||
uint32_t ele_num = (((HVLOG_BUF_SIZE >> 1U) / phys_cpu_num)
|
||||
- SBUF_HEAD_SIZE) / ele_size;
|
||||
|
||||
per_cpu(earlylog_sbuf, pcpu_id) = sbuf_allocate(ele_num, ele_size);
|
||||
@@ -158,10 +158,10 @@ void do_logmsg(uint32_t severity, const char *fmt, ...)
|
||||
if (sbuf != NULL) {
|
||||
msg_len = strnlen_s(buffer, LOG_MESSAGE_MAX_SIZE);
|
||||
|
||||
for (i = 0; i < (msg_len - 1) / LOG_ENTRY_SIZE + 1;
|
||||
for (i = 0; i < (((msg_len - 1) / LOG_ENTRY_SIZE) + 1);
|
||||
i++) {
|
||||
(void)sbuf_put(sbuf, (uint8_t *)buffer +
|
||||
i * LOG_ENTRY_SIZE);
|
||||
(i * LOG_ENTRY_SIZE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user