mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 01:07:57 +00:00
HV:misc:fix "signed/unsigned conversion without cast"
Misra C required signed/unsigned conversion with cast. V1->V2: a.split patch to patch series V2->V3: a.change the uint64_t type numeric constant's suffix from U to UL Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -262,13 +262,13 @@ struct stack_canary {
|
||||
|
||||
extern struct cpuinfo_x86 boot_cpu_data;
|
||||
|
||||
#define MAX_PSTATE 20 /* max num of supported Px count */
|
||||
#define MAX_CSTATE 8 /* max num of supported Cx count */
|
||||
#define MAX_PSTATE 20U /* max num of supported Px count */
|
||||
#define MAX_CSTATE 8U /* max num of supported Cx count */
|
||||
|
||||
/* We support MAX_CSTATE num of Cx, means have (MAX_CSTATE - 1) Cx entries,
|
||||
* i.e. supported Cx entry index range from 1 to MAX_CX_ENTRY.
|
||||
*/
|
||||
#define MAX_CX_ENTRY (MAX_CSTATE - 1)
|
||||
#define MAX_CX_ENTRY (MAX_CSTATE - 1U)
|
||||
|
||||
/* Function prototypes */
|
||||
void cpu_dead(uint32_t logical_id);
|
||||
|
@@ -210,7 +210,7 @@
|
||||
#define MMU_MEM_ATTR_TYPE_MASK \
|
||||
(IA32E_PDPTE_PAT_BIT | IA32E_COMM_PCD_BIT | IA32E_COMM_PWT_BIT)
|
||||
|
||||
#define ROUND_PAGE_UP(addr) (((addr) + CPU_PAGE_SIZE - 1) & CPU_PAGE_MASK)
|
||||
#define ROUND_PAGE_UP(addr) (((addr) + CPU_PAGE_SIZE - 1U) & CPU_PAGE_MASK)
|
||||
#define ROUND_PAGE_DOWN(addr) ((addr) & CPU_PAGE_MASK)
|
||||
|
||||
enum _page_table_type {
|
||||
@@ -329,12 +329,12 @@ struct e820_entry {
|
||||
#pragma pack()
|
||||
|
||||
/* E820 memory types */
|
||||
#define E820_TYPE_RAM 1 /* EFI 1, 2, 3, 4, 5, 6, 7 */
|
||||
#define E820_TYPE_RESERVED 2
|
||||
#define E820_TYPE_RAM 1U /* EFI 1, 2, 3, 4, 5, 6, 7 */
|
||||
#define E820_TYPE_RESERVED 2U
|
||||
/* EFI 0, 11, 12, 13 (everything not used elsewhere) */
|
||||
#define E820_TYPE_ACPI_RECLAIM 3 /* EFI 9 */
|
||||
#define E820_TYPE_ACPI_NVS 4 /* EFI 10 */
|
||||
#define E820_TYPE_UNUSABLE 5 /* EFI 8 */
|
||||
#define E820_TYPE_ACPI_RECLAIM 3U /* EFI 9 */
|
||||
#define E820_TYPE_ACPI_NVS 4U /* EFI 10 */
|
||||
#define E820_TYPE_UNUSABLE 5U /* EFI 8 */
|
||||
|
||||
/** Calculates the page table address for a given address.
|
||||
*
|
||||
|
Reference in New Issue
Block a user