aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/at91sam4.c
diff options
context:
space:
mode:
authorChristopher Head <chead@zaber.com>2018-12-13 11:53:59 -0800
committerMatthias Welwarsky <matthias@welwarsky.de>2019-03-27 08:57:14 +0000
commita7479fa89def9d8b1854d629dfdaa0ba17132617 (patch)
tree1f9f1f957ad93342d2fa46f854419bb3a9f2697d /src/flash/nor/at91sam4.c
parent84a2cab596a0621fab3424c72b43280ccdc240c2 (diff)
downloadriscv-openocd-a7479fa89def9d8b1854d629dfdaa0ba17132617.zip
riscv-openocd-a7479fa89def9d8b1854d629dfdaa0ba17132617.tar.gz
riscv-openocd-a7479fa89def9d8b1854d629dfdaa0ba17132617.tar.bz2
Constify struct flash_driver instances
Instances of struct flash_driver are never written to at runtime. For a small amount of memory saving and also robustness (fewer things for stray pointer writes to hit), mark them const. Change-Id: Iadbbbc2fac0976d892699200000c5f02856729f3 Signed-off-by: Christopher Head <chead@zaber.com> Reviewed-on: http://openocd.zylin.com/4803 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
Diffstat (limited to 'src/flash/nor/at91sam4.c')
-rw-r--r--src/flash/nor/at91sam4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c
index d4d48a7..446f798 100644
--- a/src/flash/nor/at91sam4.c
+++ b/src/flash/nor/at91sam4.c
@@ -103,7 +103,7 @@
#define offset_EFC_FSR 8
#define offset_EFC_FRR 12
-extern struct flash_driver at91sam4_flash;
+extern const struct flash_driver at91sam4_flash;
static float _tomhz(uint32_t freq_hz)
{
@@ -3234,7 +3234,7 @@ static const struct command_registration at91sam4_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
-struct flash_driver at91sam4_flash = {
+const struct flash_driver at91sam4_flash = {
.name = "at91sam4",
.commands = at91sam4_command_handlers,
.flash_bank_command = sam4_flash_bank_command,