History

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.

Qian Cai committed 7 years ago

Commit a760f8a1 parent ae2c8881 file · +8 −6Browse files

Unified · Split

include/linux/dmar.h+8−6
@@ -92,12 +92,14 @@ static inline bool dmar_rcu_check(void) · 91 unmodified lines
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);