]> git.sur5r.net Git - openocd/commitdiff
arm_adi_v5: deconflict local variables from global symbols
authorPeter A. Bigot <pab@pabigot.com>
Thu, 31 Dec 2015 15:13:58 +0000 (09:13 -0600)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sun, 3 Jan 2016 22:39:01 +0000 (22:39 +0000)
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 <pab@pabigot.com>
Reviewed-on: http://openocd.zylin.com/3184
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
src/target/adi_v5_jtag.c
src/target/adi_v5_swd.c

index 78489aab350f5908bc8c8984605e4ccc2ac00c75..77d7141155bdbd2ebb8760a54816a992de8f91ae 100644 (file)
@@ -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,
index c080964d07a1275840406af7ad0e8a51143542aa..6990a8b9c65e1f225f43769673d8864f747ea8ba 100644 (file)
@@ -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,