HV:fix "Pointer param should be declared pointer to const"

Fix violations for function whose parameter can be read-only.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Huihuang Shi
2018-10-23 11:45:29 +08:00
committed by wenlingz
parent d79007ae70
commit ea32c34ae1
39 changed files with 149 additions and 149 deletions

View File

@@ -318,13 +318,13 @@ void *get_dmar_table(void)
#define OFFSET_WAKE_VECTOR_64 24U
/* get a dword value from given table and its offset */
static inline uint32_t get_acpi_dt_dword(uint8_t *dt_addr, uint32_t dt_offset)
static inline uint32_t get_acpi_dt_dword(const uint8_t *dt_addr, uint32_t dt_offset)
{
return *(uint32_t *)(dt_addr + dt_offset);
}
/* get a qword value from given table and its offset */
static inline uint64_t get_acpi_dt_qword(uint8_t *dt_addr, uint32_t dt_offset)
static inline uint64_t get_acpi_dt_qword(const uint8_t *dt_addr, uint32_t dt_offset)
{
return *(uint64_t *)(dt_addr + dt_offset);
}

View File

@@ -9,8 +9,8 @@
extern void relocate(void);
extern uint64_t get_hv_image_delta(void);
extern uint64_t get_hv_image_base(void);
extern uint64_t read_trampoline_sym(void *sym);
extern void write_trampoline_sym(void *sym, uint64_t val);
extern uint64_t read_trampoline_sym(const void *sym);
extern void write_trampoline_sym(const void *sym, uint64_t val);
extern uint64_t prepare_trampoline(void);
/* external symbols that are helpful for relocation */

View File

@@ -65,7 +65,7 @@ uint64_t get_hv_image_base(void)
* - The HV code is always relocated to higher address, compared
* with CONFIG_RAM_START
*/
static uint64_t trampoline_relo_addr(void *addr)
static uint64_t trampoline_relo_addr(const void *addr)
{
return (uint64_t)addr - get_hv_image_delta();
}
@@ -143,7 +143,7 @@ void relocate(void)
#endif
}
uint64_t read_trampoline_sym(void *sym)
uint64_t read_trampoline_sym(const void *sym)
{
uint64_t *hva;
@@ -151,7 +151,7 @@ uint64_t read_trampoline_sym(void *sym)
return *hva;
}
void write_trampoline_sym(void *sym, uint64_t val)
void write_trampoline_sym(const void *sym, uint64_t val)
{
uint64_t *hva;

View File

@@ -73,7 +73,7 @@ static char kernel_cmdline[MEM_2K];
/* now modules support: FIRMWARE & RAMDISK & SeedList */
static void parse_other_modules(struct vm *vm,
struct multiboot_module *mods, uint32_t mods_count)
const struct multiboot_module *mods, uint32_t mods_count)
{
uint32_t i;