aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/driver.h
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/driver.h
parent84a2cab596a0621fab3424c72b43280ccdc240c2 (diff)
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/driver.h')
-rw-r--r--src/flash/nor/driver.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nor/driver.h b/src/flash/nor/driver.h
index ef69a0f4..9c56d4ea 100644
--- a/src/flash/nor/driver.h
+++ b/src/flash/nor/driver.h
@@ -231,6 +231,6 @@ struct flash_driver {
* @param name The name of the requested driver.
* @returns The flash_driver called @c name, or NULL if not found.
*/
-struct flash_driver *flash_driver_find_by_name(const char *name);
+const struct flash_driver *flash_driver_find_by_name(const char *name);
#endif /* OPENOCD_FLASH_NOR_DRIVER_H */