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>
This commit is contained in:
committed by
Matthias Welwarsky
parent
84a2cab596
commit
a7479fa89d
@@ -393,7 +393,7 @@ static bool fcf_fopt_configured;
|
||||
static bool create_banks;
|
||||
|
||||
|
||||
struct flash_driver kinetis_flash;
|
||||
const struct flash_driver kinetis_flash;
|
||||
static int kinetis_write_inner(struct flash_bank *bank, const uint8_t *buffer,
|
||||
uint32_t offset, uint32_t count);
|
||||
static int kinetis_probe_chip(struct kinetis_chip *k_chip);
|
||||
@@ -3143,7 +3143,7 @@ static const struct command_registration kinetis_command_handler[] = {
|
||||
|
||||
|
||||
|
||||
struct flash_driver kinetis_flash = {
|
||||
const struct flash_driver kinetis_flash = {
|
||||
.name = "kinetis",
|
||||
.commands = kinetis_command_handler,
|
||||
.flash_bank_command = kinetis_flash_bank_command,
|
||||
|
||||
Reference in New Issue
Block a user