From 48768db9d6420013ccd88107a67de85fdcd5bbd8 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Thu, 31 Dec 2015 09:13:58 -0600 Subject: [PATCH] arm_adi_v5: deconflict local variables from global symbols BeagleBone debian 7 builds produce: adi_v5_jtag.c: In function 'jtag_ap_q_bankselect': adi_v5_jtag.c:336:11: error: declaration of 'select' shadows a global declaration [-Werror=shadow] Fix this by changing the local variable to 'sel'. Change-Id: I8e29662ac12bc77d38d5064046d59b7364853cd9 Signed-off-by: Peter A. Bigot Reviewed-on: http://openocd.zylin.com/3184 Tested-by: jenkins Reviewed-by: Andreas Fritiofson --- src/target/adi_v5_jtag.c | 8 ++++---- src/target/adi_v5_swd.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/target/adi_v5_jtag.c b/src/target/adi_v5_jtag.c index 78489aab..77d71411 100644 --- a/src/target/adi_v5_jtag.c +++ b/src/target/adi_v5_jtag.c @@ -333,14 +333,14 @@ static int jtag_dp_q_write(struct adiv5_dap *dap, unsigned reg, static int jtag_ap_q_bankselect(struct adiv5_ap *ap, unsigned reg) { struct adiv5_dap *dap = ap->dap; - uint32_t select = ((uint32_t)ap->ap_num << 24) | (reg & 0x000000F0); + uint32_t sel = ((uint32_t)ap->ap_num << 24) | (reg & 0x000000F0); - if (select == dap->select) + if (sel == dap->select) return ERROR_OK; - dap->select = select; + dap->select = sel; - return jtag_dp_q_write(dap, DP_SELECT, select); + return jtag_dp_q_write(dap, DP_SELECT, sel); } static int jtag_ap_q_read(struct adiv5_ap *ap, unsigned reg, diff --git a/src/target/adi_v5_swd.c b/src/target/adi_v5_swd.c index c080964d..6990a8b9 100644 --- a/src/target/adi_v5_swd.c +++ b/src/target/adi_v5_swd.c @@ -162,15 +162,15 @@ static void swd_queue_dp_bankselect(struct adiv5_dap *dap, unsigned reg) return; uint32_t select_dp_bank = (reg & 0x000000F0) >> 4; - uint32_t select = select_dp_bank + uint32_t sel = select_dp_bank | (dap->select & (DP_SELECT_APSEL | DP_SELECT_APBANK)); - if (select == dap->select) + if (sel == dap->select) return; - dap->select = select; + dap->select = sel; - swd_queue_dp_write(dap, DP_SELECT, select); + swd_queue_dp_write(dap, DP_SELECT, sel); } static int swd_queue_dp_read(struct adiv5_dap *dap, unsigned reg, @@ -210,16 +210,16 @@ static int swd_queue_dp_write(struct adiv5_dap *dap, unsigned reg, static void swd_queue_ap_bankselect(struct adiv5_ap *ap, unsigned reg) { struct adiv5_dap *dap = ap->dap; - uint32_t select = ((uint32_t)ap->ap_num << 24) + uint32_t sel = ((uint32_t)ap->ap_num << 24) | (reg & 0x000000F0) | (dap->select & DP_SELECT_DPBANK); - if (select == dap->select) + if (sel == dap->select) return; - dap->select = select; + dap->select = sel; - swd_queue_dp_write(dap, DP_SELECT, select); + swd_queue_dp_write(dap, DP_SELECT, sel); } static int swd_queue_ap_read(struct adiv5_ap *ap, unsigned reg, -- 2.39.5