mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-07 03:40:27 +00:00
HV:fixed "Pointer param should be declared pointer to const"
Pointer param should be declared pointer to const if the parameter is keeped read-only. This patch changes pointer param whose name is vm. Tracked-On:#861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
committed by
Xie, Nanlin
parent
40dbdcde4f
commit
60b216a460
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
static inline struct ptdev_remapping_info *
|
||||
ptdev_lookup_entry_by_sid(uint32_t intr_type,
|
||||
union source_id *sid, struct vm *vm)
|
||||
union source_id *sid,const struct vm *vm)
|
||||
{
|
||||
struct ptdev_remapping_info *entry;
|
||||
struct list_head *pos;
|
||||
@@ -43,7 +43,7 @@ is_entry_active(struct ptdev_remapping_info *entry)
|
||||
return atomic_load32(&entry->active) == ACTIVE_FLAG;
|
||||
}
|
||||
|
||||
static bool ptdev_hv_owned_intx(struct vm *vm, union source_id *virt_sid)
|
||||
static bool ptdev_hv_owned_intx(const struct vm *vm, union source_id *virt_sid)
|
||||
{
|
||||
/* vm0 vuart pin is owned by hypervisor under debug version */
|
||||
if (is_vm0(vm) && (virt_sid->intx_id.pin == COM1_IRQ)) {
|
||||
@@ -230,7 +230,7 @@ add_msix_remapping(struct vm *vm, uint16_t virt_bdf, uint16_t phys_bdf,
|
||||
|
||||
/* deactive & remove mapping entry of vbdf:entry_nr for vm */
|
||||
static void
|
||||
remove_msix_remapping(struct vm *vm, uint16_t virt_bdf, uint32_t entry_nr)
|
||||
remove_msix_remapping(const struct vm *vm, uint16_t virt_bdf, uint32_t entry_nr)
|
||||
{
|
||||
struct ptdev_remapping_info *entry;
|
||||
DEFINE_MSI_SID(virt_sid, virt_bdf, entry_nr);
|
||||
@@ -324,7 +324,7 @@ add_intx_remapping(struct vm *vm, uint8_t virt_pin,
|
||||
}
|
||||
|
||||
/* deactive & remove mapping entry of vpin for vm */
|
||||
static void remove_intx_remapping(struct vm *vm, uint8_t virt_pin, bool pic_pin)
|
||||
static void remove_intx_remapping(const struct vm *vm, uint8_t virt_pin, bool pic_pin)
|
||||
{
|
||||
uint32_t phys_irq;
|
||||
struct ptdev_remapping_info *entry;
|
||||
@@ -732,7 +732,7 @@ int ptdev_add_intx_remapping(struct vm *vm, uint8_t virt_pin, uint8_t phys_pin,
|
||||
/*
|
||||
* @pre vm != NULL
|
||||
*/
|
||||
void ptdev_remove_intx_remapping(struct vm *vm, uint8_t virt_pin, bool pic_pin)
|
||||
void ptdev_remove_intx_remapping(const struct vm *vm, uint8_t virt_pin, bool pic_pin)
|
||||
{
|
||||
remove_intx_remapping(vm, virt_pin, pic_pin);
|
||||
}
|
||||
@@ -761,7 +761,7 @@ int ptdev_add_msix_remapping(struct vm *vm, uint16_t virt_bdf,
|
||||
/*
|
||||
* @pre vm != NULL
|
||||
*/
|
||||
void ptdev_remove_msix_remapping(struct vm *vm, uint16_t virt_bdf,
|
||||
void ptdev_remove_msix_remapping(const struct vm *vm, uint16_t virt_bdf,
|
||||
uint32_t vector_count)
|
||||
{
|
||||
uint32_t i;
|
||||
|
@@ -6,9 +6,9 @@
|
||||
|
||||
#include <hypervisor.h>
|
||||
|
||||
int validate_pstate(struct vm *vm, uint64_t perf_ctl)
|
||||
int validate_pstate(const struct vm *vm, uint64_t perf_ctl)
|
||||
{
|
||||
struct cpu_px_data *px_data;
|
||||
const struct cpu_px_data *px_data;
|
||||
int i, px_cnt;
|
||||
|
||||
if (is_vm0(vm)) {
|
||||
|
@@ -140,11 +140,11 @@ static uint16_t vm_apicid2vcpu_id(struct vm *vm, uint8_t lapicid)
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
vm_active_cpus(struct vm *vm)
|
||||
vm_active_cpus(const struct vm *vm)
|
||||
{
|
||||
uint64_t dmask = 0UL;
|
||||
uint16_t i;
|
||||
struct vcpu *vcpu;
|
||||
const struct vcpu *vcpu;
|
||||
|
||||
foreach_vcpu(i, vm, vcpu) {
|
||||
bitmap_set_lock(vcpu->vcpu_id, &dmask);
|
||||
|
@@ -30,7 +30,7 @@ static inline uint16_t alloc_vm_id(void)
|
||||
return INVALID_VM_ID;
|
||||
}
|
||||
|
||||
static inline void free_vm_id(struct vm *vm)
|
||||
static inline void free_vm_id(const struct vm *vm)
|
||||
{
|
||||
bitmap_clear_lock(vm->vm_id, &vmid_bitmap);
|
||||
}
|
||||
|
Reference in New Issue
Block a user