iommu: dmar: Provide helper to copy shared irte fields
authorThomas Gleixner <tglx@linutronix.de>
Tue, 9 Jun 2015 05:20:30 +0000 (13:20 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 12 Jun 2015 09:33:52 +0000 (11:33 +0200)
Instead of open coding, provide a helper function to copy the shared
irte fields.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: jiang.liu@linux.intel.com
Cc: iommu@lists.linux-foundation.org
Cc: joro@8bytes.org
Cc: dwmw2@infradead.org
Link: http://lkml.kernel.org/r/1433827237-3382-4-git-send-email-feng.wu@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/dmar.h

index 0dbcabcb5f0dbdc33b5a187d88fd625ce078cc70..e9bc9292bd3a5e8ff8ba6603564ee25a8911c7e4 100644 (file)
@@ -249,6 +249,18 @@ struct irte {
        };
 };
 
+static inline void dmar_copy_shared_irte(struct irte *dst, struct irte *src)
+{
+       dst->present    = src->present;
+       dst->fpd        = src->fpd;
+       dst->avail      = src->avail;
+       dst->pst        = src->pst;
+       dst->vector     = src->vector;
+       dst->sid        = src->sid;
+       dst->sq         = src->sq;
+       dst->svt        = src->svt;
+}
+
 #define PDA_LOW_BIT    26
 #define PDA_HIGH_BIT   32