1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

jedec.c: Add a little more const correctness

Change-Id: Ic9a76ce3734bd83399c95478a7c0bfc081211124
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73283
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
This commit is contained in:
Edward O'Callaghan 2023-02-26 17:01:59 +11:00 committed by Thomas Heijligen
parent 2c03317a4b
commit 15d348feff

View File

@ -123,7 +123,7 @@ static void start_program_jedec_common(const struct flashctx *flash)
int probe_jedec_29gl(struct flashctx *flash)
{
const unsigned int mask = getaddrmask(flash->chip);
chipaddr bios = flash->virtual_memory;
const chipaddr bios = flash->virtual_memory;
const struct flashchip *chip = flash->chip;
/* Reset chip to a clean slate */
@ -381,9 +381,8 @@ int write_jedec_1(struct flashctx *flash, const uint8_t *src, unsigned int start
unsigned int i;
int failed = 0;
chipaddr dst = flash->virtual_memory + start;
chipaddr olddst;
const chipaddr olddst = dst;
olddst = dst;
for (i = 0; i < len; i++) {
if (write_byte_program_jedec_common(flash, src, dst))
failed = 1;
@ -452,8 +451,8 @@ int write_jedec(struct flashctx *flash, const uint8_t *buf, unsigned int start,
* write_jedec have page_size set to max_writechunk_size, so
* we're OK for now.
*/
unsigned int page_size = flash->chip->page_size;
unsigned int nwrites = (start + len - 1) / page_size;
const unsigned int page_size = flash->chip->page_size;
const unsigned int nwrites = (start + len - 1) / page_size;
/* Warning: This loop has a very unusual condition and body.
* The loop needs to go through each page with at least one affected