[PATCH] fixup! base: add class device support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux