[PATCH v2 03/19] cdev: fix for_each_cdev macro

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

 



The macro parameter 'c' was never used, instead hardcoding cdev.
It worked so far anyway, because all users of for_each_cdev used cdev
as the argument. Fix this.

While at it, surround cdev with parenthesis to avoid associativity
issues.

Reviewed-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
v1 -> v2:
  - add parenthesis around cdev (Ulrich)
  - add Marco's Reviewed-by
---
 include/driver.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/driver.h b/include/driver.h
index d33e0fcbccc9..66ae52d0004c 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -566,8 +566,8 @@ int cdev_truncate(struct cdev*, size_t size);
 loff_t cdev_unallocated_space(struct cdev *cdev);
 
 extern struct list_head cdev_list;
-#define for_each_cdev(c) \
-	list_for_each_entry(cdev, &cdev_list, list)
+#define for_each_cdev(cdev) \
+	list_for_each_entry((cdev), &cdev_list, list)
 
 #define DEVFS_PARTITION_FIXED		(1U << 0)
 #define DEVFS_PARTITION_READONLY	(1U << 1)
-- 
2.39.2





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

  Powered by Linux