mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-22 09:17:58 +00:00
HV: vlapic: save complex expressions to local variables
Use local variables to hold struct members before using them, which helps us avoid confusions from static checkers. Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Dong Eddie <eddie.dong@intel.com>
This commit is contained in:
@@ -280,22 +280,26 @@ static inline uint64_t mem_read64(void *addr)
|
||||
|
||||
static inline void mem_write8(void *addr, uint8_t data)
|
||||
{
|
||||
*(volatile uint8_t *)(addr) = (uint8_t)(data);
|
||||
volatile uint8_t *addr8 = (volatile uint8_t *)addr;
|
||||
*addr8 = data;
|
||||
}
|
||||
|
||||
static inline void mem_write16(void *addr, uint16_t data)
|
||||
{
|
||||
*(volatile uint16_t *)(addr) = (uint16_t)(data);
|
||||
volatile uint16_t *addr16 = (volatile uint16_t *)addr;
|
||||
*addr16 = data;
|
||||
}
|
||||
|
||||
static inline void mem_write32(void *addr, uint32_t data)
|
||||
{
|
||||
*(volatile uint32_t *)(addr) = (uint32_t)(data);
|
||||
volatile uint32_t *addr32 = (volatile uint32_t *)addr;
|
||||
*addr32 = data;
|
||||
}
|
||||
|
||||
static inline void mem_write64(void *addr, uint64_t data)
|
||||
{
|
||||
*(volatile uint64_t *)(addr) = (uint64_t)(data);
|
||||
volatile uint64_t *addr64 = (volatile uint64_t *)addr;
|
||||
*addr64 = data;
|
||||
}
|
||||
|
||||
/* Typedef for MMIO handler and range check routine */
|
||||
|
Reference in New Issue
Block a user