diff options
author | Milind Arun Choudhary <milindchoudhary@gmail.com> | 2007-03-06 05:44:13 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@athena.road.mcmartin.ca> | 2007-05-22 23:56:18 -0400 |
commit | 3cb1d95847db993911ba0bba65e05087c7586eed (patch) | |
tree | 3c14e568beaf58e86084c38c71e8841d22ec80e9 /drivers/parisc/ccio-dma.c | |
parent | ea74342900dbe79f2a31ed3609b9e2bdb5c7198c (diff) |
[PARISC] ROUNDUP macro cleanup in drivers/parisc
Clean up ROUNDUP, Use ALIGN where ever appropriate.
Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers/parisc/ccio-dma.c')
-rw-r--r-- | drivers/parisc/ccio-dma.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 894fdb9d44c0..1459ca8fffc7 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
@@ -32,6 +32,7 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <linux/types.h> | 34 | #include <linux/types.h> |
35 | #include <linux/kernel.h> | ||
35 | #include <linux/init.h> | 36 | #include <linux/init.h> |
36 | #include <linux/mm.h> | 37 | #include <linux/mm.h> |
37 | #include <linux/spinlock.h> | 38 | #include <linux/spinlock.h> |
@@ -292,7 +293,6 @@ static int ioc_count; | |||
292 | #define PDIR_INDEX(iovp) ((iovp)>>IOVP_SHIFT) | 293 | #define PDIR_INDEX(iovp) ((iovp)>>IOVP_SHIFT) |
293 | #define MKIOVP(pdir_idx) ((long)(pdir_idx) << IOVP_SHIFT) | 294 | #define MKIOVP(pdir_idx) ((long)(pdir_idx) << IOVP_SHIFT) |
294 | #define MKIOVA(iovp,offset) (dma_addr_t)((long)iovp | (long)offset) | 295 | #define MKIOVA(iovp,offset) (dma_addr_t)((long)iovp | (long)offset) |
295 | #define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) | ||
296 | 296 | ||
297 | /* | 297 | /* |
298 | ** Don't worry about the 150% average search length on a miss. | 298 | ** Don't worry about the 150% average search length on a miss. |
@@ -668,7 +668,7 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt) | |||
668 | size_t saved_byte_cnt; | 668 | size_t saved_byte_cnt; |
669 | 669 | ||
670 | /* round up to nearest page size */ | 670 | /* round up to nearest page size */ |
671 | saved_byte_cnt = byte_cnt = ROUNDUP(byte_cnt, IOVP_SIZE); | 671 | saved_byte_cnt = byte_cnt = ALIGN(byte_cnt, IOVP_SIZE); |
672 | 672 | ||
673 | while(byte_cnt > 0) { | 673 | while(byte_cnt > 0) { |
674 | /* invalidate one page at a time */ | 674 | /* invalidate one page at a time */ |
@@ -751,7 +751,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size, | |||
751 | offset = ((unsigned long) addr) & ~IOVP_MASK; | 751 | offset = ((unsigned long) addr) & ~IOVP_MASK; |
752 | 752 | ||
753 | /* round up to nearest IOVP_SIZE */ | 753 | /* round up to nearest IOVP_SIZE */ |
754 | size = ROUNDUP(size + offset, IOVP_SIZE); | 754 | size = ALIGN(size + offset, IOVP_SIZE); |
755 | spin_lock_irqsave(&ioc->res_lock, flags); | 755 | spin_lock_irqsave(&ioc->res_lock, flags); |
756 | 756 | ||
757 | #ifdef CCIO_MAP_STATS | 757 | #ifdef CCIO_MAP_STATS |
@@ -814,7 +814,7 @@ ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size, | |||
814 | 814 | ||
815 | iova ^= offset; /* clear offset bits */ | 815 | iova ^= offset; /* clear offset bits */ |
816 | size += offset; | 816 | size += offset; |
817 | size = ROUNDUP(size, IOVP_SIZE); | 817 | size = ALIGN(size, IOVP_SIZE); |
818 | 818 | ||
819 | spin_lock_irqsave(&ioc->res_lock, flags); | 819 | spin_lock_irqsave(&ioc->res_lock, flags); |
820 | 820 | ||