mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 10:17:28 +00:00
hv: code style fix for partition mode specific code
There are still some misra-c violations when CONFIG_PARTITION_MODE is defined. arch/x86/configs: - remove the unused macro: PRE_LAUNCH_VM_NUM - pt_dev.c: VMx_CONFIG_PCI_PTDEV_NUM has been defined in partition_config.h, should not hard code them again in pt_dev.c. - ve820.c: use "UL" suffix instead of "U" for 64 bits variables. vmid is uint16_t in ACRN, so vuart_vmid should be uint16_t as well. Fix another few other miscellaneous misra-c violations. Tracked-On: #861 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -46,7 +46,7 @@ static char vuart_tx_buf[TX_BUF_SIZE];
|
||||
#define vuart_unlock(vu) spinlock_release(&((vu)->lock))
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
int8_t vuart_vmid = - 1;
|
||||
uint16_t vuart_vmid = 0xFFFFU;
|
||||
#endif
|
||||
|
||||
static inline void fifo_reset(struct fifo *fifo)
|
||||
@@ -372,16 +372,14 @@ void vuart_console_rx_chars(struct acrn_vuart *vu)
|
||||
|
||||
struct acrn_vuart *vuart_console_active(void)
|
||||
{
|
||||
struct acrn_vm *vm = NULL;
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
struct acrn_vm *vm;
|
||||
|
||||
if (vuart_vmid == -1) {
|
||||
return NULL;
|
||||
if (vuart_vmid < CONFIG_MAX_VM_NUM) {
|
||||
vm = get_vm_from_vmid(vuart_vmid);
|
||||
}
|
||||
|
||||
vm = get_vm_from_vmid(vuart_vmid);
|
||||
#else
|
||||
struct acrn_vm *vm = get_sos_vm();
|
||||
vm = get_sos_vm();
|
||||
#endif
|
||||
|
||||
if (vm != NULL) {
|
||||
|
Reference in New Issue
Block a user