Skip to content

Commit a760f8a

Browse files
Qian Caitorvalds
authored andcommitted
include/linux/dmar.h: replace single-char identifiers in macros
There are a few macros in IOMMU have single-char identifiers make the code hard to read and debug. Replace them with meaningful names. Link: http://lkml.kernel.org/r/1559566783-13627-1-git-send-email-cai@lca.pw Signed-off-by: Qian Cai <cai@lca.pw> Suggested-by: Andrew Morton <akpm@linux-foundation.org> Cc: Joerg Roedel <jroedel@suse.de> Cc: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ae2c888 commit a760f8a

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎include/linux/dmar.h‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ static inline bool dmar_rcu_check(void)
9292

9393
#define dmar_rcu_dereference(p) rcu_dereference_check((p), dmar_rcu_check())
9494

95-
#define for_each_dev_scope(a, c, p, d) \
96-
for ((p) = 0; ((d) = (p) < (c) ? dmar_rcu_dereference((a)[(p)].dev) : \
97-
NULL, (p) < (c)); (p)++)
98-
99-
#define for_each_active_dev_scope(a, c, p, d) \
100-
for_each_dev_scope((a), (c), (p), (d)) if (!(d)) { continue; } else
95+
#define for_each_dev_scope(devs, cnt, i, tmp) \
96+
for ((i) = 0; ((tmp) = (i) < (cnt) ? \
97+
dmar_rcu_dereference((devs)[(i)].dev) : NULL, (i) < (cnt)); \
98+
(i)++)
99+
100+
#define for_each_active_dev_scope(devs, cnt, i, tmp) \
101+
for_each_dev_scope((devs), (cnt), (i), (tmp)) \
102+
if (!(tmp)) { continue; } else
101103

102104
extern int dmar_table_init(void);
103105
extern int dmar_dev_scope_init(void);

0 commit comments

Comments
 (0)