summaryrefslogtreecommitdiff
path: root/include/linux/iova.h
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-07-11 10:19:36 +0400
committerJoerg Roedel <jroedel@suse.de>2014-07-23 18:04:47 +0400
commita156ef99e874f3701367cc192aa604bcf8c0a236 (patch)
tree2a2407d0d17ce78f8ed1766127d00724b86fba11 /include/linux/iova.h
parent162d1b10d4d38065efec690c2b05ee90dfcf170c (diff)
downloadlinux-a156ef99e874f3701367cc192aa604bcf8c0a236.tar.xz
iommu/vt-d: Introduce helper function iova_size() to improve code readability
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux/iova.h')
-rw-r--r--include/linux/iova.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/iova.h b/include/linux/iova.h
index 3277f4711349..19e81d5ccb6d 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -34,6 +34,11 @@ struct iova_domain {
unsigned long dma_32bit_pfn;
};
+static inline unsigned long iova_size(struct iova *iova)
+{
+ return iova->pfn_hi - iova->pfn_lo + 1;
+}
+
struct iova *alloc_iova_mem(void);
void free_iova_mem(struct iova *iova);
void free_iova(struct iova_domain *iovad, unsigned long pfn);