From 7f8c737fe97487704f533ac48c7a03233d956869 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Wed, 23 Feb 2022 17:37:27 +0100 Subject: acpi/acpi: use read32p instead of pointer dereferencing Using read32p to get the contents of the first 4 bytes of the HPET MMIO region instead of a pointer dereference should clarify what's done in that piece of code. Signed-off-by: Felix Held Change-Id: Iecf5452c63635666d7d6b17e07a1bc6aa52e72fa Reviewed-on: https://review.coreboot.org/c/coreboot/+/62297 Reviewed-by: Angel Pons Reviewed-by: Lance Zhao Tested-by: build bot (Jenkins) --- src/acpi/acpi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/acpi') diff --git a/src/acpi/acpi.c b/src/acpi/acpi.c index 456fd332dc..26552982e2 100644 --- a/src/acpi/acpi.c +++ b/src/acpi/acpi.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -850,7 +851,7 @@ void acpi_create_hpet(acpi_hpet_t *hpet) addr->addrl = CONFIG_HPET_ADDRESS & 0xffffffff; addr->addrh = ((unsigned long long)CONFIG_HPET_ADDRESS) >> 32; - hpet->id = *(unsigned int *)CONFIG_HPET_ADDRESS; + hpet->id = read32p(CONFIG_HPET_ADDRESS); hpet->number = 0; hpet->min_tick = CONFIG_HPET_MIN_TICKS; -- cgit v1.2.3