From 604dfa0dcc1c63f6b0959d5a10d838b5ddac4494 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Mon, 18 Sep 2017 14:03:33 -0700 Subject: [PATCH] Try to fix some clang warnings. --- src/target/riscv/debug_defines.h | 2 +- src/target/riscv/riscv-013.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/target/riscv/debug_defines.h b/src/target/riscv/debug_defines.h index c53cec7d5..fa2856020 100644 --- a/src/target/riscv/debug_defines.h +++ b/src/target/riscv/debug_defines.h @@ -926,7 +926,7 @@ */ #define DMI_COMMAND_CMDTYPE_OFFSET 24 #define DMI_COMMAND_CMDTYPE_LENGTH 8 -#define DMI_COMMAND_CMDTYPE (0xff << DMI_COMMAND_CMDTYPE_OFFSET) +#define DMI_COMMAND_CMDTYPE (0xffu << DMI_COMMAND_CMDTYPE_OFFSET) /* * This field is interpreted in a command-specific manner, * described for each abstract command. diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 8809483ff..1b3e39cd9 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -421,7 +421,6 @@ static uint64_t dmi_read(struct target *target, uint16_t address) { select_dmi(target); - uint64_t value; dmi_status_t status; uint16_t address_in; @@ -429,7 +428,7 @@ static uint64_t dmi_read(struct target *target, uint16_t address) // 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. + // 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); @@ -444,14 +443,14 @@ static uint64_t dmi_read(struct target *target, uint16_t address) } if (status != DMI_STATUS_SUCCESS) { - LOG_ERROR("Failed read from 0x%x; value=0x%" PRIx64 ", status=%d", - address, value, status); + LOG_ERROR("Failed read from 0x%x; status=%d", address, 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. + uint64_t value; for (i = 0; i < 256; i++) { status = dmi_scan(target, &address_in, &value, DMI_OP_NOP, address, 0, false);