summaryrefslogtreecommitdiff
path: root/src/device/device_util.c
diff options
context:
space:
mode:
authorFrans Hendriks <fhendriks@eltan.com>2021-02-01 11:44:37 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-02-05 09:42:19 +0000
commita9caa50e8ac08338caf29c8452d624e316e07581 (patch)
tree444af3e557fa8444cf36d4aed3cf1dd1d16551c7 /src/device/device_util.c
parent3d6d1075b2ba17a357143f518715a911e09b38ec (diff)
device: correct code style
Revise the following aspects to follow coreboot's coding style: - Drop braces for single-statement condition and loop bodies. - Use `__func__` to print the current function's name. - Reflow pointer dereferences to fit in a single line. - Adjust the `*` position in pointer variable declarations. - Drop unnecessary `else` statements. BUG = N/A TEST = Build Compulab Intense-PC with secure oprom enabled Change-Id: I780251d946d5bea97658476d61d25555ec768dfc Signed-off-by: Frans Hendriks <fhendriks@eltan.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49963 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/device/device_util.c')
-rw-r--r--src/device/device_util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/device/device_util.c b/src/device/device_util.c
index 0337fb2fb2..71c281e33e 100644
--- a/src/device/device_util.c
+++ b/src/device/device_util.c
@@ -370,7 +370,8 @@ struct resource *new_resource(struct device *dev, unsigned int index)
resource->next = NULL;
tail = dev->resource_list;
if (tail) {
- while (tail->next) tail = tail->next;
+ while (tail->next)
+ tail = tail->next;
tail->next = resource;
} else {
dev->resource_list = resource;
@@ -555,7 +556,7 @@ void search_bus_resources(struct bus *bus, unsigned long type_mask,
/* If it is a subtractive resource recurse. */
if (res->flags & IORESOURCE_SUBTRACTIVE) {
- struct bus * subbus;
+ struct bus *subbus;
for (subbus = curdev->link_list; subbus;
subbus = subbus->next)
if (subbus->link_num
@@ -604,11 +605,10 @@ void dev_set_enabled(struct device *dev, int enable)
return;
dev->enabled = enable;
- if (dev->ops && dev->ops->enable) {
+ if (dev->ops && dev->ops->enable)
dev->ops->enable(dev);
- } else if (dev->chip_ops && dev->chip_ops->enable_dev) {
+ else if (dev->chip_ops && dev->chip_ops->enable_dev)
dev->chip_ops->enable_dev(dev);
- }
}
void disable_children(struct bus *bus)
@@ -814,7 +814,7 @@ void show_one_resource(int debug_level, struct device *dev,
buf, resource_type(resource), comment);
}
-void show_all_devs_resources(int debug_level, const char* msg)
+void show_all_devs_resources(int debug_level, const char *msg)
{
struct device *dev;