]> git.sur5r.net Git - openocd/blobdiff - src/flash/nor/stm32f2x.c
stm32f2x: Fix left shift of negative value
[openocd] / src / flash / nor / stm32f2x.c
index 0e4abb533c6ff672f50a20d752e64be57c957120..65cb212b6d9c8dbbe66bf2e6ba21892868068b1a 100644 (file)
@@ -1321,7 +1321,7 @@ COMMAND_HANDLER(stm32x_handle_unlock_command)
         * this will also force a device unlock if set */
        stm32x_info->option_bytes.RDP = 0xAA;
        if (stm32x_info->has_optcr2_pcrop) {
-               stm32x_info->option_bytes.optcr2_pcrop = OPTCR2_PCROP_RDP | (~1 << bank->num_sectors);
+               stm32x_info->option_bytes.optcr2_pcrop = OPTCR2_PCROP_RDP | (~1U << bank->num_sectors);
        }
 
        if (stm32x_write_options(bank) != ERROR_OK) {