summaryrefslogtreecommitdiff
path: root/print_wiki.c
diff options
context:
space:
mode:
authorkrause <krause@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-01-17 07:50:42 +0000
committerkrause <krause@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-01-17 07:50:42 +0000
commit363dee978e43fd6ca776c2d43fe6b12fec4e3911 (patch)
tree9de9787987eb6a3374e18835b196b7ac6cb9ad19 /print_wiki.c
parent8afaf634a5b34fcd9794ac201819af4010611ef1 (diff)
downloadflashrom-363dee978e43fd6ca776c2d43fe6b12fec4e3911.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). Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Acked-by: Stefan Reinauer <stepan@coreboot.org> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1252 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'print_wiki.c')
-rw-r--r--print_wiki.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/print_wiki.c b/print_wiki.c
index 48e0122..db5743e 100644
--- a/print_wiki.c
+++ b/print_wiki.c
@@ -27,7 +27,7 @@
#include "flashchips.h"
#include "programmer.h"
-static const char * const wiki_header = "= Supported devices =\n\n\
+static const char wiki_header[] = "= Supported devices =\n\n\
<div style=\"margin-top:0.5em; padding:0.5em 0.5em 0.5em 0.5em; \
background-color:#eeeeee; align:right; border:1px solid #aabbcc;\"><small>\n\
Please do '''not''' edit these tables in the wiki directly, they are \
@@ -35,16 +35,16 @@ generated by pasting '''flashrom -z''' output.<br />\
'''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
#if CONFIG_INTERNAL == 1
-static const char * const chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\
+static const char chipset_th[] = "{| border=\"0\" style=\"font-size: smaller\"\n\
|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
! align=\"left\" | Status\n\n";
-static const char * const board_th = "{| border=\"0\" style=\"font-size: smaller\" \
+static const char board_th[] = "{| border=\"0\" style=\"font-size: smaller\" \
valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Mainboard\n! align=\"left\" | Required option\n! align=\"left\" | Status\n\n";
-static const char * const board_intro = "\
+static const char board_intro[] = "\
\n== Supported mainboards ==\n\n\
In general, it is very likely that flashrom works out of the box even if your \
mainboard is not listed below.\n\nThis is a list of mainboards where we have \
@@ -57,14 +57,14 @@ know, someone has to give it a try). Please report any further verified \
mainboards on the [[Mailinglist|mailing list]].\n";
#endif
-static const char * const chip_th = "{| border=\"0\" style=\"font-size: smaller\" \
+static const char chip_th[] = "{| border=\"0\" style=\"font-size: smaller\" \
valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Device\n! align=\"left\" | Size / KB\n\
! align=\"left\" | Type\n! align=\"left\" colspan=\"4\" | Status\n\n\
|- bgcolor=\"#6699ff\"\n| colspan=\"4\" | &nbsp;\n\
| Probe\n| Read\n| Erase\n| Write\n\n";
-static const char * const programmer_section = "\
+static const char programmer_section[] = "\
\n== Supported programmers ==\n\nThis is a list \
of supported PCI devices flashrom can use as programmer:\n\n{| border=\"0\" \
valign=\"top\"\n| valign=\"top\"|\n\n{| border=\"0\" style=\"font-size: \
@@ -73,7 +73,7 @@ smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Status\n\n";
#if CONFIG_INTERNAL == 1
-static const char * const laptop_intro = "\n== Supported laptops/notebooks ==\n\n\
+static const char laptop_intro[] = "\n== Supported laptops/notebooks ==\n\n\
In general, flashing laptops is more difficult because laptops\n\n\
* often use the flash chip for stuff besides the BIOS,\n\
* often have special protection stuff which has to be handled by flashrom,\n\
@@ -167,9 +167,9 @@ static void wiki_helper(const char *devicetype, int cols,
if (boards[i].note) {
printf("<sup>%d</sup>\n", num_notes + 1);
- snprintf((char *)&tmp, 900, "<sup>%d</sup> %s<br />\n",
+ snprintf(tmp, sizeof(tmp), "<sup>%d</sup> %s<br />\n",
1 + num_notes++, boards[i].note);
- notes = strcat_realloc(notes, (char *)&tmp);
+ notes = strcat_realloc(notes, tmp);
} else {
printf("\n");
}