summaryrefslogtreecommitdiffstats
path: root/print_wiki.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-03 11:02:10 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-03 11:02:10 +0000
commitad3cc55e139b2e239325815464fe5f7d828aa794 (patch)
tree46568cf766d19740418be5ca8eaa494c7e69cc36 /print_wiki.c
parentb63b067ae22803689592db482611093b33a29eef (diff)
downloadast2050-flashrom-ad3cc55e139b2e239325815464fe5f7d828aa794.zip
ast2050-flashrom-ad3cc55e139b2e239325815464fe5f7d828aa794.tar.gz
Kill global variables, constants and functions if local scope suffices
Constify variables where possible. Initialize programmer-related variables explicitly in programmer_init to allow running programmer_init from a clean state after programmer_shutdown. Prohibit registering programmer shutdown functions before init or after shutdown. Kill some dead code. Rename global variables with namespace-polluting names. Use a previously unused locking helper function in sst49lfxxxc.c. This is needed for libflashrom. Effects on the binary size of flashrom are minimal (300 bytes shrinkage), but the data section shrinks by 4384 bytes, and that's a good thing if flashrom is operating in constrained envionments. Corresponding to flashrom svn r1068. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
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 b85bf19..d688530 100644
--- a/print_wiki.c
+++ b/print_wiki.c
@@ -26,7 +26,7 @@
#include "flash.h"
#include "flashchips.h"
-const char *wiki_header = "= Supported devices =\n\n\
+static const char * const 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 \
@@ -34,16 +34,16 @@ generated by pasting '''flashrom -z''' output.<br />\
'''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
#if CONFIG_INTERNAL == 1
-const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\
+static const char * const 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";
-const char *board_th = "{| border=\"0\" style=\"font-size: smaller\" \
+static const char * const 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";
-const char *board_intro = "\
+static const char * const 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 \
@@ -56,14 +56,14 @@ know, someone has to give it a try). Please report any further verified \
mainboards on the [[Mailinglist|mailing list]].\n";
#endif
-const char *chip_th = "{| border=\"0\" style=\"font-size: smaller\" \
+static const char * const 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";
-const char *programmer_section = "\
+static const char * const 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: \
@@ -72,7 +72,7 @@ smaller\" valign=\"top\"\n|- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
! align=\"left\" | Status\n\n";
#if CONFIG_INTERNAL == 1
-const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\
+static const char * const 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\
@@ -124,7 +124,7 @@ static void wiki_helper(const char *devicetype, int cols,
int num_notes = 0;
char *notes = calloc(1, 1);
char tmp[900 + 1];
- struct board_pciid_enable *b = board_pciid_enables;
+ const struct board_pciid_enable *b = board_pciid_enables;
for (i = 0; boards[i].vendor != NULL; i++) {
if (boards[i].working)
@@ -245,7 +245,7 @@ static void print_supported_chips_wiki(int cols)
printf("\n|}\n\n|}\n");
}
-static void print_supported_pcidevs_wiki(struct pcidev_status *devs)
+static void print_supported_pcidevs_wiki(const struct pcidev_status *devs)
{
int i = 0;
static int c = 0;
OpenPOWER on IntegriCloud