From 3fd6f798bdff695a05ed107a5a5f488cc4507055 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sun, 3 Jun 2018 18:02:22 +1000 Subject: Fix variable aliasing in test case Signed-off-by: Benjamin Herrenschmidt --- cf-fsi-test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cf-fsi-test.c') diff --git a/cf-fsi-test.c b/cf-fsi-test.c index 41d8b03..e500729 100644 --- a/cf-fsi-test.c +++ b/cf-fsi-test.c @@ -158,7 +158,7 @@ static void *cfmem; #define LAST_ADDR_INVALID 0x1 -uint32_t last_addr; +uint32_t g_last_addr; static void open_mem(void) { @@ -346,12 +346,12 @@ static void msg_push_crc(struct fsi_gpio_msg *msg) static bool check_same_address(int id, uint32_t addr) { /* this will also handle LAST_ADDR_INVALID */ - return last_addr == (((id & 0x3) << 21) | (addr & ~0x3)); + return g_last_addr == (((id & 0x3) << 21) | (addr & ~0x3)); } static bool check_relative_address(int id, uint32_t addr, uint32_t *rel_addrp) { - uint32_t last_addr = last_addr; + uint32_t last_addr = g_last_addr; int32_t rel_addr; if (last_addr == LAST_ADDR_INVALID) @@ -381,9 +381,9 @@ static bool check_relative_address(int id, uint32_t addr, uint32_t *rel_addrp) static void last_address_update(int id, bool valid, uint32_t addr) { if (!valid) - last_addr = LAST_ADDR_INVALID; + g_last_addr = LAST_ADDR_INVALID; else - last_addr = ((id & 0x3) << 21) | (addr & ~0x3); + g_last_addr = ((id & 0x3) << 21) | (addr & ~0x3); } static void build_ar_command(struct fsi_gpio_msg *cmd, uint8_t id, -- cgit v1.2.1