mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
hv:fix "missing for discarded return value" for memset
No need to check the return value for memset code like this: int a(void) { return 0; } int b(void){ a(); } fix as follow: int a(void) { return 0; } int b(void){ (void)a(); } Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -135,13 +135,13 @@ int64_t hcall_create_vm(struct vm *vm, uint64_t param)
|
||||
struct acrn_create_vm cv;
|
||||
struct vm_description vm_desc;
|
||||
|
||||
memset((void *)&cv, 0, sizeof(cv));
|
||||
(void)memset((void *)&cv, 0, sizeof(cv));
|
||||
if (copy_from_gpa(vm, &cv, param, sizeof(cv)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&vm_desc, 0, sizeof(vm_desc));
|
||||
(void)memset(&vm_desc, 0, sizeof(vm_desc));
|
||||
vm_desc.sworld_enabled =
|
||||
(!!(cv.vm_flag & (SECURE_WORLD_ENABLED)));
|
||||
memcpy_s(&vm_desc.GUID[0], 16, &cv.GUID[0], 16);
|
||||
@@ -281,7 +281,7 @@ int64_t hcall_inject_msi(struct vm *vm, uint64_t vmid, uint64_t param)
|
||||
if (target_vm == NULL)
|
||||
return -1;
|
||||
|
||||
memset((void *)&msi, 0, sizeof(msi));
|
||||
(void)memset((void *)&msi, 0, sizeof(msi));
|
||||
if (copy_from_gpa(vm, &msi, param, sizeof(msi)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
return -1;
|
||||
@@ -301,7 +301,7 @@ int64_t hcall_set_ioreq_buffer(struct vm *vm, uint64_t vmid, uint64_t param)
|
||||
if (target_vm == NULL)
|
||||
return -1;
|
||||
|
||||
memset((void *)&iobuf, 0, sizeof(iobuf));
|
||||
(void)memset((void *)&iobuf, 0, sizeof(iobuf));
|
||||
|
||||
if (copy_from_gpa(vm, &iobuf, param, sizeof(iobuf)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
@@ -449,7 +449,7 @@ int64_t hcall_set_vm_memmap(struct vm *vm, uint64_t vmid, uint64_t param)
|
||||
if ((vm == NULL) || (target_vm == NULL))
|
||||
return -1;
|
||||
|
||||
memset((void *)&memmap, 0, sizeof(memmap));
|
||||
(void)memset((void *)&memmap, 0, sizeof(memmap));
|
||||
|
||||
if (copy_from_gpa(vm, &memmap, param, sizeof(memmap)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
@@ -482,7 +482,7 @@ int64_t hcall_set_vm_memmaps(struct vm *vm, uint64_t param)
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset((void *)&set_memmaps, 0, sizeof(set_memmaps));
|
||||
(void)memset((void *)&set_memmaps, 0, sizeof(set_memmaps));
|
||||
|
||||
if (copy_from_gpa(vm, &set_memmaps, param, sizeof(set_memmaps)) != 0) {
|
||||
pr_err("%s: Unable copy param from vm\n", __func__);
|
||||
@@ -521,7 +521,7 @@ int64_t hcall_remap_pci_msix(struct vm *vm, uint64_t vmid, uint64_t param)
|
||||
if (target_vm == NULL)
|
||||
return -1;
|
||||
|
||||
memset((void *)&remap, 0, sizeof(remap));
|
||||
(void)memset((void *)&remap, 0, sizeof(remap));
|
||||
|
||||
if (copy_from_gpa(vm, &remap, param, sizeof(remap)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
@@ -560,7 +560,7 @@ int64_t hcall_gpa_to_hpa(struct vm *vm, uint64_t vmid, uint64_t param)
|
||||
if (target_vm == NULL)
|
||||
return -1;
|
||||
|
||||
memset((void *)&v_gpa2hpa, 0, sizeof(v_gpa2hpa));
|
||||
(void)memset((void *)&v_gpa2hpa, 0, sizeof(v_gpa2hpa));
|
||||
|
||||
if (copy_from_gpa(vm, &v_gpa2hpa, param, sizeof(v_gpa2hpa)) != 0) {
|
||||
pr_err("HCALL gpa2hpa: Unable copy param from vm\n");
|
||||
@@ -640,7 +640,7 @@ int64_t hcall_set_ptdev_intr_info(struct vm *vm, uint64_t vmid, uint64_t param)
|
||||
if (target_vm == NULL)
|
||||
return -1;
|
||||
|
||||
memset((void *)&irq, 0, sizeof(irq));
|
||||
(void)memset((void *)&irq, 0, sizeof(irq));
|
||||
|
||||
if (copy_from_gpa(vm, &irq, param, sizeof(irq)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
@@ -670,7 +670,7 @@ hcall_reset_ptdev_intr_info(struct vm *vm, uint64_t vmid, uint64_t param)
|
||||
if (target_vm == NULL)
|
||||
return -1;
|
||||
|
||||
memset((void *)&irq, 0, sizeof(irq));
|
||||
(void)memset((void *)&irq, 0, sizeof(irq));
|
||||
|
||||
if (copy_from_gpa(vm, &irq, param, sizeof(irq)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
@@ -694,7 +694,7 @@ int64_t hcall_setup_sbuf(struct vm *vm, uint64_t param)
|
||||
struct sbuf_setup_param ssp;
|
||||
uint64_t *hva;
|
||||
|
||||
memset((void *)&ssp, 0, sizeof(ssp));
|
||||
(void)memset((void *)&ssp, 0, sizeof(ssp));
|
||||
|
||||
if (copy_from_gpa(vm, &ssp, param, sizeof(ssp)) != 0) {
|
||||
pr_err("%s: Unable copy param to vm\n", __func__);
|
||||
|
@@ -35,7 +35,7 @@ static uint64_t create_zero_page(struct vm *vm)
|
||||
zeropage = (struct zero_page *)((char *)hva + MEM_4K);
|
||||
|
||||
/* clear the zeropage */
|
||||
memset(zeropage, 0, MEM_2K);
|
||||
(void)memset(zeropage, 0, MEM_2K);
|
||||
|
||||
/* copy part of the header into the zero page */
|
||||
hva = GPA2HVA(vm, (uint64_t)vm->sw.kernel_info.kernel_load_addr);
|
||||
@@ -81,7 +81,7 @@ int load_guest(struct vm *vm, struct vcpu *vcpu)
|
||||
lowmem_gpa_top = *(uint64_t *)hva;
|
||||
|
||||
/* hardcode vcpu entry addr(kernel entry) & rsi (zeropage)*/
|
||||
memset(cur_context->guest_cpu_regs.longs,
|
||||
(void)memset(cur_context->guest_cpu_regs.longs,
|
||||
0, sizeof(uint64_t)*NUM_GPRS);
|
||||
|
||||
hva = GPA2HVA(vm, lowmem_gpa_top -
|
||||
@@ -149,7 +149,7 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
|
||||
/* Documentation states: ebx=0, edi=0, ebp=0, esi=ptr to
|
||||
* zeropage
|
||||
*/
|
||||
memset(cur_context->guest_cpu_regs.longs,
|
||||
(void)memset(cur_context->guest_cpu_regs.longs,
|
||||
0, sizeof(uint64_t) * NUM_GPRS);
|
||||
|
||||
/* Get host-physical address for guest bootargs */
|
||||
|
Reference in New Issue
Block a user