HV:VLAPIC:add suffix "_fn" for function pointer

For some function pointer type, its name is identical with
variable name in the same scope. This MISRA C violation is
detected.

Naming convention rule:If the type is function
pointer, its name needs suffix "_fn".

The following udpates are made:
*apicv_set_intr_ready-->*apicv_set_intr_ready_fn
*apicv_pending_intr-->*apicv_pending_intr_fn
*apicv_set_tmr-->*apicv_set_tmr_fn
*apicv_batch_set_tmr-->*apicv_batch_set_tmr_fn
*apicv_intr_accepted-->*apicv_intr_accepted_fn
*apicv_post_intr-->*apicv_post_intr_fn
*enable_x2apic_mode-->*enable_x2apic_mode_fn

V1-->V2:
	Update function pointer when it is used as calling
	since no need to dereference a function pointer
	before calling.

Signed-off-by: Xiangyang Wu <xiangyang.wu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Xiangyang Wu 2018-07-30 14:00:01 +08:00 committed by lijinxia
parent 2c95a8c4aa
commit 8e2c730043
2 changed files with 21 additions and 21 deletions

View File

@ -475,8 +475,8 @@ vlapic_set_intr_ready(struct acrn_vlapic *vlapic, uint32_t vector, bool level)
return 1;
}
if (vlapic->ops.apicv_set_intr_ready != NULL) {
return (*vlapic->ops.apicv_set_intr_ready)
if (vlapic->ops.apicv_set_intr_ready_fn != NULL) {
return vlapic->ops.apicv_set_intr_ready_fn
(vlapic, vector, level);
}
@ -1190,8 +1190,8 @@ vlapic_pending_intr(struct acrn_vlapic *vlapic, uint32_t *vecptr)
uint32_t i, vector, val, bitpos;
struct lapic_reg *irrptr;
if (vlapic->ops.apicv_pending_intr != NULL) {
return (*vlapic->ops.apicv_pending_intr)(vlapic, vecptr);
if (vlapic->ops.apicv_pending_intr_fn != NULL) {
return vlapic->ops.apicv_pending_intr_fn(vlapic, vecptr);
}
irrptr = &lapic->irr[0];
@ -1222,8 +1222,8 @@ vlapic_intr_accepted(struct acrn_vlapic *vlapic, uint32_t vector)
struct lapic_reg *irrptr, *isrptr;
uint32_t idx, stk_top;
if (vlapic->ops.apicv_intr_accepted != NULL) {
vlapic->ops.apicv_intr_accepted(vlapic, vector);
if (vlapic->ops.apicv_intr_accepted_fn != NULL) {
vlapic->ops.apicv_intr_accepted_fn(vlapic, vector);
return;
}
@ -1746,16 +1746,16 @@ vlapic_set_tmr(struct acrn_vlapic *vlapic, uint32_t vector, bool level)
void
vlapic_apicv_batch_set_tmr(struct acrn_vlapic *vlapic)
{
if (vlapic->ops.apicv_batch_set_tmr != NULL) {
vlapic->ops.apicv_batch_set_tmr(vlapic);
if (vlapic->ops.apicv_batch_set_tmr_fn != NULL) {
vlapic->ops.apicv_batch_set_tmr_fn(vlapic);
}
}
static void
vlapic_apicv_set_tmr(struct acrn_vlapic *vlapic, uint32_t vector, bool level)
{
if (vlapic->ops.apicv_set_tmr != NULL) {
vlapic->ops.apicv_set_tmr(vlapic, vector, level);
if (vlapic->ops.apicv_set_tmr_fn != NULL) {
vlapic->ops.apicv_set_tmr_fn(vlapic, vector, level);
}
}
@ -2097,14 +2097,14 @@ int vlapic_create(struct vcpu *vcpu)
if (is_vapic_supported()) {
if (is_vapic_intr_delivery_supported()) {
vlapic->ops.apicv_set_intr_ready =
vlapic->ops.apicv_set_intr_ready_fn =
apicv_set_intr_ready;
vlapic->ops.apicv_pending_intr =
vlapic->ops.apicv_pending_intr_fn =
apicv_pending_intr;
vlapic->ops.apicv_set_tmr = apicv_set_tmr;
vlapic->ops.apicv_batch_set_tmr =
vlapic->ops.apicv_set_tmr_fn = apicv_set_tmr;
vlapic->ops.apicv_batch_set_tmr_fn =
apicv_batch_set_tmr;
vlapic->pir_desc = (struct vlapic_pir_desc *)(&(vlapic->pir));

View File

@ -98,14 +98,14 @@ struct vlapic_pir_desc {
} __aligned(64);
struct vlapic_ops {
int (*apicv_set_intr_ready)
int (*apicv_set_intr_ready_fn)
(struct acrn_vlapic *vlapic, uint32_t vector, bool level);
int (*apicv_pending_intr)(struct acrn_vlapic *vlapic, uint32_t *vecptr);
void (*apicv_intr_accepted)(struct acrn_vlapic *vlapic, uint32_t vector);
void (*apicv_post_intr)(struct acrn_vlapic *vlapic, int hostcpu);
void (*apicv_set_tmr)(struct acrn_vlapic *vlapic, uint32_t vector, bool level);
void (*apicv_batch_set_tmr)(struct acrn_vlapic *vlapic);
void (*enable_x2apic_mode)(struct acrn_vlapic *vlapic);
int (*apicv_pending_intr_fn)(struct acrn_vlapic *vlapic, uint32_t *vecptr);
void (*apicv_intr_accepted_fn)(struct acrn_vlapic *vlapic, uint32_t vector);
void (*apicv_post_intr_fn)(struct acrn_vlapic *vlapic, int hostcpu);
void (*apicv_set_tmr_fn)(struct acrn_vlapic *vlapic, uint32_t vector, bool level);
void (*apicv_batch_set_tmr_fn)(struct acrn_vlapic *vlapic);
void (*enable_x2apic_mode_fn)(struct acrn_vlapic *vlapic);
};
struct vlapic_timer {