[coreboot] [commit] r5686 - trunk/util/sconfig

repository service svn at coreboot.org
Mon Aug 9 14:02:00 CEST 2010


Author: stepan
Date: Mon Aug  9 14:02:00 2010
New Revision: 5686
URL: https://tracker.coreboot.org/trac/coreboot/changeset/5686

Log:
non-root devices are not supposed to be accessed outside of static.c except by
walking the tree.

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>

Modified:
   trunk/util/sconfig/main.c

Modified: trunk/util/sconfig/main.c
==============================================================================
--- trunk/util/sconfig/main.c	Thu Aug  5 16:41:29 2010	(r5685)
+++ trunk/util/sconfig/main.c	Mon Aug  9 14:02:00 2010	(r5686)
@@ -283,18 +283,20 @@
 	if (ptr->type == device && ptr->id == 0)
 		fprintf(fil, "struct bus %s_links[];\n", ptr->name);
 	if ((ptr->type == device) && (ptr->id != 0) && (!ptr->used)) {
-		fprintf(fil, "struct device %s;\n", ptr->name);
+		fprintf(fil, "static struct device %s;\n", ptr->name);
 		if (ptr->rescnt > 0)
 			fprintf(fil, "struct resource %s_res[];\n", ptr->name);
 		if (ptr->children || ptr->multidev)
 			fprintf(fil, "struct bus %s_links[];\n", ptr->name);
 	}
 	if ((ptr->type == device) && (ptr->id != 0) && ptr->used)
-		fprintf(fil, "struct device %s;\n", ptr->aliased_name);
+		fprintf(fil, "static struct device %s;\n", ptr->aliased_name);
 }
 
 static void pass1(FILE *fil, struct device *ptr) {
 	if (!ptr->used && (ptr->type == device)) {
+		if (ptr->id != 0)
+			fprintf(fil, "static ", ptr->name);
 		fprintf(fil, "struct device %s = {\n", ptr->name);
 		fprintf(fil, "\t.ops = %s,\n", (ptr->ops)?(ptr->ops):"0");
 		fprintf(fil, "\t.bus = &%s_links[%d],\n", ptr->bus->name, ptr->bus->link);




More information about the coreboot mailing list