fix parted of "missing for discarded return value"

MISRA C required that return value should be used, missing for it should
add "(void)" prefix before the function call.
Some function can be declared without return value to avoid this problem.

Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Huihuang Shi
2018-06-19 10:15:48 +08:00
committed by lijinxia
parent b8bdf171eb
commit 977c4b20b5
24 changed files with 46 additions and 63 deletions

View File

@@ -967,7 +967,7 @@ static void get_entry_info(struct ptdev_remapping_info *entry, char *type,
}
}
int get_ptdev_info(char *str, int str_max)
void get_ptdev_info(char *str, int str_max)
{
struct ptdev_remapping_info *entry;
int len, size = str_max;
@@ -1014,5 +1014,4 @@ int get_ptdev_info(char *str, int str_max)
spinlock_release(&ptdev_lock);
snprintf(str, size, "\r\n");
return 0;
}

View File

@@ -237,7 +237,7 @@ int shutdown_vcpu(__unused struct vcpu *vcpu)
return 0;
}
int destroy_vcpu(struct vcpu *vcpu)
void destroy_vcpu(struct vcpu *vcpu)
{
ASSERT(vcpu != NULL, "Incorrect arguments");
@@ -254,8 +254,6 @@ int destroy_vcpu(struct vcpu *vcpu)
per_cpu(ever_run_vcpu, vcpu->pcpu_id) = NULL;
free_pcpu(vcpu->pcpu_id);
free(vcpu);
return 0;
}
/* NOTE:

View File

@@ -606,7 +606,7 @@ bool vioapic_get_rte(struct vm *vm, int pin, void *rte)
return false;
}
int get_vioapic_info(char *str, int str_max, int vmid)
void get_vioapic_info(char *str, int str_max, int vmid)
{
int pin, len, size = str_max, vector, delmode;
uint64_t rte;
@@ -650,5 +650,4 @@ int get_vioapic_info(char *str, int str_max, int vmid)
}
END:
snprintf(str, size, "\r\n");
return 0;
}

View File

@@ -260,20 +260,18 @@ int start_vm(struct vm *vm)
* DM only pause vm for shutdown/reboot. If we need to
* extend the pause vm for DM, this API should be extended.
*/
int pause_vm(struct vm *vm)
void pause_vm(struct vm *vm)
{
int i;
struct vcpu *vcpu = NULL;
if (vm->state == VM_PAUSED)
return 0;
return;
vm->state = VM_PAUSED;
foreach_vcpu(i, vm, vcpu)
pause_vcpu(vcpu, VCPU_ZOMBIE);
return 0;
}
int vm_resume(struct vm *vm)

View File

