|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:16:38
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via b8594026e4bf1aa910944c0b72dd5f1def181f13 (commit)
from e5c103a8d31bddfbda2fd2583c1fcdcc0c818a94 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b8594026e4bf1aa910944c0b72dd5f1def181f13
Author: Antonio Borneo <bor...@gm...>
Date: Thu Sep 8 14:37:55 2022 +0200
src/jtag/drivers/ep93xx: fix GCC 12 warning
New GCC reports 5 warning:
src/jtag/drivers/ep93xx.c: In function 'set_gonk_mode':
src/jtag/drivers/ep93xx.c:123:47: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
123 | devicecfg = *((volatile int *)(syscon + 0x80));
| ^
src/jtag/drivers/ep93xx.c:124:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
124 | *((volatile int *)(syscon + 0xc0)) = 0xaa;
| ^
src/jtag/drivers/ep93xx.c:125:35: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
125 | *((volatile int *)(syscon + 0x80)) = devicecfg | 0x08000000;
| ^
src/jtag/drivers/ep93xx.c: In function 'ep93xx_init':
src/jtag/drivers/ep93xx.c:182:46: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
182 | gpio_data_register = gpio_controller + 0x08;
| ^
src/jtag/drivers/ep93xx.c:183:56: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
183 | gpio_data_direction_register = gpio_controller + 0x18;
| ^
Change pointer type to allow pointer arithmetic.
Change-Id: Idd78a7156bdf99df2624043e924b8e54a0588ace
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/7180
Tested-by: jenkins
Reviewed-by: Tomas Vanek <va...@fb...>
diff --git a/src/jtag/drivers/ep93xx.c b/src/jtag/drivers/ep93xx.c
index e7c993b3b..5130bd422 100644
--- a/src/jtag/drivers/ep93xx.c
+++ b/src/jtag/drivers/ep93xx.c
@@ -24,7 +24,7 @@
static uint8_t output_value;
static int dev_mem_fd;
-static void *gpio_controller;
+static uint8_t *gpio_controller;
static volatile uint8_t *gpio_data_register;
static volatile uint8_t *gpio_data_direction_register;
@@ -110,19 +110,16 @@ static int ep93xx_reset(int trst, int srst)
static int set_gonk_mode(void)
{
- void *syscon;
- uint32_t devicecfg;
-
- syscon = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
+ void *syscon = mmap(NULL, 4096, PROT_READ | PROT_WRITE,
MAP_SHARED, dev_mem_fd, 0x80930000);
if (syscon == MAP_FAILED) {
LOG_ERROR("mmap: %s", strerror(errno));
return ERROR_JTAG_INIT_FAILED;
}
- devicecfg = *((volatile int *)(syscon + 0x80));
- *((volatile int *)(syscon + 0xc0)) = 0xaa;
- *((volatile int *)(syscon + 0x80)) = devicecfg | 0x08000000;
+ uint32_t devicecfg = *((volatile uint32_t *)((uintptr_t)syscon + 0x80));
+ *((volatile uint32_t *)((uintptr_t)syscon + 0xc0)) = 0xaa;
+ *((volatile uint32_t *)((uintptr_t)syscon + 0x80)) = devicecfg | 0x08000000;
munmap(syscon, 4096);
-----------------------------------------------------------------------
Summary of changes:
src/jtag/drivers/ep93xx.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|