diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-03-04 12:15:00 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-12 01:09:09 -0500 |
commit | 437b29d1159af16b54b6571efb92c6e048d03c15 (patch) | |
tree | acd246c68de5c6ca916336e745859bb4172c0c2a | |
parent | f53896608128f311b7c4982fa479ab7400be3164 (diff) |
staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN
mm.h contains a helper function PAGE_ALIGN which aligns the pointer
to the page boundary instead of using ALIGN(expression, PAGE_SIZE)
This change was made with the help of the following Coccinelle
semantic patch:
//<smpl>
@@
expression e;
symbol PAGE_SIZE;
@@
(
- ALIGN(e, PAGE_SIZE)
+ PAGE_ALIGN(e)
|
- IS_ALIGNED(e, PAGE_SIZE)
+ PAGE_ALIGNED(e)
)
//</smpl>
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rdma/hfi1/file_ops.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c index d57d549052c8..8b911e8bf0df 100644 --- a/drivers/staging/rdma/hfi1/file_ops.c +++ b/drivers/staging/rdma/hfi1/file_ops.c | |||
@@ -487,8 +487,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma) | |||
487 | * Map only the amount allocated to the context, not the | 487 | * Map only the amount allocated to the context, not the |
488 | * entire available context's PIO space. | 488 | * entire available context's PIO space. |
489 | */ | 489 | */ |
490 | memlen = ALIGN(uctxt->sc->credits * PIO_BLOCK_SIZE, | 490 | memlen = PAGE_ALIGN(uctxt->sc->credits * PIO_BLOCK_SIZE); |
491 | PAGE_SIZE); | ||
492 | flags &= ~VM_MAYREAD; | 491 | flags &= ~VM_MAYREAD; |
493 | flags |= VM_DONTCOPY | VM_DONTEXPAND; | 492 | flags |= VM_DONTCOPY | VM_DONTEXPAND; |
494 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | 493 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
@@ -638,7 +637,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma) | |||
638 | goto done; | 637 | goto done; |
639 | } | 638 | } |
640 | memaddr = (u64)cq->comps; | 639 | memaddr = (u64)cq->comps; |
641 | memlen = ALIGN(sizeof(*cq->comps) * cq->nentries, PAGE_SIZE); | 640 | memlen = PAGE_ALIGN(sizeof(*cq->comps) * cq->nentries); |
642 | flags |= VM_IO | VM_DONTEXPAND; | 641 | flags |= VM_IO | VM_DONTEXPAND; |
643 | vmf = 1; | 642 | vmf = 1; |
644 | break; | 643 | break; |