remove trailing whitespace
[coreboot.git] / util / sconfig / main.c
old mode 100755 (executable)
new mode 100644 (file)
index 727fcce..dab04db
@@ -131,6 +131,13 @@ struct device *new_chip(struct device *parent, struct device *bus, char *path) {
 
        struct stat st;
        char *chip_h = malloc(strlen(path)+12);
+       sprintf(chip_h, "src/%s", path);
+       if ((stat(chip_h, &st) == -1) && (errno == ENOENT)) {
+               fprintf(stderr, "ERROR: Chip component %s does not exist.\n",
+                               path);
+               exit(1);
+       }
+
        sprintf(chip_h, "src/%s/chip.h", path);
        if ((stat(chip_h, &st) == -1) && (errno == ENOENT))
                new_chip->chiph_exists = 0;
@@ -415,14 +422,13 @@ static void walk_device_tree(FILE *fil, struct device *ptr, void (*func)(FILE *,
 static void inherit_subsystem_ids(FILE *file, struct device *dev)
 {
        struct device *p;
-       int i =0;
 
        if (dev->subsystem_vendor != -1 && dev->subsystem_device != -1) {
                /* user already gave us a subsystem vendor/device */
                return;
        }
 
-       for(p = dev; p && p != p->parent; (p = p->parent), i++) {
+       for(p = dev; p && p != p->parent; p = p->parent) {
 
                if (p->bustype != PCI && p->bustype != PCI_DOMAIN)
                        continue;