X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fparisc%2Fccio-dma.c;h=7c60cbd85dc8505883e14ad9091f456badfdb427;hb=444ad82bc3eaa554be40d22dc248e58aeefd54d9;hp=fe3f5f5365c555abdef1546e7e0868b79bc8bea3;hpb=ea14fad0d416354a4e9bb1a04f32acba706f9548;p=linux-2.6 diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index fe3f5f5365..7c60cbd85d 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -41,6 +42,7 @@ #include #include #include +#include #include #include /* for L1_CACHE_BYTES */ @@ -292,7 +294,6 @@ static int ioc_count; #define PDIR_INDEX(iovp) ((iovp)>>IOVP_SHIFT) #define MKIOVP(pdir_idx) ((long)(pdir_idx) << IOVP_SHIFT) #define MKIOVA(iovp,offset) (dma_addr_t)((long)iovp | (long)offset) -#define ROUNDUP(x,y) ((x + ((y)-1)) & ~((y)-1)) /* ** Don't worry about the 150% average search length on a miss. @@ -668,7 +669,7 @@ ccio_mark_invalid(struct ioc *ioc, dma_addr_t iova, size_t byte_cnt) size_t saved_byte_cnt; /* round up to nearest page size */ - saved_byte_cnt = byte_cnt = ROUNDUP(byte_cnt, IOVP_SIZE); + saved_byte_cnt = byte_cnt = ALIGN(byte_cnt, IOVP_SIZE); while(byte_cnt > 0) { /* invalidate one page at a time */ @@ -751,7 +752,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size, offset = ((unsigned long) addr) & ~IOVP_MASK; /* round up to nearest IOVP_SIZE */ - size = ROUNDUP(size + offset, IOVP_SIZE); + size = ALIGN(size + offset, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); #ifdef CCIO_MAP_STATS @@ -814,7 +815,7 @@ ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size, iova ^= offset; /* clear offset bits */ size += offset; - size = ROUNDUP(size, IOVP_SIZE); + size = ALIGN(size, IOVP_SIZE); spin_lock_irqsave(&ioc->res_lock, flags); @@ -1091,7 +1092,7 @@ static int ccio_proc_info_open(struct inode *inode, struct file *file) return single_open(file, &ccio_proc_info, NULL); } -static struct file_operations ccio_proc_info_fops = { +static const struct file_operations ccio_proc_info_fops = { .owner = THIS_MODULE, .open = ccio_proc_info_open, .read = seq_read, @@ -1127,7 +1128,7 @@ static int ccio_proc_bitmap_open(struct inode *inode, struct file *file) return single_open(file, &ccio_proc_bitmap_info, NULL); } -static struct file_operations ccio_proc_bitmap_fops = { +static const struct file_operations ccio_proc_bitmap_fops = { .owner = THIS_MODULE, .open = ccio_proc_bitmap_open, .read = seq_read, @@ -1227,7 +1228,7 @@ ccio_get_iotlb_size(struct parisc_device *dev) #endif /* 0 */ /* We *can't* support JAVA (T600). Venture there at your own risk. */ -static struct parisc_device_id ccio_tbl[] = { +static const struct parisc_device_id ccio_tbl[] = { { HPHW_IOA, HVERSION_REV_ANY_ID, U2_IOA_RUNWAY, 0xb }, /* U2 */ { HPHW_IOA, HVERSION_REV_ANY_ID, UTURN_IOA_RUNWAY, 0xb }, /* UTurn */ { 0, } @@ -1370,7 +1371,7 @@ ccio_ioc_init(struct ioc *ioc) } } -static void +static void __init ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr) { int result; @@ -1537,7 +1538,7 @@ int ccio_request_resource(const struct parisc_device *dev, * If so, initialize the chip and tell other partners in crime they * have work to do. */ -static int ccio_probe(struct parisc_device *dev) +static int __init ccio_probe(struct parisc_device *dev) { int i; struct ioc *ioc, **ioc_p = &ioc_list;