Currently, the macro can't be used for more complex expressions like &pci_dev->dev. Fix this by adding the missing parentheses. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- include/driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/driver.h b/include/driver.h index 300603fa3277..ad59ce90c3a3 100644 --- a/include/driver.h +++ b/include/driver.h @@ -155,12 +155,12 @@ int unregister_device(struct device_d *); /* Iterate over a devices children */ #define device_for_each_child(dev, child) \ - list_for_each_entry(child, &dev->children, sibling) + list_for_each_entry(child, &(dev)->children, sibling) /* Iterate over a devices children - Safe against removal version */ #define device_for_each_child_safe(dev, tmpdev, child) \ - list_for_each_entry_safe(child, tmpdev, &dev->children, sibling) + list_for_each_entry_safe(child, tmpdev, &(dev)->children, sibling) /* Iterate through the devices of a given type. if last is NULL, the * first device of this type is returned. Put this pointer in as -- 2.24.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox