Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/38171 )
Change subject: drivers/spi/flashconsole: Fix shadowing local variable ......................................................................
Patch Set 1:
(7 comments)
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... File src/drivers/spi/flashconsole.c:
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... PS1, Line 55: for (i = 0; i < len && offset < size;) { l_offset
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... PS1, Line 58: len = MIN(READ_BUFFER_SIZE, size - offset); l_offset
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... PS1, Line 59: if (rdev_readat(&rdev, buffer, offset, len) != len) l_offset
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... PS1, Line 73: if (offset >= size) { l_offset
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... PS1, Line 78: offset = l_offset; This is the only line where s/g_offset/offset happened. That is my argument why this should be the only reference to the global offset.
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... PS1, Line 99: size_t l_offset = offset; You could declare this const, so you don't really need the local variable at all.
https://review.coreboot.org/c/coreboot/+/38171/1/src/drivers/spi/flashconsol... PS1, Line 125: offset = l_offset + len; offset += len;