[coreboot] r3194 - trunk/util/superiotool

svn at coreboot.org svn at coreboot.org
Sat Mar 29 02:35:21 CET 2008


Author: uwe
Date: 2008-03-29 02:35:21 +0100 (Sat, 29 Mar 2008)
New Revision: 3194

Modified:
   trunk/util/superiotool/superiotool.c
   trunk/util/superiotool/superiotool.h
Log:
Make a few array entries only as big as they absolutely need to be (trivial).

This decreases the size of the superiotool binary from ca. 1.1 MB to 600 KB.

Signed-off-by: Uwe Hermann <uwe at hermann-uwe.de>
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>



Modified: trunk/util/superiotool/superiotool.c
===================================================================
--- trunk/util/superiotool/superiotool.c	2008-03-28 03:35:11 UTC (rev 3193)
+++ trunk/util/superiotool/superiotool.c	2008-03-29 01:35:21 UTC (rev 3194)
@@ -80,7 +80,7 @@
 		      int i, int j, uint16_t port)
 {
 	int k;
-	const int *idx;
+	const int16_t *idx;
 
 	if (reg_table[i].ldn[j].ldn != NOLDN) {
 		printf("LDN 0x%02x", reg_table[i].ldn[j].ldn);

Modified: trunk/util/superiotool/superiotool.h
===================================================================
--- trunk/util/superiotool/superiotool.h	2008-03-28 03:35:11 UTC (rev 3193)
+++ trunk/util/superiotool/superiotool.h	2008-03-29 01:35:21 UTC (rev 3194)
@@ -51,7 +51,6 @@
 #define NANA		-3		/* Not Available */
 #define RSVD		-4		/* Reserved */
 #define MISC		-5		/* Needs special comment in output */
-#define MAXNAMELEN	30		/* Maximum Name Length */
 #define MAXLDN		0x10		/* Biggest LDN */
 #define LDNSIZE		(MAXLDN + 3)	/* Biggest LDN + 0 + NOLDN + EOT */
 #define MAXNUMIDX	70		/* Maximum number of indexes */
@@ -65,12 +64,12 @@
 
 struct superio_registers {
 	int32_t superio_id;		/* Signed, as we need EOT. */
-	const char name[MAXNAMELEN];	/* Super I/O name */
+	const char *name;		/* Super I/O name */
 	struct {
-		int ldn;
+		int8_t ldn;
 		const char *name;	/* LDN name */
-		int idx[IDXSIZE];
-		int def[IDXSIZE];
+		int16_t idx[IDXSIZE];
+		int16_t def[IDXSIZE];
 	} ldn[LDNSIZE];
 };
 





More information about the coreboot mailing list