]> www.infradead.org Git - users/borneoa/openocd-next.git/commitdiff
flash/nor/rp2xxx: drop couple of Java-like const
authorTomas Vanek <vanekt@fbl.cz>
Fri, 16 Aug 2024 20:53:36 +0000 (22:53 +0200)
committerTomas Vanek <vanekt@fbl.cz>
Fri, 25 Apr 2025 09:44:28 +0000 (09:44 +0000)
The compiler knows what variable remains constant during its lifetime
and there is no need to emphasise constantness.

Change-Id: Ib515f96a3c77afea87274f33b8ccac7a71bfb932
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/8459
Tested-by: jenkins
Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
src/flash/nor/rp2xxx.c

index 909d3f14d62a9589d55e8313431a486b4338d2ad..5d0255b61e64a757677c3f75dc95d9cd91eb4623 100644 (file)
@@ -223,7 +223,7 @@ static int rp2040_lookup_rom_symbol(struct target *target, uint16_t tag, uint16_
        }
 
        uint16_t ptr_to_entry;
-       const unsigned int offset_magic_to_table_ptr = flags == RT_FLAG_DATA ? 6 : 4;
+       unsigned int offset_magic_to_table_ptr = flags == RT_FLAG_DATA ? 6 : 4;
        int err = target_read_u16(target, BOOTROM_MAGIC_ADDR + offset_magic_to_table_ptr, &ptr_to_entry);
        if (err != ERROR_OK)
                return err;
@@ -390,8 +390,8 @@ static int rp2xxx_lookup_rom_symbol(struct target *target, uint16_t tag, uint16_
 
 static int rp2xxx_populate_rom_pointer_cache(struct target *target, struct rp2xxx_flash_bank *priv)
 {
-       const uint16_t symtype_func = is_arm(target_to_arm(target))
-                                                                        ? RT_FLAG_FUNC_ARM_SEC : RT_FLAG_FUNC_RISCV;
+       uint16_t symtype_func = is_arm(target_to_arm(target))
+                                                        ? RT_FLAG_FUNC_ARM_SEC : RT_FLAG_FUNC_RISCV;
        int err;
        err = rp2xxx_lookup_rom_symbol(target, FUNC_FLASH_EXIT_XIP,
                                                                   symtype_func, &priv->jump_flash_exit_xip);