diff --git a/src/helper/binarybuffer.h b/src/helper/binarybuffer.h index f1da8c4aa..7ac221e47 100644 --- a/src/helper/binarybuffer.h +++ b/src/helper/binarybuffer.h @@ -118,7 +118,7 @@ static inline uint32_t buf_get_u32(const uint8_t *_buffer, uint32_t result = 0; for (unsigned i = first; i < first + num; i++) { if (((buffer[i / 8] >> (i % 8)) & 1) == 1) - result |= 1 << (i - first); + result |= 1U << (i - first); } return result; } diff --git a/src/jtag/core.c b/src/jtag/core.c index f90ae99ba..e57f62db7 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -1007,7 +1007,7 @@ static bool jtag_examine_chain_match_tap(const struct jtag_tap *tap) return true; /* optionally ignore the JTAG version field - bits 28-31 of IDCODE */ - uint32_t mask = tap->ignore_version ? ~(0xf << 28) : ~0; + uint32_t mask = tap->ignore_version ? ~(0xfU << 28) : ~0U; uint32_t idcode = tap->idcode & mask; /* Loop over the expected identification codes and test for a match */ diff --git a/src/target/armv8.c b/src/target/armv8.c index c8cfcae20..e271c1a92 100644 --- a/src/target/armv8.c +++ b/src/target/armv8.c @@ -646,7 +646,7 @@ int armv8_read_mpidr(struct armv8_common *armv8) retval = dpm->instr_read_data_r0(dpm, armv8_opcode(armv8, READ_REG_MPIDR), &mpidr); if (retval != ERROR_OK) goto done; - if (mpidr & 1<<31) { + if (mpidr & 1U<<31) { armv8->multi_processor_system = (mpidr >> 30) & 1; armv8->cluster_id = (mpidr >> 8) & 0xf; armv8->cpu_id = mpidr & 0x3;