aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnup Patel <apatel@ventanamicro.com>2023-07-11 09:00:31 +0530
committerAnup Patel <anup@brainfault.org>2023-07-19 11:51:59 +0530
commit057eb10b6d523540012e6947d5c9f63e95244e94 (patch)
tree017efec7edb49660748f5938b2bebf72adc9c59c
parentc6a35733b74aeff612398f274ed19a74f81d1f37 (diff)
downloadopensbi-release-1.3.1.zip
opensbi-release-1.3.1.tar.gz
opensbi-release-1.3.1.tar.bz2
lib: utils/gpio: Fix RV32 compile error for designware GPIO driverv1.3.1release-1.3.xrelease-1.3.1
Currently, we see following compile error in the designeware GPIO driver for RV32 systems: lib/utils/gpio/fdt_gpio_designware.c:115:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 115 | chip->dr = (void *)addr + (bank * 0xc); | ^ lib/utils/gpio/fdt_gpio_designware.c:116:21: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 116 | chip->ext = (void *)addr + (bank * 4) + 0x50; We fix the above error using an explicit type-cast to 'unsigned long'. Fixes: 7828eebaaa77 ("gpio/desginware: add Synopsys DesignWare APB GPIO support") Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-by: Xiang W <wxjstz@126.com>
-rw-r--r--lib/utils/gpio/fdt_gpio_designware.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils/gpio/fdt_gpio_designware.c b/lib/utils/gpio/fdt_gpio_designware.c
index 6223d7e..018e2d5 100644
--- a/lib/utils/gpio/fdt_gpio_designware.c
+++ b/lib/utils/gpio/fdt_gpio_designware.c
@@ -112,8 +112,8 @@ static int dw_gpio_init_bank(void *fdt, int nodeoff, u32 phandle,
chip = &dw_gpio_chip_array[dw_gpio_chip_count];
- chip->dr = (void *)addr + (bank * 0xc);
- chip->ext = (void *)addr + (bank * 4) + 0x50;
+ chip->dr = (void *)(uintptr_t)addr + (bank * 0xc);
+ chip->ext = (void *)(uintptr_t)addr + (bank * 4) + 0x50;
chip->chip.driver = &fdt_gpio_designware;
chip->chip.id = phandle;
chip->chip.ngpio = nr_pins;