mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 07:35:31 +00:00
hv: fix integer violations
- Fix the integer violations related to the following rules:
1. The operands to shift operations (<<, >>) shall be unsigned
integers.
2. The operands to bit operations (&, |, ~) shall be unsigned
integers.
- Replace 12U with CPU_PAGE_SHIFT when it is address shift case.
v1 -> v2:
* use existed MACRO to get bus/slot/func values
* update PCI_SLOT MACRO to make it more straightforward
* remove the incorrect replacement of 12U with CPU_PAGE_SHIFT
dmar_fault_msi_write
Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -168,7 +168,7 @@ int general_sw_loader(struct acrn_vm *vm)
|
||||
/* add "cma=XXXXM@0xXXXXXXXX" to cmdline*/
|
||||
if (is_vm0(vm) && (e820_mem.max_ram_blk_size > 0)) {
|
||||
snprintf(dyn_bootargs, 100U, " cma=%dM@0x%llx",
|
||||
(e820_mem.max_ram_blk_size >> 20),
|
||||
(e820_mem.max_ram_blk_size >> 20U),
|
||||
e820_mem.max_ram_blk_base);
|
||||
(void)strcpy_s((char *)hva
|
||||
+ sw_linux->bootargs_size,
|
||||
@@ -183,10 +183,10 @@ int general_sw_loader(struct acrn_vm *vm)
|
||||
int32_t reserving_1g_pages;
|
||||
|
||||
#ifdef CONFIG_REMAIN_1G_PAGES
|
||||
reserving_1g_pages = (e820_mem.total_mem_size >> 30) -
|
||||
reserving_1g_pages = (e820_mem.total_mem_size >> 30U) -
|
||||
CONFIG_REMAIN_1G_PAGES;
|
||||
#else
|
||||
reserving_1g_pages = (e820_mem.total_mem_size >> 30) -
|
||||
reserving_1g_pages = (e820_mem.total_mem_size >> 30U) -
|
||||
3;
|
||||
#endif
|
||||
if (reserving_1g_pages > 0) {
|
||||
|
||||
Reference in New Issue
Block a user