summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2022-05-16 15:56:36 +0200
committerFelix Held <felix-coreboot@felixheld.de>2022-05-18 20:39:18 +0000
commitecff5215177eee0b01b608f5db6532d3b90222b6 (patch)
tree709b146cc6e5a03cb07a2010cfbeee567e567e6c /src
parentee449451878ad41caa8724d6435f32c1af474d7b (diff)
soc/intel/ehl/tsn_gbe.c: Reduce `void *` casts
Remove two redundant `void *` casts in `clrsetbits32()` calls. In addition, preemptively retype the `io_mem_base` variable in order to avoid having to add casts in future commits. Change-Id: Iae9c8189a6f8cd29181c52c2241789c6d392d77b Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64398 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/elkhartlake/tsn_gbe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/intel/elkhartlake/tsn_gbe.c b/src/soc/intel/elkhartlake/tsn_gbe.c
index 4a340b2f6d..4d8944a6b4 100644
--- a/src/soc/intel/elkhartlake/tsn_gbe.c
+++ b/src/soc/intel/elkhartlake/tsn_gbe.c
@@ -20,9 +20,9 @@ static void program_mac_address(struct device *dev, void *base)
printk(BIOS_DEBUG, "TSN GbE: Programming MAC Address...\n");
/* Write the upper 16 bits of the first 6-byte MAC address */
- clrsetbits32((void *)(base + TSN_MAC_ADD0_HIGH), 0xffff, ((mac[5] << 8) | mac[4]));
+ clrsetbits32(base + TSN_MAC_ADD0_HIGH, 0xffff, ((mac[5] << 8) | mac[4]));
/* Write the lower 32 bits of the first 6-byte MAC address */
- clrsetbits32((void *)(base + TSN_MAC_ADD0_LOW), 0xffffffff,
+ clrsetbits32(base + TSN_MAC_ADD0_LOW, 0xffffffff,
(mac[3] << 24) | (mac[2] << 16) | (mac[1] << 8) | mac[0]);
}
@@ -30,10 +30,10 @@ static void gbe_tsn_init(struct device *dev)
{
/* Get the base address of the I/O registers in memory space */
struct resource *gbe_tsn_res = find_resource(dev, PCI_BASE_ADDRESS_0);
- uintptr_t io_mem_base = gbe_tsn_res->base;
+ void *io_mem_base = (void *)(uintptr_t)gbe_tsn_res->base;
/* Program MAC address */
- program_mac_address(dev, (void *)io_mem_base);
+ program_mac_address(dev, io_mem_base);
}
static struct device_operations gbe_tsn_ops = {