diff options
| author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-01-06 01:18:18 -0500 |
|---|---|---|
| committer | Joerg Roedel <joro@8bytes.org> | 2014-01-09 06:43:37 -0500 |
| commit | 7c9197791a0cbbbb0f74aade3339f8e5890fbd15 (patch) | |
| tree | 7de99c18c2b40d43decb634b22b03686b6e703db /include/linux | |
| 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')
| -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; | |||
| 53 | #define for_each_drhd_unit(drhd) \ | 53 | #define for_each_drhd_unit(drhd) \ |
| 54 | list_for_each_entry(drhd, &dmar_drhd_units, list) | 54 | list_for_each_entry(drhd, &dmar_drhd_units, list) |
| 55 | 55 | ||
| 56 | #define for_each_active_drhd_unit(drhd) \ | ||
| 57 | list_for_each_entry(drhd, &dmar_drhd_units, list) \ | ||
| 58 | if (drhd->ignored) {} else | ||
| 59 | |||
| 56 | #define for_each_active_iommu(i, drhd) \ | 60 | #define for_each_active_iommu(i, drhd) \ |
| 57 | list_for_each_entry(drhd, &dmar_drhd_units, list) \ | 61 | list_for_each_entry(drhd, &dmar_drhd_units, list) \ |
| 58 | if (i=drhd->iommu, drhd->ignored) {} else | 62 | if (i=drhd->iommu, drhd->ignored) {} else |
