Mimoja has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38171 )
Change subject: drivers/spi/flashconsole: Fix shadowing local variable ......................................................................
drivers/spi/flashconsole: Fix shadowing local variable
Commit c9b13594eb8d425e54a126b5c10e3f6fbc41528b removed the g_ prefix from global variables, leaving the local "offset" variable shadowing the global one. This commit partially reverts this by adding a l_ prefix to its two occations.
Change-Id: I246ebdcfd3b973e6a4aa3c15fc5f32497dcf8398 Signed-off-by: Johanna Schander coreboot@mimoja.de --- M src/drivers/spi/flashconsole.c 1 file changed, 8 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/38171/1
diff --git a/src/drivers/spi/flashconsole.c b/src/drivers/spi/flashconsole.c index 80c63e0..020d282 100644 --- a/src/drivers/spi/flashconsole.c +++ b/src/drivers/spi/flashconsole.c @@ -32,9 +32,9 @@ { uint8_t buffer[READ_BUFFER_SIZE]; size_t size; - size_t offset = 0; size_t len = READ_BUFFER_SIZE; size_t i; + size_t l_offset = 0;
if (fmap_locate_area_as_rdev_rw("CONSOLE", &rdev)) { printk(BIOS_INFO, "Can't find 'CONSOLE' area in FMAP\n"); @@ -60,12 +60,12 @@ return; } if (buffer[i] == 0xff) { - offset += i; + l_offset += i; break; } // If we're done, repeat the process for the next sector if (++i == READ_BUFFER_SIZE) { - offset += len; + l_offset += len; i = 0; } } @@ -75,7 +75,7 @@ return; }
- offset = offset; + offset = l_offset; rdev_ptr = &rdev; }
@@ -96,7 +96,7 @@
void flashconsole_tx_flush(void) { - size_t offset = offset; + size_t l_offset = offset; size_t len = line_offset; size_t region_size; static int busy; @@ -112,17 +112,17 @@
busy = 1; region_size = region_device_sz(rdev_ptr); - if (offset + len >= region_size) + if (l_offset + len >= region_size) len = region_size - offset;
if (rdev_writeat(&rdev, line_buffer, offset, len) != len) return;
// If the region is full, stop future write attempts - if (offset + len >= region_size) + if (l_offset + len >= region_size) return;
- offset = offset + len; + offset = l_offset + len; line_offset = 0;
busy = 0;