[flashrom] [commit] r1479 - trunk

repository service svn at flashrom.org
Fri Dec 23 00:27:03 CET 2011


Author: mkarcher
Date: Fri Dec 23 00:27:03 2011
New Revision: 1479
URL: http://flashrom.org/trac/flashrom/changeset/1479

Log:
Fix programmer-centric probe (patch v2)

As reported by Stefan Tauner on IRC, the new programmer-centric logic
is broken by re-using occupied members of the flashes array when changing
to the next programmer. This fixes it.

patch v2:
  prevent probing one chip per programmer even if the array is full. Using
  a do-while loop was a bad idea.

Signed-off-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Modified:
   trunk/cli_classic.c

Modified: trunk/cli_classic.c
==============================================================================
--- trunk/cli_classic.c	Tue Dec 20 03:08:14 2011	(r1478)
+++ trunk/cli_classic.c	Fri Dec 23 00:27:03 2011	(r1479)
@@ -451,9 +451,10 @@
 
 	for (j = 0; j < registered_programmer_count; j++) {
 		startchip = 0;
-		for (i = 0; i < ARRAY_SIZE(flashes); i++) {
+		while (chipcount < ARRAY_SIZE(flashes)) {
 			startchip = probe_flash(&registered_programmers[j],
-						startchip, &flashes[i], 0);
+						startchip, 
+						&flashes[chipcount], 0);
 			if (startchip == -1)
 				break;
 			chipcount++;




More information about the flashrom mailing list