There are a few macros in IOMMU have single-char identifiers make the code hard to read and debug. Replace them with meaningful names.
Unified · Split
| @@ -92,12 +92,14 @@ static inline bool dmar_rcu_check(void) · 91 unmodified lines | ||
| 92 | 92 | |
| 93 | 93 | #define dmar_rcu_dereference(p) rcu_dereference_check((p), dmar_rcu_check()) |
| 94 | 94 | |
| 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 | |
| 101 | 103 | |
| 102 | 104 | extern int dmar_table_init(void); |
| 103 | 105 | extern int dmar_dev_scope_init(void); |