From a80cfbc3d7ebc5ebe8775652687a26e6e02247b6 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 22 Jul 2009 20:13:00 +0000 Subject: Eliminate version string duplication Corresponding to flashrom svn r659. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Stefan Reinauer --- flash.h | 1 + flashrom.c | 3 ++- print.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flash.h b/flash.h index ba201ec0..0da4293f 100644 --- a/flash.h +++ b/flash.h @@ -379,6 +379,7 @@ int ft2232_spi_write_256(struct flashchip *flash, uint8_t *buf); /* flashrom.c */ extern int verbose; +extern const char *flashrom_version; #define printf_debug(x...) { if (verbose) printf(x); } void map_flash_registers(struct flashchip *flash); int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len); diff --git a/flashrom.c b/flashrom.c index 95db7d9f..11efd259 100644 --- a/flashrom.c +++ b/flashrom.c @@ -30,6 +30,7 @@ #include "flash.h" #include "flashchips.h" +const char *flashrom_version = FLASHROM_VERSION; char *chip_to_probe = NULL; int verbose = 0; int programmer = PROGRAMMER_INTERNAL; @@ -503,7 +504,7 @@ void usage(const char *name) void print_version(void) { - printf("flashrom v%s\n", FLASHROM_VERSION); + printf("flashrom v%s\n", flashrom_version); } int main(int argc, char *argv[]) diff --git a/print.c b/print.c index a1dfb862..9b6ec2a0 100644 --- a/print.c +++ b/print.c @@ -718,7 +718,7 @@ void print_wiki_tables(void) { time_t t = time(NULL); - printf(wiki_header, ctime(&t), FLASHROM_VERSION); + printf(wiki_header, ctime(&t), flashrom_version); print_supported_chips_wiki(); print_supported_chipsets_wiki(); print_supported_boards_wiki(); -- cgit v1.2.3