From b7a4a430c0d89129d48fbc76b3dc9bb554882022 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 29 Sep 2022 16:16:48 +0200 Subject: [PATCH] soc/amd/common/block/smbus/smbus: use [read,write]8p to avoid typecasts Also add missing device/mmio.h include. Signed-off-by: Felix Held Change-Id: I0f3f7ea36896c8e55c62acd93fe8fc4fb7c74b8a Reviewed-on: https://review.coreboot.org/c/coreboot/+/67982 Reviewed-by: Raul Rangel Reviewed-by: Fred Reitberger Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas --- src/soc/amd/common/block/smbus/smbus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/soc/amd/common/block/smbus/smbus.c b/src/soc/amd/common/block/smbus/smbus.c index d2faf79e74..1a97e523bb 100644 --- a/src/soc/amd/common/block/smbus/smbus.c +++ b/src/soc/amd/common/block/smbus/smbus.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -18,12 +19,12 @@ static u8 controller_read8(const uintptr_t base, const u8 reg) { - return read8((void *)(base + reg)); + return read8p(base + reg); } static void controller_write8(const uintptr_t base, const u8 reg, const u8 val) { - write8((void *)(base + reg), val); + write8p(base + reg, val); } static int smbus_wait_until_ready(uintptr_t mmio)