[flashrom] [PATCH] squash! add printing of chip voltage ranges to print.c

Stefan Tauner stefan.tauner at student.tuwien.ac.at
Sat Jun 4 10:12:23 CEST 2011


 - additional vendor tokens below the values
 - debug output removed

Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
---
 print.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/print.c b/print.c
index 35af208..840ccae 100644
--- a/print.c
+++ b/print.c
@@ -78,12 +78,8 @@ static void print_supported_chips(void)
 		chipcount++;
 		tmp_ven_str = (char *)f->vendor;
 		do {
-			
-			msg_gspew("tmp_ven_str=%s, ", tmp_ven_str);
 			tmp_ven_len = strcspn(tmp_ven_str, delim);
-			msg_gspew("tmp_ven_len=%d, ", tmp_ven_len);
 			maxvendorlen = max(maxvendorlen, tmp_ven_len);
-			msg_gspew("new maxvendorlen=%d\n", maxvendorlen);
 			tmp_ven_str += tmp_ven_len;
 		} while (tmp_ven_len != 0);
 
@@ -140,14 +136,14 @@ static void print_supported_chips(void)
 		strcpy(tmp_ven_str, f->vendor);
 
 		tmp_ven_str = strtok(tmp_ven_str, delim);
-		msg_ginfo("%s", tmp_ven_str);
 		tmp_ven_len = strlen(tmp_ven_str);
+		msg_ginfo("%s", tmp_ven_str);
 		tmp_ven_str = strtok(NULL, delim);
-		while (tmp_ven_str != NULL) {
-			msg_ginfo("%s\n%s", delim, tmp_ven_str);
-			tmp_ven_len = strlen(tmp_ven_str);
-			tmp_ven_str = strtok(NULL, delim);
+		if (tmp_ven_str != NULL) {
+			msg_ginfo("%s", delim);
+			tmp_ven_len++;
 		}
+
 		for (i = tmp_ven_len; i < maxvendorlen; i++)
 			msg_ginfo(" ");
 
@@ -211,6 +207,11 @@ static void print_supported_chips(void)
 			msg_gdbg("%0.02f;%0.02f",
 			       f->voltage.min/(double)1000,
 			       f->voltage.max/(double)1000);
+
+		while (tmp_ven_str != NULL) {
+			msg_ginfo("\n%s", tmp_ven_str);
+			tmp_ven_str = strtok(NULL, delim);
+		}
 		msg_ginfo("\n");
 	}
 }
-- 
1.7.1





More information about the flashrom mailing list