diff options
author | Tim Newsome <tim@sifive.com> | 2017-06-08 12:31:08 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2017-06-08 12:31:08 -0700 |
commit | 6be600318cd23aee6d904d687f8aaaaeda773532 (patch) | |
tree | 2ee649fbeb528a07aa7d574a20a14e87cc84b038 | |
parent | c3b344d1c0b6eb60c0845b27cbdd1ee8d45bcd0e (diff) | |
download | riscv-openocd-6be600318cd23aee6d904d687f8aaaaeda773532.zip riscv-openocd-6be600318cd23aee6d904d687f8aaaaeda773532.tar.gz riscv-openocd-6be600318cd23aee6d904d687f8aaaaeda773532.tar.bz2 |
Fix dmi_read() indentation; remove \n in LOG_ERROR
-rw-r--r-- | src/target/riscv/riscv-013.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index e8be711..eaefaed 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -367,9 +367,9 @@ static uint64_t dmi_read(struct target *target, uint16_t address) unsigned i = 0; - // This first loop ensures that the read request was actually sent - // to the target. Note that if for some reason this stays busy, - // it is actually due to the Previous dmi_read or dmi_write. + // This first loop ensures that the read request was actually sent + // to the target. Note that if for some reason this stays busy, + // it is actually due to the Previous dmi_read or dmi_write. for (i = 0; i < 256; i++) { status = dmi_scan(target, NULL, NULL, DMI_OP_READ, address, 0, false); @@ -378,35 +378,35 @@ static uint64_t dmi_read(struct target *target, uint16_t address) } else if (status == DMI_STATUS_SUCCESS) { break; } else { - LOG_ERROR("failed read from 0x%x, status=%d\n", address, status); + LOG_ERROR("failed read from 0x%x, status=%d", address, status); break; } } - if (status != DMI_STATUS_SUCCESS) { - LOG_ERROR("Failed read from 0x%x; value=0x%" PRIx64 ", status=%d\n", - address, value, status); - abort(); - } + if (status != DMI_STATUS_SUCCESS) { + LOG_ERROR("Failed read from 0x%x; value=0x%" PRIx64 ", status=%d", + address, value, status); + abort(); + } - // This second loop ensures that we got the read - // data back. Note that NOP can result in a 'busy' result as well, but - // that would be noticed on the next DMI access we do. - for (i = 0; i < 256; i++) { - status = dmi_scan(target, &address_in, &value, DMI_OP_NOP, address, 0, - false); - if (status == DMI_STATUS_BUSY) { - increase_dmi_busy_delay(target); - } else if (status == DMI_STATUS_SUCCESS) { - break; - } else { - LOG_ERROR("failed read (NOP) at 0x%x, status=%d\n", address, status); - break; - } - } + // This second loop ensures that we got the read + // data back. Note that NOP can result in a 'busy' result as well, but + // that would be noticed on the next DMI access we do. + for (i = 0; i < 256; i++) { + status = dmi_scan(target, &address_in, &value, DMI_OP_NOP, address, 0, + false); + if (status == DMI_STATUS_BUSY) { + increase_dmi_busy_delay(target); + } else if (status == DMI_STATUS_SUCCESS) { + break; + } else { + LOG_ERROR("failed read (NOP) at 0x%x, status=%d\n", address, status); + break; + } + } if (status != DMI_STATUS_SUCCESS) { - LOG_ERROR("Failed read (NOP) from 0x%x; value=0x%" PRIx64 ", status=%d\n", + LOG_ERROR("Failed read (NOP) from 0x%x; value=0x%" PRIx64 ", status=%d", address, value, status); abort(); } |