mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 15:45:05 +00:00
HV: add the missing brackets to loop body
MISRA-C requires the use of brackets, even when there is only one statement in the loop body. Signed-off-by: Ying Liu <ying2.liu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -67,8 +67,9 @@ int console_puts(const char *s)
|
||||
*/
|
||||
p = s;
|
||||
|
||||
while ((*p != 0) && *p != '\n')
|
||||
while ((*p != 0) && *p != '\n') {
|
||||
++p;
|
||||
}
|
||||
|
||||
/* write all characters up to p */
|
||||
serial_puts(serial_handle, s, p - s);
|
||||
@@ -109,8 +110,9 @@ int console_write(const char *s, size_t len)
|
||||
/* search for '\n' or the end of the string */
|
||||
p = s;
|
||||
|
||||
while ((p != e) && (*p != '\n'))
|
||||
while ((p != e) && (*p != '\n')) {
|
||||
++p;
|
||||
}
|
||||
|
||||
/* write all characters processed so far */
|
||||
serial_puts(serial_handle, s, p - s);
|
||||
@@ -146,8 +148,9 @@ void console_dump_bytes(const void *p, unsigned int len)
|
||||
/* write the address of the first byte in the row */
|
||||
printf("%08x: ", (uint64_t) x);
|
||||
/* print one row (16 bytes) as hexadecimal values */
|
||||
for (i = 0; i < 16; i++)
|
||||
for (i = 0; i < 16; i++) {
|
||||
printf("%02x ", x[i]);
|
||||
}
|
||||
|
||||
/* print one row as ASCII characters (if possible) */
|
||||
for (i = 0; i < 16; i++) {
|
||||
|
||||
@@ -76,8 +76,9 @@ void init_logmsg(__unused uint32_t mem_size, uint32_t flags)
|
||||
logmsg.seq = 0;
|
||||
|
||||
/* allocate sbuf for log before sos booting */
|
||||
for (pcpu_id = 0U; pcpu_id < phys_cpu_num; pcpu_id++)
|
||||
for (pcpu_id = 0U; pcpu_id < phys_cpu_num; pcpu_id++) {
|
||||
alloc_earlylog_sbuf(pcpu_id);
|
||||
}
|
||||
}
|
||||
|
||||
void do_logmsg(uint32_t severity, const char *fmt, ...)
|
||||
|
||||
@@ -332,8 +332,9 @@ int serial_puts(uint32_t uart_handle, const char *s, uint32_t length)
|
||||
* Loop through the string until desired length of bytes have
|
||||
* been written or SERIAL_EOF is returned.
|
||||
*/
|
||||
for (; length > 0U && retval != SERIAL_EOF; s++, length--)
|
||||
for (; length > 0U && retval != SERIAL_EOF; s++, length--) {
|
||||
retval = serial_putc(uart_handle, (int) *s);
|
||||
}
|
||||
|
||||
/* Allow other threads to use this service. */
|
||||
spinlock_release(&port->tx_lock);
|
||||
|
||||
@@ -66,8 +66,9 @@ static int string_to_argv(char *argv_str, void *p_argv_mem,
|
||||
/* Move past the vector entry argument string (in the
|
||||
* argument string).
|
||||
*/
|
||||
while ((*p_ch != ' ') && (*p_ch != ',') && (*p_ch != 0))
|
||||
while ((*p_ch != ' ') && (*p_ch != ',') && (*p_ch != 0)) {
|
||||
p_ch++;
|
||||
}
|
||||
|
||||
/* Count the argument just processed. */
|
||||
argc++;
|
||||
@@ -80,8 +81,9 @@ static int string_to_argv(char *argv_str, void *p_argv_mem,
|
||||
*p_ch = 0;
|
||||
/* Remove all space in middile of cmdline */
|
||||
p_ch++;
|
||||
while (*p_ch == ' ')
|
||||
while (*p_ch == ' ') {
|
||||
p_ch++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -322,8 +322,9 @@ void vuart_console_tx_chars(void)
|
||||
return;
|
||||
|
||||
vuart_lock(vu);
|
||||
while (fifo_numchars(&vu->txfifo) > 0)
|
||||
while (fifo_numchars(&vu->txfifo) > 0) {
|
||||
printf("%c", fifo_getchar(&vu->txfifo));
|
||||
}
|
||||
vuart_unlock(vu);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user