[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180709083650.23549-5-daniel.vetter@ffwll.ch>
Date: Mon, 9 Jul 2018 10:36:43 +0200
From: Daniel Vetter <daniel.vetter@...ll.ch>
To: LKML <linux-kernel@...r.kernel.org>
Cc: DRI Development <dri-devel@...ts.freedesktop.org>,
Intel Graphics Development <intel-gfx@...ts.freedesktop.org>,
Daniel Vetter <daniel.vetter@...ll.ch>,
Daniel Vetter <daniel.vetter@...el.com>,
Joerg Roedel <jroedel@...e.de>
Subject: [PATCH 05/12] dmar: Use for_each_If
Avoids the inverted conditions compared to the open coded version.
Signed-off-by: Daniel Vetter <daniel.vetter@...el.com>
Cc: Joerg Roedel <jroedel@...e.de>
---
include/linux/dmar.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index e2433bc50210..99397504e75e 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -85,15 +85,15 @@ extern struct list_head dmar_drhd_units;
#define for_each_active_drhd_unit(drhd) \
list_for_each_entry_rcu(drhd, &dmar_drhd_units, list) \
- if (drhd->ignored) {} else
+ for_each_if (!drhd->ignored)
#define for_each_active_iommu(i, drhd) \
list_for_each_entry_rcu(drhd, &dmar_drhd_units, list) \
- if (i=drhd->iommu, drhd->ignored) {} else
+ for_each_if ((i=drhd->iommu, !drhd->ignored))
#define for_each_iommu(i, drhd) \
list_for_each_entry_rcu(drhd, &dmar_drhd_units, list) \
- if (i=drhd->iommu, 0) {} else
+ for_each_if ((i=drhd->iommu, true))
static inline bool dmar_rcu_check(void)
{
@@ -108,7 +108,8 @@ static inline bool dmar_rcu_check(void)
NULL, (p) < (c)); (p)++)
#define for_each_active_dev_scope(a, c, p, d) \
- for_each_dev_scope((a), (c), (p), (d)) if (!(d)) { continue; } else
+ for_each_dev_scope((a), (c), (p), (d)) \
+ for_each_if (d)
extern int dmar_table_init(void);
extern int dmar_dev_scope_init(void);
--
2.18.0
Powered by blists - more mailing lists