diff options
author | Mathias Krause <mathias.krause@secunet.com> | 2011-01-17 07:50:42 +0000 |
---|---|---|
committer | Mathias Krause <mathias.krause@secunet.com> | 2011-01-17 07:50:42 +0000 |
commit | 056d725a54c902f7787d355bffe284003feaaa79 (patch) | |
tree | 9de9787987eb6a3374e18835b196b7ac6cb9ad19 /stm50flw0x0x.c | |
parent | 1b75c65ac7b8231cbbaef8bad2a23601e81f63b5 (diff) | |
download | flashrom-056d725a54c902f7787d355bffe284003feaaa79.zip flashrom-056d725a54c902f7787d355bffe284003feaaa79.tar.gz |
This patch reduces the stack usage by declaring 'const' stack variables as 'static const' so they end up in the .rodata section instead of being
Copied from there to the stack for every invocation of the corresponding
function. As a plus we end up in having a smaller binary as the "copy from
.rodata to stack" code isn't emitted by the compiler any more (roughly
-100 bytes).
Corresponding to flashrom svn r1252.
Signed-off-by: Mathias Krause <mathias.krause@secunet.com>
Acked-by: Stefan Reinauer <stepan@coreboot.org>
Diffstat (limited to 'stm50flw0x0x.c')
-rw-r--r-- | stm50flw0x0x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c index 80f518e..60e5c45 100644 --- a/stm50flw0x0x.c +++ b/stm50flw0x0x.c @@ -39,7 +39,7 @@ static int unlock_block_stm50flw0x0x(struct flashchip *flash, int offset) { chipaddr wrprotect = flash->virtual_registers + 2; - const uint8_t unlock_sector = 0x00; + static const uint8_t unlock_sector = 0x00; int j; /* |