mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fixup! base: add class device support
Date: Mon,  1 Jul 2024 09:28:50 +0200	[thread overview]
Message-ID: <20240701072850.164769-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-07-01  7:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  7:28 Ahmad Fatoum [this message]
2024-07-01  9:46 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701072850.164769-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox