diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index 0ebfcc467..f22509243 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -2908,7 +2908,7 @@ static int riscv013_test_sba_config_reg(struct target *target, prev_addr = curr_addr; read_sbcs_nonbusy(target, &sbcs); dmi_read(target, &curr_addr, DMI_SBADDRESS0); - if ((curr_addr - prev_addr != (1 << (uint32_t)sbaccess)) && i != 0) { + if ((curr_addr - prev_addr != (uint32_t)(1 << sbaccess)) && i != 0) { LOG_ERROR("System Bus Access Test 2: Error with address autoincrement, sbaccess = %x", sbaccess); test_passed = false; } @@ -2928,7 +2928,7 @@ static int riscv013_test_sba_config_reg(struct target *target, prev_addr = curr_addr; read_sbcs_nonbusy(target, &sbcs); dmi_read(target, &curr_addr, DMI_SBADDRESS0); - if ((curr_addr - prev_addr != (1 << (uint32_t)sbaccess)) && i != 0) { + if ((curr_addr - prev_addr != (uint32_t)(1 << sbaccess)) && i != 0) { LOG_ERROR("System Bus Access Test 2: Error with address autoincrement, sbaccess = %x", sbaccess); test_passed = false; }