mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 17:58:30 +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:
@@ -83,14 +83,14 @@ construct_mbi(struct multiboot_info **mbi_ret, struct efi_ctx *efi_ctx)
|
||||
goto out;
|
||||
|
||||
mbi = (struct multiboot_info *)(UINTN)addr;
|
||||
memset((void *)mbi, 0x0, sizeof(*mbi));
|
||||
(void)memset((void *)mbi, 0x0, sizeof(*mbi));
|
||||
|
||||
/* allocate mmap[] */
|
||||
err = emalloc(sizeof(struct multiboot_mmap)*128, 8, &addr);
|
||||
if (err != EFI_SUCCESS)
|
||||
goto out;
|
||||
mmap = (struct multiboot_mmap *)(UINTN)addr;
|
||||
memset((void *)mmap, 0x0, sizeof(*mmap)*128);
|
||||
(void)memset((void *)mmap, 0x0, sizeof(*mmap)*128);
|
||||
|
||||
/* We're just interested in the map's size for now */
|
||||
map_size = 0;
|
||||
|
@@ -354,7 +354,7 @@ void *calloc(UINTN nmemb, UINTN size)
|
||||
|
||||
buffer = malloc(bytes);
|
||||
if (buffer)
|
||||
memset(buffer, 0, bytes);
|
||||
(void)memset(buffer, 0, bytes);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user