]> git.sur5r.net Git - openocd/blobdiff - src/flash/nor/em357.c
flash: Constify write buffer
[openocd] / src / flash / nor / em357.c
index 8f25a89b650a561a5d456bb53fbb5859019efd9d..70a5431ac68880b2827bbc1984a4db091edd6d3e 100644 (file)
@@ -455,7 +455,7 @@ static int em357_protect(struct flash_bank *bank, int set, int first, int last)
        return em357_write_options(bank);
 }
 
-static int em357_write_block(struct flash_bank *bank, uint8_t *buffer,
+static int em357_write_block(struct flash_bank *bank, const uint8_t *buffer,
        uint32_t offset, uint32_t count)
 {
        struct target *target = bank->target;
@@ -505,7 +505,7 @@ static int em357_write_block(struct flash_bank *bank, uint8_t *buffer,
        ;
 
        retval = target_write_buffer(target, write_algorithm->address,
-                       sizeof(em357_flash_write_code), (uint8_t *)em357_flash_write_code);
+                       sizeof(em357_flash_write_code), em357_flash_write_code);
        if (retval != ERROR_OK)
                return retval;
 
@@ -583,7 +583,7 @@ static int em357_write_block(struct flash_bank *bank, uint8_t *buffer,
        return retval;
 }
 
-static int em357_write(struct flash_bank *bank, uint8_t *buffer,
+static int em357_write(struct flash_bank *bank, const uint8_t *buffer,
        uint32_t offset, uint32_t count)
 {
        struct target *target = bank->target;