mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fixup! base: add class device support
@ 2024-07-01  7:28 Ahmad Fatoum
  2024-07-01  9:46 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-07-01  7:28 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

driver: wrap class macro arguments in parenthesis

Without the parenthesis, using & in the macro argument will lead to
issues.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/device.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/device.h b/include/device.h
index d8d1f7c329c1..8550544ca807 100644
--- a/include/device.h
+++ b/include/device.h
@@ -121,8 +121,8 @@ int class_add_device(struct class *class, struct device *dev);
 void class_remove_device(struct class *class, struct device *dev);
 
 extern struct list_head class_list;
-#define class_for_each_device(class, dev) list_for_each_entry(dev, &class->devices, class_list)
-#define class_for_each(class) list_for_each_entry(class, &class_list, list)
+#define class_for_each_device(class, dev) list_for_each_entry((dev), &(class)->devices, class_list)
+#define class_for_each(class) list_for_each_entry((class), &class_list, list)
 
 struct device_alias {
 	struct device *dev;
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-01  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-01  7:28 [PATCH] fixup! base: add class device support Ahmad Fatoum
2024-07-01  9:46 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox