diff options
author | Marc Schink <dev@zapb.de> | 2023-12-06 18:08:50 +0100 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2023-12-16 07:51:56 +0000 |
commit | f018cd7d90243ab29c3cad25caf6932d1f1b83ea (patch) | |
tree | 9bda1bfb1d971c51b83c1e3e9130abc0316939a2 | |
parent | d3d287bf676573fcbb6d6df3becfb4b3392df3db (diff) | |
download | riscv-openocd-f018cd7d90243ab29c3cad25caf6932d1f1b83ea.zip riscv-openocd-f018cd7d90243ab29c3cad25caf6932d1f1b83ea.tar.gz riscv-openocd-f018cd7d90243ab29c3cad25caf6932d1f1b83ea.tar.bz2 |
jtag: Rename 'hasidcode' to 'has_idcode'
While at it, fix some coding style issues.
Change-Id: I8196045f46ce043ed0d28cb95470132b3a7de1bb
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8039
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r-- | src/flash/nor/xcf.c | 2 | ||||
-rw-r--r-- | src/jtag/core.c | 6 | ||||
-rw-r--r-- | src/jtag/hla/hla_interface.c | 2 | ||||
-rw-r--r-- | src/jtag/jtag.h | 2 | ||||
-rw-r--r-- | src/pld/intel.c | 2 | ||||
-rw-r--r-- | src/pld/lattice.c | 4 | ||||
-rw-r--r-- | src/target/dsp563xx.c | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/src/flash/nor/xcf.c b/src/flash/nor/xcf.c index 2870725..c253b22 100644 --- a/src/flash/nor/xcf.c +++ b/src/flash/nor/xcf.c @@ -597,7 +597,7 @@ static int xcf_probe(struct flash_bank *bank) } /* check idcode and alloc memory for sector table */ - if (!bank->target->tap->hasidcode) + if (!bank->target->tap->has_idcode) return ERROR_FLASH_OPERATION_FAILED; /* guess number of blocks using chip ID */ diff --git a/src/jtag/core.c b/src/jtag/core.c index 5748011..665a932 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -1177,7 +1177,7 @@ static bool jtag_examine_chain_end(uint8_t *idcodes, unsigned count, unsigned ma static bool jtag_examine_chain_match_tap(const struct jtag_tap *tap) { - if (tap->expected_ids_cnt == 0 || !tap->hasidcode) + if (tap->expected_ids_cnt == 0 || !tap->has_idcode) return true; /* optionally ignore the JTAG version field - bits 28-31 of IDCODE */ @@ -1283,13 +1283,13 @@ static int jtag_examine_chain(void) /* Zero for LSB indicates a device in bypass */ LOG_INFO("TAP %s does not have valid IDCODE (idcode=0x%" PRIx32 ")", tap->dotted_name, idcode); - tap->hasidcode = false; + tap->has_idcode = false; tap->idcode = 0; bit_count += 1; } else { /* Friendly devices support IDCODE */ - tap->hasidcode = true; + tap->has_idcode = true; tap->idcode = idcode; jtag_examine_chain_display(LOG_LVL_INFO, "tap/device found", tap->dotted_name, idcode); diff --git a/src/jtag/hla/hla_interface.c b/src/jtag/hla/hla_interface.c index f4bfeb1..9c8d0fa 100644 --- a/src/jtag/hla/hla_interface.c +++ b/src/jtag/hla/hla_interface.c @@ -100,7 +100,7 @@ int hl_interface_init_target(struct target *t) } t->tap->priv = &hl_if; - t->tap->hasidcode = 1; + t->tap->has_idcode = true; return ERROR_OK; } diff --git a/src/jtag/jtag.h b/src/jtag/jtag.h index 04d1b4a..7353104 100644 --- a/src/jtag/jtag.h +++ b/src/jtag/jtag.h @@ -115,7 +115,7 @@ struct jtag_tap { uint32_t idcode; /**< device identification code */ /** not all devices have idcode, * we'll discover this during chain examination */ - bool hasidcode; + bool has_idcode; /** Array of expected identification codes */ uint32_t *expected_ids; diff --git a/src/pld/intel.c b/src/pld/intel.c index 8422c94..a39e16c 100644 --- a/src/pld/intel.c +++ b/src/pld/intel.c @@ -157,7 +157,7 @@ static int intel_check_for_unique_id(struct intel_pld_device *intel_info) static int intel_check_config(struct intel_pld_device *intel_info) { - if (!intel_info->tap->hasidcode) { + if (!intel_info->tap->has_idcode) { LOG_ERROR("no IDCODE"); return ERROR_FAIL; } diff --git a/src/pld/lattice.c b/src/pld/lattice.c index cd72d3c..2997cdc 100644 --- a/src/pld/lattice.c +++ b/src/pld/lattice.c @@ -81,7 +81,7 @@ static int lattice_check_device_family(struct lattice_pld_device *lattice_device if (lattice_device->family != LATTICE_UNKNOWN && lattice_device->preload_length != 0) return ERROR_OK; - if (!lattice_device->tap || !lattice_device->tap->hasidcode) + if (!lattice_device->tap || !lattice_device->tap->has_idcode) return ERROR_FAIL; for (size_t i = 0; i < ARRAY_SIZE(lattice_devices); ++i) { @@ -280,7 +280,7 @@ static int lattice_load_command(struct pld_device *pld_device, const char *filen return ERROR_FAIL; struct jtag_tap *tap = lattice_device->tap; - if (!tap || !tap->hasidcode) + if (!tap || !tap->has_idcode) return ERROR_FAIL; int retval = lattice_check_device_family(lattice_device); diff --git a/src/target/dsp563xx.c b/src/target/dsp563xx.c index 5789201..80cca1e 100644 --- a/src/target/dsp563xx.c +++ b/src/target/dsp563xx.c @@ -912,7 +912,7 @@ static int dsp563xx_examine(struct target *target) { uint32_t chip; - if (target->tap->hasidcode == false) { + if (!target->tap->has_idcode) { LOG_ERROR("no IDCODE present on device"); return ERROR_COMMAND_SYNTAX_ERROR; } |