Skip to content

Commit b4a2ff5

Browse files
shiqingglijinxia
authored andcommitted
hv: treewide: fix 'Prototype and definition name mismatch'
Fix the parameter name mismatch between API declaration and definition. v2 -> v3: * Fix two more violations which are missed in previous report. shell_puts and console_write v1 -> v2: * Replace 'ret_desc' with 'desc' Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
1 parent f42878e commit b4a2ff5

File tree

17 files changed

+35
-35
lines changed

17 files changed

+35
-35
lines changed

hypervisor/arch/x86/guest/instr_emul.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,14 +1484,14 @@ vmm_emulate_instruction(struct vcpu *vcpu, uint64_t gpa, struct instr_emul_vie *
14841484
}
14851485

14861486
int
1487-
vie_alignment_check(uint8_t cpl, uint8_t size, uint64_t cr0, uint64_t rf,
1487+
vie_alignment_check(uint8_t cpl, uint8_t size, uint64_t cr0, uint64_t rflags,
14881488
uint64_t gla)
14891489
{
14901490
ASSERT(size == 1U || size == 2U || size == 4U || size == 8U,
14911491
"%s: invalid size %hhu", __func__, size);
14921492
ASSERT(cpl <= 3U, "%s: invalid cpl %d", __func__, cpl);
14931493

1494-
if (cpl != 3U || (cr0 & CR0_AM) == 0UL || (rf & PSL_AC) == 0UL) {
1494+
if (cpl != 3U || (cr0 & CR0_AM) == 0UL || (rflags & PSL_AC) == 0UL) {
14951495
return 0;
14961496
}
14971497

hypervisor/arch/x86/guest/instr_emul.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef int (*mem_region_write_t)(struct vcpu *vcpu, uint64_t gpa,
4545
* Emulate the decoded 'vie' instruction.
4646
*
4747
* The callbacks 'mrr' and 'mrw' emulate reads and writes to the memory region
48-
* containing 'gpa'. 'mrarg' is an opaque argument that is passed into the
48+
* containing 'gpa'. 'memarg' is an opaque argument that is passed into the
4949
* callback functions.
5050
*
5151
* 'void *vm' should be 'struct vm *' when called from kernel context and
@@ -54,15 +54,15 @@ typedef int (*mem_region_write_t)(struct vcpu *vcpu, uint64_t gpa,
5454
*/
5555
int vmm_emulate_instruction(struct vcpu *vcpu, uint64_t gpa, struct instr_emul_vie *vie,
5656
struct vm_guest_paging *paging, mem_region_read_t mrr,
57-
mem_region_write_t mrw, void *mrarg);
57+
mem_region_write_t mrw, void *memarg);
5858

5959
int vie_update_register(struct vcpu *vcpu, enum cpu_reg_name reg,
6060
uint64_t val_arg, uint8_t size);
6161

6262
/*
6363
* Returns 1 if an alignment check exception should be injected and 0 otherwise.
6464
*/
65-
int vie_alignment_check(uint8_t cpl, uint8_t operand_size, uint64_t cr0,
65+
int vie_alignment_check(uint8_t cpl, uint8_t size, uint64_t cr0,
6666
uint64_t rflags, uint64_t gla);
6767

6868
/* Returns 1 if the 'gla' is not canonical and 0 otherwise. */

hypervisor/arch/x86/guest/instr_emul_wrapper.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ int vm_set_register(struct vcpu *vcpu, enum cpu_reg_name reg, uint64_t val)
9595
}
9696

9797
int vm_set_seg_desc(struct vcpu *vcpu, enum cpu_reg_name seg,
98-
struct seg_desc *ret_desc)
98+
struct seg_desc *desc)
9999
{
100100
int error;
101101
uint32_t base, limit, access;
102102

103-
if ((vcpu == NULL) || (ret_desc == NULL)) {
103+
if ((vcpu == NULL) || (desc == NULL)) {
104104
return -EINVAL;
105105
}
106106

@@ -113,9 +113,9 @@ int vm_set_seg_desc(struct vcpu *vcpu, enum cpu_reg_name seg,
113113
return -EINVAL;
114114
}
115115

116-
exec_vmwrite(base, ret_desc->base);
117-
exec_vmwrite32(limit, ret_desc->limit);
118-
exec_vmwrite32(access, ret_desc->access);
116+
exec_vmwrite(base, desc->base);
117+
exec_vmwrite32(limit, desc->limit);
118+
exec_vmwrite32(access, desc->access);
119119

120120
return 0;
121121
}

hypervisor/arch/x86/guest/instr_emul_wrapper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ struct instr_emul_ctxt {
251251

252252
int vm_get_register(struct vcpu *vcpu, enum cpu_reg_name reg, uint64_t *retval);
253253
int vm_set_register(struct vcpu *vcpu, enum cpu_reg_name reg, uint64_t val);
254-
int vm_get_seg_desc(struct vcpu *vcpu, enum cpu_reg_name reg,
255-
struct seg_desc *ret_desc);
256-
int vm_set_seg_desc(struct vcpu *vcpu, enum cpu_reg_name reg,
254+
int vm_get_seg_desc(struct vcpu *vcpu, enum cpu_reg_name seg,
255+
struct seg_desc *desc);
256+
int vm_set_seg_desc(struct vcpu *vcpu, enum cpu_reg_name seg,
257257
struct seg_desc *desc);
258258
#endif

hypervisor/arch/x86/guest/vlapic.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ vlapic_rdmsr(struct vcpu *vcpu, uint32_t msr, uint64_t *rval)
19781978
}
19791979

19801980
int
1981-
vlapic_wrmsr(struct vcpu *vcpu, uint32_t msr, uint64_t val)
1981+
vlapic_wrmsr(struct vcpu *vcpu, uint32_t msr, uint64_t wval)
19821982
{
19831983
int error = 0;
19841984
uint32_t offset;
@@ -1988,21 +1988,21 @@ vlapic_wrmsr(struct vcpu *vcpu, uint32_t msr, uint64_t val)
19881988

19891989
switch (msr) {
19901990
case MSR_IA32_APIC_BASE:
1991-
error = vlapic_set_apicbase(vlapic, val);
1991+
error = vlapic_set_apicbase(vlapic, wval);
19921992
break;
19931993

19941994
case MSR_IA32_TSC_DEADLINE:
1995-
vlapic_set_tsc_deadline_msr(vlapic, val);
1995+
vlapic_set_tsc_deadline_msr(vlapic, wval);
19961996
break;
19971997

19981998
default:
19991999
offset = x2apic_msr_to_regoff(msr);
2000-
error = vlapic_write(vlapic, 0, offset, val);
2000+
error = vlapic_write(vlapic, 0, offset, wval);
20012001
break;
20022002
}
20032003

2004-
dev_dbg(ACRN_DBG_LAPIC, "cpu[%hu] wrmsr: %x val=%#x",
2005-
vcpu->vcpu_id, msr, val);
2004+
dev_dbg(ACRN_DBG_LAPIC, "cpu[%hu] wrmsr: %x wval=%#x",
2005+
vcpu->vcpu_id, msr, wval);
20062006
return error;
20072007
}
20082008

hypervisor/arch/x86/vtd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static spinlock_t domain_lock;
172172
static struct iommu_domain *host_domain;
173173
static struct list_head iommu_domains;
174174

175-
static void dmar_register_hrhd(struct dmar_drhd_rt *drhd_rt);
175+
static void dmar_register_hrhd(struct dmar_drhd_rt *dmar_uint);
176176
static struct dmar_drhd_rt *device_to_dmaru(uint16_t segment, uint8_t bus,
177177
uint8_t devfun);
178178
static void register_hrhd_units(void)

hypervisor/debug/shell_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ int shell_show_vmexit_profile(__unused int argc, __unused char **argv);
119119
int shell_dump_logbuf(int argc, char **argv);
120120
int shell_loglevel(int argc, char **argv);
121121
int shell_cpuid(int argc, char **argv);
122-
struct shell_cmd *shell_find_cmd(const char *cmd);
122+
struct shell_cmd *shell_find_cmd(const char *cmd_str);
123123
int shell_process_cmd(char *p_input_line);
124-
void shell_puts(const char *str_ptr);
124+
void shell_puts(const char *string_ptr);
125125
int shell_trigger_crash(int argc, char **argv);
126126

127127
#endif /* SHELL_INTER_H */

hypervisor/include/arch/x86/guest/vlapic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int vlapic_pending_intr(struct acrn_vlapic *vlapic, uint32_t *vecptr);
5757
void vlapic_intr_accepted(struct acrn_vlapic *vlapic, uint32_t vector);
5858

5959
struct acrn_vlapic *vm_lapic_from_pcpuid(struct vm *vm, uint16_t pcpu_id);
60-
bool is_vlapic_msr(uint32_t num);
60+
bool is_vlapic_msr(uint32_t msr);
6161
int vlapic_rdmsr(struct vcpu *vcpu, uint32_t msr, uint64_t *rval);
6262
int vlapic_wrmsr(struct vcpu *vcpu, uint32_t msr, uint64_t wval);
6363

@@ -70,7 +70,7 @@ int vlapic_write_mmio_reg(struct vcpu *vcpu, uint64_t gpa,
7070
* Signals to the LAPIC that an interrupt at 'vector' needs to be generated
7171
* to the 'cpu', the state is recorded in IRR.
7272
*/
73-
int vlapic_set_intr(struct vcpu *vcpu, uint32_t vector, bool trig);
73+
int vlapic_set_intr(struct vcpu *vcpu, uint32_t vector, bool level);
7474

7575
#define LAPIC_TRIG_LEVEL true
7676
#define LAPIC_TRIG_EDGE false

hypervisor/include/arch/x86/guest/vm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ void resume_vm(struct vm *vm);
180180
void resume_vm_from_s3(struct vm *vm, uint32_t wakeup_vec);
181181
int start_vm(struct vm *vm);
182182
int reset_vm(struct vm *vm);
183-
int create_vm(struct vm_description *vm_desc, struct vm **vm);
183+
int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm);
184184
int prepare_vm0(void);
185185
#ifdef CONFIG_VM0_DESC
186186
void vm_fixup(struct vm *vm);

hypervisor/include/arch/x86/ioreq.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ int32_t dm_emulate_mmio_post(struct vcpu *vcpu);
128128
int32_t emulate_io(struct vcpu *vcpu, struct io_request *io_req);
129129
void emulate_io_post(struct vcpu *vcpu);
130130

131-
int32_t acrn_insert_request_wait(struct vcpu *vcpu, struct io_request *req);
131+
int32_t acrn_insert_request_wait(struct vcpu *vcpu, struct io_request *io_req);
132132

133133
#endif /* IOREQ_H */

0 commit comments

Comments
 (0)