mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv:cleanup console/uart code
-- Check uart enabled flag, it will return if the flag is false. -- Add function declaration (uart16550_set_property) in console.h -- Remove unnecessary function declaration(get_serial_handle) -- Change uart_enabled and port_mapped to bool -- Fix MISRA-C integer violations Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -44,7 +44,7 @@ static void handle_cmd(const char *cmd, int len)
|
||||
|
||||
if (i == IDX_DISABLE_UART) {
|
||||
/* set uart disabled*/
|
||||
uart16550_set_property(0, 0, 0);
|
||||
uart16550_set_property(false, false, 0UL);
|
||||
} else if ((i == IDX_PORT_UART) || (i == IDX_MMIO_UART)) {
|
||||
uint64_t addr = strtoul_hex(cmd + tmp);
|
||||
|
||||
@@ -54,9 +54,9 @@ static void handle_cmd(const char *cmd, int len)
|
||||
if (addr > MAX_PORT)
|
||||
addr = DEFAULT_UART_PORT;
|
||||
|
||||
uart16550_set_property(1, 1, addr);
|
||||
uart16550_set_property(true, true, addr);
|
||||
} else {
|
||||
uart16550_set_property(1, 0, addr);
|
||||
uart16550_set_property(true, false, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user