From d1c9d94174189f6b60e63f18ceeb4d9d5c61075c Mon Sep 17 00:00:00 2001 From: dragonmux Date: Fri, 21 Jan 2022 21:11:22 -0500 Subject: [PATCH] jtag_scan: Remove the now redundant IDCode parameter from the handlers --- src/platforms/hosted/stlinkv2.c | 2 +- src/target/adiv5.h | 2 +- src/target/adiv5_jtagdp.c | 3 +-- src/target/jtag_devs.h | 2 +- src/target/jtag_scan.c | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/platforms/hosted/stlinkv2.c b/src/platforms/hosted/stlinkv2.c index 1ecae9f..f87ffc8 100644 --- a/src/platforms/hosted/stlinkv2.c +++ b/src/platforms/hosted/stlinkv2.c @@ -1010,7 +1010,7 @@ int jtag_scan_stlinkv2(bmp_info_t *info, const uint8_t *irlens) if((jtag_devs[i].jd_idcode & dev_descr[j].idmask) == dev_descr[j].idcode) { if(dev_descr[j].handler) - dev_descr[j].handler(i, dev_descr[j].idcode); + dev_descr[j].handler(i); break; } diff --git a/src/target/adiv5.h b/src/target/adiv5.h index bcaa192..189869b 100644 --- a/src/target/adiv5.h +++ b/src/target/adiv5.h @@ -285,7 +285,7 @@ void adiv5_ap_ref(ADIv5_AP_t *ap); void adiv5_ap_unref(ADIv5_AP_t *ap); void platform_add_jtag_dev(const int dev_index, const jtag_dev_t *jtag_dev); -void adiv5_jtag_dp_handler(uint8_t jd_index, uint32_t j_idcode); +void adiv5_jtag_dp_handler(uint8_t jd_index); int platform_jtag_dp_init(ADIv5_DP_t *dp); int swdptap_init(ADIv5_DP_t *dp); diff --git a/src/target/adiv5_jtagdp.c b/src/target/adiv5_jtagdp.c index e4f3030..cf8591b 100644 --- a/src/target/adiv5_jtagdp.c +++ b/src/target/adiv5_jtagdp.c @@ -39,14 +39,13 @@ static uint32_t adiv5_jtagdp_error(ADIv5_DP_t *dp); -void adiv5_jtag_dp_handler(uint8_t jd_index, uint32_t j_idcode) +void adiv5_jtag_dp_handler(uint8_t jd_index) { ADIv5_DP_t *dp = (void*)calloc(1, sizeof(*dp)); if (!dp) { /* calloc failed: heap exhaustion */ DEBUG_WARN("calloc: failed in %s\n", __func__); return; } - (void)j_idcode; dp->dp_jd_index = jd_index; dp->idcode = jtag_devs[jd_index].jd_idcode; diff --git a/src/target/jtag_devs.h b/src/target/jtag_devs.h index 8c2c0b5..08adf04 100644 --- a/src/target/jtag_devs.h +++ b/src/target/jtag_devs.h @@ -22,7 +22,7 @@ typedef const struct jtag_dev_descr_s { const uint32_t idcode; const uint32_t idmask; const char * const descr; - void (*const handler)(uint8_t jd_index, uint32_t j_idcode); + void (*const handler)(uint8_t jd_index); } jtag_dev_descr_t; extern jtag_dev_descr_t dev_descr[]; diff --git a/src/target/jtag_scan.c b/src/target/jtag_scan.c index 761f5ff..c547ef6 100644 --- a/src/target/jtag_scan.c +++ b/src/target/jtag_scan.c @@ -215,7 +215,7 @@ int jtag_scan(const uint8_t *irlens) jtag_devs[i].jd_descr = dev_descr[j].descr; /* Call handler to initialise/probe device further */ if(dev_descr[j].handler) - dev_descr[j].handler(i, dev_descr[i].idcode); + dev_descr[j].handler(i); break; }