Skip to content

Commit b1fceac

Browse files
mitaIngo Molnar
authored andcommitted
x86: remove unnecessary memset and NULL check after alloc_bootmem()
memset and NULL check after alloc_bootmem() are unnecessary. Because it returns zeroed memory and it never return NULL. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent a1a33fa commit b1fceac

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

‎arch/x86/kernel/acpi/boot.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -697,10 +697,6 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
697697
#define HPET_RESOURCE_NAME_SIZE 9
698698
hpet_res = alloc_bootmem(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE);
699699

700-
if (!hpet_res)
701-
return 0;
702-
703-
memset(hpet_res, 0, sizeof(*hpet_res));
704700
hpet_res->name = (void *)&hpet_res[1];
705701
hpet_res->flags = IORESOURCE_MEM;
706702
snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE, "HPET %u",

0 commit comments

Comments
 (0)