From 3444b81f6b0e83eacb391e10b41f9a7b60e66f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= Date: Sun, 29 Jan 2023 23:49:06 +0100 Subject: libpci: mmio-ports: Fix support for 64-bit non-LLP64 systems On 64-bit non-LLP64 systems is type long 64-bit. On 32-bit and 64-bit LLP64 systems is type long only 32-bit. But readl() and writel() functions works with 32-bit PCI word. Fix it for non-LLP64 systems by using type u32. --- lib/mmio-ports.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/mmio-ports.c b/lib/mmio-ports.c index c8e5f8c..a9e23c3 100644 --- a/lib/mmio-ports.c +++ b/lib/mmio-ports.c @@ -124,9 +124,9 @@ writew(unsigned short value, volatile void *addr) } static void -writel(unsigned long value, volatile void *addr) +writel(u32 value, volatile void *addr) { - *(volatile unsigned long *)addr = value; + *(volatile u32 *)addr = value; } static unsigned char @@ -141,10 +141,10 @@ readw(volatile void *addr) return *(volatile unsigned short *)addr; } -static unsigned long +static u32 readl(volatile void *addr) { - return *(volatile unsigned long *)addr; + return *(volatile u32 *)addr; } static int -- cgit v1.2.1