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>
This commit is contained in:
committed by
Patrick Georgi
parent
3d6d1075b2
commit
a9caa50e8a
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user