diff --git a/flash.h b/flash.h index d24582427ad029736a5181f0e319a082ee2cf2c0..806ef089698f03a38487abdd20d34753c3c1cbe2 100644 --- a/flash.h +++ b/flash.h @@ -338,11 +338,9 @@ uint32_t pcidev_init(uint16_t vendor_id, uint32_t bar, struct pcidev_status *dev /* print.c */ char *flashbuses_to_text(enum chipbustype bustype); -void print_supported_chips(void); -void print_supported_chipsets(void); -void print_supported_boards(void); +void print_supported(void); void print_supported_pcidevs(struct pcidev_status *devs); -void print_wiki_tables(void); +void print_supported_wiki(void); /* board_enable.c */ void w836xx_ext_enter(uint16_t port); diff --git a/flashrom.c b/flashrom.c index d1a86cb67df7a76e86fe85c9afc79b4b853b89a2..6f302bb3b1cf1e25dfbe9595caa5919112ceb11a 100644 --- a/flashrom.c +++ b/flashrom.c @@ -801,14 +801,25 @@ int main(int argc, char *argv[]) write_it = 1; break; case 'v': + //FIXME: gracefully handle superfluous -v if (++operation_specified > 1) { fprintf(stderr, "More than one operation " "specified. Aborting.\n"); exit(1); } + if (dont_verify_it) { + fprintf(stderr, "--verify and --noverify are" + "mutually exclusive. Aborting.\n"); + exit(1); + } verify_it = 1; break; case 'n': + if (verify_it) { + fprintf(stderr, "--verify and --noverify are" + "mutually exclusive. Aborting.\n"); + exit(1); + } dont_verify_it = 1; break; case 'c': @@ -896,29 +907,13 @@ int main(int argc, char *argv[]) } if (list_supported) { - print_supported_chips(); - print_supported_chipsets(); - print_supported_boards(); - printf("\nSupported PCI devices flashrom can use " - "as programmer:\n\n"); -#if NIC3COM_SUPPORT == 1 - print_supported_pcidevs(nics_3com); -#endif -#if GFXNVIDIA_SUPPORT == 1 - print_supported_pcidevs(gfx_nvidia); -#endif -#if DRKAISER_SUPPORT == 1 - print_supported_pcidevs(drkaiser_pcidev); -#endif -#if SATASII_SUPPORT == 1 - print_supported_pcidevs(satas_sii); -#endif + print_supported(); exit(0); } #if PRINT_WIKI_SUPPORT == 1 if (list_supported_wiki) { - print_wiki_tables(); + print_supported_wiki(); exit(0); } #endif @@ -930,6 +925,11 @@ int main(int argc, char *argv[]) if (optind < argc) filename = argv[optind++]; + + if (optind < argc) { + printf("Error: Extra parameter found.\n"); + usage(argv[0]); + } if (programmer_init()) { fprintf(stderr, "Error: Programmer initialization failed.\n"); @@ -1146,7 +1146,7 @@ int main(int argc, char *argv[]) if (write_it) programmer_delay(1000*1000); ret = verify_flash(flash, buf); - /* If we tried to write, and now we don't properly verify, we + /* If we tried to write, and verification now fails, we * might have an emergency situation. */ if (ret && write_it) diff --git a/print.c b/print.c index 4da070a3fb19620a71deef4b5b400d48baeaae09..a189efeba84bce74eb4c8df3461907151ac5132b 100644 --- a/print.c +++ b/print.c @@ -222,6 +222,27 @@ void print_supported_boards(void) "Laptops which have been verified to NOT work yet"); } +void print_supported(void) +{ + print_supported_chips(); + print_supported_chipsets(); + print_supported_boards(); + printf("\nSupported PCI devices flashrom can use " + "as programmer:\n\n"); +#if NIC3COM_SUPPORT == 1 + print_supported_pcidevs(nics_3com); +#endif +#if GFXNVIDIA_SUPPORT == 1 + print_supported_pcidevs(gfx_nvidia); +#endif +#if DRKAISER_SUPPORT == 1 + print_supported_pcidevs(drkaiser_pcidev); +#endif +#if SATASII_SUPPORT == 1 + print_supported_pcidevs(satas_sii); +#endif +} + /* Please keep this list alphabetically ordered by vendor/board. */ const struct board_info boards_ok[] = { diff --git a/print_wiki.c b/print_wiki.c index c00e93a859b89615cf9f4be93bea698ebb039005..825aa770249c5a8132bb96bd9674004d24070cfa 100644 --- a/print_wiki.c +++ b/print_wiki.c @@ -539,7 +539,7 @@ void print_supported_pcidevs_wiki(struct pcidev_status *devs) } } -void print_wiki_tables(void) +void print_supported_wiki(void) { time_t t = time(NULL);