iommu/omap: Use PAGE_ALIGNED instead of IS_ALIGNED(PAGE_SIZE)
authorFabian Frederick <fabf@skynet.be>
Sat, 14 Jun 2014 21:58:34 +0000 (23:58 +0200)
committerJoerg Roedel <jroedel@suse.de>
Fri, 4 Jul 2014 10:39:18 +0000 (12:39 +0200)
use mm.h definition

Cc: Joerg Roedel <joro@8bytes.org>
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/omap-iovmm.c

index d14725984153b149aa6946b8bff8d8e69f30d108..f583ba0491687553f4aa4a1acf4750b60ee81e19 100644 (file)
@@ -131,7 +131,7 @@ static unsigned sgtable_nents(size_t bytes, u32 da, u32 pa)
 {
        unsigned nr_entries = 0, ent_sz;
 
-       if (!IS_ALIGNED(bytes, PAGE_SIZE)) {
+       if (!PAGE_ALIGNED(bytes)) {
                pr_err("%s: wrong size %08x\n", __func__, bytes);
                return 0;
        }
@@ -159,7 +159,7 @@ static struct sg_table *sgtable_alloc(const size_t bytes, u32 flags,
        if (!bytes)
                return ERR_PTR(-EINVAL);
 
-       if (!IS_ALIGNED(bytes, PAGE_SIZE))
+       if (!PAGE_ALIGNED(bytes))
                return ERR_PTR(-EINVAL);
 
        if (flags & IOVMF_LINEAR) {
@@ -514,7 +514,7 @@ static void unmap_iovm_area(struct iommu_domain *domain, struct omap_iommu *obj,
        size_t unmapped;
 
        BUG_ON(!sgtable_ok(sgt));
-       BUG_ON((!total) || !IS_ALIGNED(total, PAGE_SIZE));
+       BUG_ON((!total) || !PAGE_ALIGNED(total));
 
        start = area->da_start;
        for_each_sg(sgt->sgl, sg, sgt->nents, i) {
@@ -529,7 +529,7 @@ static void unmap_iovm_area(struct iommu_domain *domain, struct omap_iommu *obj,
                dev_dbg(obj->dev, "%s: unmap %08x(%x) %08x\n",
                                __func__, start, bytes, area->flags);
 
-               BUG_ON(!IS_ALIGNED(bytes, PAGE_SIZE));
+               BUG_ON(!PAGE_ALIGNED(bytes));
 
                total -= bytes;
                start += bytes;
@@ -545,7 +545,7 @@ static struct sg_table *unmap_vm_area(struct iommu_domain *domain,
        struct sg_table *sgt = NULL;
        struct iovm_struct *area;
 
-       if (!IS_ALIGNED(da, PAGE_SIZE)) {
+       if (!PAGE_ALIGNED(da)) {
                dev_err(obj->dev, "%s: alignment err(%08x)\n", __func__, da);
                return NULL;
        }
This page took 0.025428 seconds and 5 git commands to generate.