diff --git a/src/flash/nor/str7x.c b/src/flash/nor/str7x.c index 0177095cb..e84721333 100644 --- a/src/flash/nor/str7x.c +++ b/src/flash/nor/str7x.c @@ -736,7 +736,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command) target_read_u32(target, str7x_get_flash_adr(bank, FLASH_NVAPR1), ®); protection_regs = ~(reg >> 16); - while (((protection_regs) != 0) && (protection_level < 16)) { + while ((protection_regs != 0) && (protection_level < 16)) { protection_regs >>= 1; protection_level++; } @@ -753,7 +753,7 @@ COMMAND_HANDLER(str7x_handle_disable_jtag_command) target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), flash_cmd); target_write_u32(target, str7x_get_flash_adr(bank, FLASH_AR), 0x4010DFBC); target_write_u32(target, str7x_get_flash_adr(bank, FLASH_DR0), - ~(1 << (15 + protection_level))); + ~(1U << (15 + protection_level))); flash_cmd = FLASH_SPR | FLASH_WMS; target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), flash_cmd); }