@@ -94,7 +94,7 @@ static bool vcpu_pending_request(struct vcpu *vcpu)
return vcpu->arch_vcpu.pending_req != 0;
}
int vcpu_make_request(struct vcpu *vcpu, int eventid)
void vcpu_make_request(struct vcpu *vcpu, int eventid)
{
bitmap_set(eventid, &vcpu->arch_vcpu.pending_req);
/*
@@ -108,8 +108,6 @@ int vcpu_make_request(struct vcpu *vcpu, int eventid)
*/
if ((int)get_cpu_id() != vcpu->pcpu_id)
send_single_ipi(vcpu->pcpu_id, VECTOR_NOTIFY_VCPU);
return 0;
}
static int vcpu_do_pending_event(struct vcpu *vcpu)
@@ -223,7 +221,8 @@ int vcpu_queue_exception(struct vcpu *vcpu, uint32_t vector,
if (prev_vector == IDT_DF &&
new_class != EXCEPTION_CLASS_BENIGN) {
/* triple fault happen - shutdwon mode */
return vcpu_make_request(vcpu, ACRN_REQUEST_TRP_FAULT);
vcpu_make_request(vcpu, ACRN_REQUEST_TRP_FAULT);
return 0;
} else if ((prev_class == EXCEPTION_CLASS_CONT &&
new_class == EXCEPTION_CLASS_CONT) ||
(prev_class == EXCEPTION_CLASS_PF &&
@@ -281,20 +280,21 @@ static int vcpu_inject_lo_exception(struct vcpu *vcpu)
return 0;
}
int vcpu_inject_extint(struct vcpu *vcpu)
void vcpu_inject_extint(struct vcpu *vcpu)
{
return vcpu_make_request(vcpu, ACRN_REQUEST_EXTINT);
vcpu_make_request(vcpu, ACRN_REQUEST_EXTINT);
}
int vcpu_inject_nmi(struct vcpu *vcpu)
void vcpu_inject_nmi(struct vcpu *vcpu)
{
return vcpu_make_request(vcpu, ACRN_REQUEST_NMI);
vcpu_make_request(vcpu, ACRN_REQUEST_NMI);
}
int vcpu_inject_gp(struct vcpu *vcpu, uint32_t err_code)
{
vcpu_queue_exception(vcpu, IDT_GP, err_code);
return vcpu_make_request(vcpu, ACRN_REQUEST_EXCP);
vcpu_make_request(vcpu, ACRN_REQUEST_EXCP);
return 0;
}
int vcpu_inject_pf(struct vcpu *vcpu, uint64_t addr, uint32_t err_code)
@@ -304,7 +304,8 @@ int vcpu_inject_pf(struct vcpu *vcpu, uint64_t addr, uint32_t err_code)
cur_context->cr2 = addr;
vcpu_queue_exception(vcpu, IDT_PF, err_code);
return vcpu_make_request(vcpu, ACRN_REQUEST_EXCP);
vcpu_make_request(vcpu, ACRN_REQUEST_EXCP);
return 0;
}
int interrupt_window_vmexit_handler(struct vcpu *vcpu)

View File

@@ -316,10 +316,9 @@ void resume_lapic(void)
restore_lapic(&saved_lapic_regs);
}
int send_lapic_eoi(void)
void send_lapic_eoi(void)
{
write_lapic_reg32(LAPIC_EOI_REGISTER, 0);
return 0;
}
static void wait_for_delivery(void)

View File

@@ -686,7 +686,7 @@ pri_register_handler(uint32_t irq,
return common_register_handler(irq, &info);
}
int get_cpu_interrupt_info(char *str, int str_max)
void get_cpu_interrupt_info(char *str, int str_max)
{
int pcpu_id;
uint32_t irq, vector, len, size = str_max;
@@ -727,5 +727,4 @@ int get_cpu_interrupt_info(char *str, int str_max)
}
}
snprintf(str, size, "\r\n");
return 0;
}

View File

@@ -171,7 +171,7 @@ void timer_cleanup(void)
per_cpu(timer_node, pcpu_id) = NULL;
}
int timer_softirq(int pcpu_id)
void timer_softirq(int pcpu_id)
{
struct per_cpu_timers *cpu_timer;
struct timer *timer;
@@ -207,7 +207,6 @@ int timer_softirq(int pcpu_id)
/* update nearest timer */
update_physical_timer(cpu_timer);
return 0;
}
void check_tsc(void)

View File

@@ -649,20 +649,18 @@ static void dmar_set_root_table(struct dmar_drhd_rt *dmar_uint)
IOMMU_UNLOCK(dmar_uint);
}
static int dmar_fault_event_mask(struct dmar_drhd_rt *dmar_uint)
static void dmar_fault_event_mask(struct dmar_drhd_rt *dmar_uint)
{
IOMMU_LOCK(dmar_uint);
iommu_write32(dmar_uint, DMAR_FECTL_REG, DMA_FECTL_IM);
IOMMU_UNLOCK(dmar_uint);
return 0;
}
static int dmar_fault_event_unmask(struct dmar_drhd_rt *dmar_uint)
static void dmar_fault_event_unmask(struct dmar_drhd_rt *dmar_uint)
{
IOMMU_LOCK(dmar_uint);
iommu_write32(dmar_uint, DMAR_FECTL_REG, 0);
IOMMU_UNLOCK(dmar_uint);
return 0;
}
static void dmar_fault_msi_write(struct dmar_drhd_rt *dmar_uint,