Skip to content

Commit

Permalink
x86: remove unnecessary memset and NULL check after alloc_bootmem()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Ingo Molnar committed Apr 26, 2008
1 parent a1a33fa commit b1fceac
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,6 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
#define HPET_RESOURCE_NAME_SIZE 9
hpet_res = alloc_bootmem(sizeof(*hpet_res) + HPET_RESOURCE_NAME_SIZE);

if (!hpet_res)
return 0;

memset(hpet_res, 0, sizeof(*hpet_res));
hpet_res->name = (void *)&hpet_res[1];
hpet_res->flags = IORESOURCE_MEM;
snprintf((char *)hpet_res->name, HPET_RESOURCE_NAME_SIZE, "HPET %u",
Expand Down

0 comments on commit b1fceac

Please sign in to comment.