From 9089854b84166c4ad8b4075b652fbde52e6ba91e Mon Sep 17 00:00:00 2001 From: Ryan Macdonald Date: Tue, 24 Apr 2018 13:58:09 -0700 Subject: [PATCH] Code cleanup from feedback. --- src/target/riscv/riscv-013.c | 11 +++++++---- src/target/riscv/riscv.h | 2 -- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 1f1575c13..21000bc9c 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2824,9 +2824,9 @@ static int get_max_sbaccess(struct target *target) RISCV013_INFO(info); uint32_t sbaccess128 = get_field(info->sbcs, DMI_SBCS_SBACCESS128); - uint32_t sbaccess64 = get_field(info->sbcs, DMI_SBCS_SBACCESS64); - uint32_t sbaccess32 = get_field(info->sbcs, DMI_SBCS_SBACCESS32); - uint32_t sbaccess16 = get_field(info->sbcs, DMI_SBCS_SBACCESS16); + uint32_t sbaccess64 = get_field(info->sbcs, DMI_SBCS_SBACCESS64); + uint32_t sbaccess32 = get_field(info->sbcs, DMI_SBCS_SBACCESS32); + uint32_t sbaccess16 = get_field(info->sbcs, DMI_SBCS_SBACCESS16); uint32_t sbaccess8 = get_field(info->sbcs, DMI_SBCS_SBACCESS8); if (sbaccess128) @@ -2849,13 +2849,16 @@ static uint32_t get_num_sbdata_regs(struct target *target) uint32_t sbaccess128 = get_field(info->sbcs, DMI_SBCS_SBACCESS128); uint32_t sbaccess64 = get_field(info->sbcs, DMI_SBCS_SBACCESS64); + uint32_t sbaccess32 = get_field(info->sbcs, DMI_SBCS_SBACCESS32); if (sbaccess128) return 4; else if (sbaccess64) return 2; - else + else if (sbaccess32) return 1; + else + return 0; } static int riscv013_test_sba_config_reg(struct target *target, diff --git a/src/target/riscv/riscv.h b/src/target/riscv/riscv.h index 323028560..d724538dd 100644 --- a/src/target/riscv/riscv.h +++ b/src/target/riscv/riscv.h @@ -133,8 +133,6 @@ extern uint64_t riscv_scratch_ram_address; extern bool riscv_prefer_sba; -extern bool riscv_run_sbbusyerror_test; - /* Everything needs the RISC-V specific info structure, so here's a nice macro * that provides that. */ static inline riscv_info_t *riscv_info(const struct target *target) __attribute__((unused));