diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-01-06 14:18:18 +0800 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2014-01-09 12:43:37 +0100 |
commit | 7c9197791a0cbbbb0f74aade3339f8e5890fbd15 (patch) | |
tree | 7de99c18c2b40d43decb634b22b03686b6e703db /include/linux/dmar.h | |
parent | 2fe2c6025d6a4939ae2fc97d1d761fc4a8d1abd9 (diff) |
iommu/vt-d, trivial: simplify code with existing macros
Simplify vt-d related code with existing macros and introduce a new
macro for_each_active_drhd_unit() to enumerate all active DRHD unit.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'include/linux/dmar.h')
-rw-r--r-- | include/linux/dmar.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 1a60dd630bb4..eccb0c0c6cf6 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h @@ -53,6 +53,10 @@ extern struct list_head dmar_drhd_units; #define for_each_drhd_unit(drhd) \ list_for_each_entry(drhd, &dmar_drhd_units, list) +#define for_each_active_drhd_unit(drhd) \ + list_for_each_entry(drhd, &dmar_drhd_units, list) \ + if (drhd->ignored) {} else + #define for_each_active_iommu(i, drhd) \ list_for_each_entry(drhd, &dmar_drhd_units, list) \ if (i=drhd->iommu, drhd->ignored) {} else |