Author: stefanct Date: Fri Feb 3 23:32:09 2012 New Revision: 1488 URL: http://flashrom.org/trac/flashrom/changeset/1488
Log: print*.c: Refine the do not count nor print generic flash chip entries conditions.
Previously only the generic "unknown XXXX SPI chips" were ignored (because their name started with "unknown". This patch adds also all chips whose vendor starts with "Unknown" (none so far) and "Programmer" (currently used by the opaque flash chip framework) . A patch will add the SFDP chip template with an "Unknown" vendor field later.
Rationale: these entries do not contain any useful information when shown in -L or wiki output. It would be better to add them to a general feature section or similar.
Signed-off-by: Stefan Tauner stefan.tauner@student.tuwien.ac.at Acked-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Modified: trunk/print.c trunk/print_wiki.c
Modified: trunk/print.c ============================================================================== --- trunk/print.c Tue Jan 31 07:51:56 2012 (r1487) +++ trunk/print.c Fri Feb 3 23:32:09 2012 (r1488) @@ -74,8 +74,10 @@
/* calculate maximum column widths and by iterating over all chips */ for (f = flashchips; f->name != NULL; f++) { - /* Ignore "unknown XXXX SPI chip" entries. */ - if (!strncmp(f->name, "unknown", 7)) + /* Ignore generic entries. */ + if (!strncmp(f->vendor, "Unknown", 7) || + !strncmp(f->vendor, "Programmer", 10) || + !strncmp(f->name, "unknown", 7)) continue; chipcount++;
@@ -161,8 +163,10 @@ msg_ginfo("(P = PROBE, R = READ, E = ERASE, W = WRITE)\n\n");
for (f = flashchips; f->name != NULL; f++) { - /* Don't print "unknown XXXX SPI chip" entries. */ - if (!strncmp(f->name, "unknown", 7)) + /* Don't print generic entries. */ + if (!strncmp(f->vendor, "Unknown", 7) || + !strncmp(f->vendor, "Programmer", 10) || + !strncmp(f->name, "unknown", 7)) continue;
/* support for multiline vendor names:
Modified: trunk/print_wiki.c ============================================================================== --- trunk/print_wiki.c Tue Jan 31 07:51:56 2012 (r1487) +++ trunk/print_wiki.c Fri Feb 3 23:32:09 2012 (r1488) @@ -216,9 +216,10 @@ char vmin[6];
for (f = flashchips; f->name != NULL; f++) { - /* Don't count "unknown XXXX SPI chip" entries. */ - if (!strncmp(f->name, "unknown", 7)) - continue; + /* Don't count generic entries. */ + if (!strncmp(f->vendor, "Unknown", 7) || + !strncmp(f->vendor, "Programmer", 10) || + !strncmp(f->name, "unknown", 7)) chipcount++; }
@@ -227,8 +228,10 @@ "| valign="top"|\n\n%s", chipcount, chip_th);
for (f = flashchips; f->name != NULL; f++, i++) { - /* Don't print "unknown XXXX SPI chip" entries. */ - if (!strncmp(f->name, "unknown", 7)) + /* Don't print generic entries. */ + if (!strncmp(f->vendor, "Unknown", 7) || + !strncmp(f->vendor, "Programmer", 10) || + !strncmp(f->name, "unknown", 7)) continue;
/* Alternate colors if the vendor changes. */