Various cosmetic and coding style fixes in src/devices.
[coreboot.git] / src / devices / cardbus_device.c
index e3acf856ecb1d778a8cc5248c6ce789661bd6127..0b07e3458f0a09e95328cc4f46cf7a774a3e45f6 100644 (file)
@@ -42,36 +42,32 @@ static void cardbus_record_bridge_resource(device_t dev, resource_t moving,
                resource_t min_size, unsigned int index, unsigned long type)
 {
        struct resource *resource;
+       unsigned long gran;
+       resource_t step;
 
        /* Initialize the constraints on the current bus. */
        resource = NULL;
-       if (moving) {
-               unsigned long gran;
-               resource_t step;
-
-               resource = new_resource(dev, index);
-               resource->size = 0;
-               gran = 0;
-               step = 1;
-               while ((moving & step) == 0) {
-                       gran += 1;
-                       step <<= 1;
-               }
-               resource->gran = gran;
-               resource->align = gran;
-               resource->limit = moving | (step - 1);
-               resource->flags = type;
+       if (!moving)
+               return;
+
+       resource = new_resource(dev, index);
+       resource->size = 0;
+       gran = 0;
+       step = 1;
+       while ((moving & step) == 0) {
+               gran += 1;
+               step <<= 1;
+       }
+       resource->gran = gran;
+       resource->align = gran;
+       resource->limit = moving | (step - 1);
+       resource->flags = type;
 
-               /*
-                * Don't let the minimum size exceed what we
-                * can put in the resource.
-                */
-               if ((min_size - 1) > resource->limit)
-                       min_size = resource->limit + 1;
+       /* Don't let the minimum size exceed what we can put in the resource. */
+       if ((min_size - 1) > resource->limit)
+               min_size = resource->limit + 1;
 
-               resource->size = min_size;
-       }
-       return;
+       resource->size = min_size;
 }
 
 static void cardbus_size_bridge_resource(device_t dev, unsigned int index)