mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 14:33:18 +02:00
Convince compilers to put constant data into the .rodata section
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>
This commit is contained in:
@ -208,7 +208,7 @@ int sb600_probe_spi(struct pci_dev *dev)
|
||||
struct pci_dev *smbus_dev;
|
||||
uint32_t tmp;
|
||||
uint8_t reg;
|
||||
const char *speed_names[4] = {
|
||||
static const char *const speed_names[4] = {
|
||||
"Reserved", "33", "22", "16.5"
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user