* [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
* Re: [PATCH] fixup! base: add class device support
2024-07-01 7:28 [PATCH] fixup! base: add class device support Ahmad Fatoum
@ 2024-07-01 9:46 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-07-01 9:46 UTC (permalink / raw)
To: barebox, Ahmad Fatoum
On Mon, 01 Jul 2024 09:28:50 +0200, Ahmad Fatoum wrote:
> driver: wrap class macro arguments in parenthesis
>
> Without the parenthesis, using & in the macro argument will lead to
> issues.
>
>
Applied, thanks!
[1/1] fixup! base: add class device support
https://git.pengutronix.de/cgit/barebox/commit/?id=68a9b7a88b82 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ 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