diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-02-09 12:41:38 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 16:42:56 -0800 |
commit | dcff74ce8b458792c1628ad9f3803fc648f94e11 (patch) | |
tree | 483c32cbb88f83ae0a378d545e415ade80106ab2 /drivers/staging/dt3155/dt3155_isr.c | |
parent | 5d3921117d7c3bfec5a5877ba0be0430e2aec491 (diff) | |
download | linux-stable-dcff74ce8b458792c1628ad9f3803fc648f94e11.tar.gz linux-stable-dcff74ce8b458792c1628ad9f3803fc648f94e11.tar.bz2 linux-stable-dcff74ce8b458792c1628ad9f3803fc648f94e11.zip |
Staging: dt3155: replace u_int and u_long usage
Use u32 and u64 instead, that's the proper thing to do.
Cc: Scott Smedley <ss@aao.gov.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/dt3155/dt3155_isr.c')
-rw-r--r-- | drivers/staging/dt3155/dt3155_isr.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/staging/dt3155/dt3155_isr.c b/drivers/staging/dt3155/dt3155_isr.c index faed085d4fc7..5b790867c292 100644 --- a/drivers/staging/dt3155/dt3155_isr.c +++ b/drivers/staging/dt3155/dt3155_isr.c @@ -220,7 +220,7 @@ inline void printques( int m ) * the start address up to the beginning of the * next 4MB chunk (assuming bufsize < 4MB). *****************************************************/ -u_long adjust_4MB (u_long buf_addr, u_long bufsize) { +u64 adjust_4MB (u64 buf_addr, u64 bufsize) { if (((buf_addr+bufsize) & UPPER_10_BITS) != (buf_addr & UPPER_10_BITS)) return (buf_addr+bufsize) & UPPER_10_BITS; else @@ -235,26 +235,26 @@ u_long adjust_4MB (u_long buf_addr, u_long bufsize) { * buffers. If there is not enough free space * try for less memory. *****************************************************/ -void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs, - u_long bufsize) +void allocate_buffers (u64 *buf_addr, u64* total_size_kbs, + u64 bufsize) { /* Compute the minimum amount of memory guaranteed to hold all MAXBUFFERS such that no buffer crosses the 4MB boundary. Store this value in the variable "full_size" */ - u_long allocator_max; - u_long bufs_per_chunk = (FOUR_MB / bufsize); - u_long filled_chunks = (MAXBUFFERS-1) / bufs_per_chunk; - u_long leftover_bufs = MAXBUFFERS - filled_chunks * bufs_per_chunk; + u64 allocator_max; + u64 bufs_per_chunk = (FOUR_MB / bufsize); + u64 filled_chunks = (MAXBUFFERS-1) / bufs_per_chunk; + u64 leftover_bufs = MAXBUFFERS - filled_chunks * bufs_per_chunk; - u_long full_size = bufsize /* possibly unusable part of 1st chunk */ + u64 full_size = bufsize /* possibly unusable part of 1st chunk */ + filled_chunks * FOUR_MB /* max # of completely filled 4mb chunks */ + leftover_bufs * bufsize; /* these buffs will be in a partly filled chunk at beginning or end */ - u_long full_size_kbs = 1 + (full_size-1) / 1024; - u_long min_size_kbs = 2*ndevices*bufsize / 1024; - u_long size_kbs; + u64 full_size_kbs = 1 + (full_size-1) / 1024; + u64 min_size_kbs = 2*ndevices*bufsize / 1024; + u64 size_kbs; /* Now, try to allocate full_size. If this fails, keep trying for less & less memory until it succeeds. */ @@ -264,13 +264,13 @@ void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs, #endif size_kbs = full_size_kbs; *buf_addr = 0; - printk ("DT3155: We would like to get: %d KB\n", (u_int)(full_size_kbs)); - printk ("DT3155: ...but need at least: %d KB\n", (u_int)(min_size_kbs)); - printk ("DT3155: ...the allocator has: %d KB\n", (u_int)(allocator_max)); + printk ("DT3155: We would like to get: %d KB\n", (u32)(full_size_kbs)); + printk ("DT3155: ...but need at least: %d KB\n", (u32)(min_size_kbs)); + printk ("DT3155: ...the allocator has: %d KB\n", (u32)(allocator_max)); size_kbs = (full_size_kbs <= allocator_max ? full_size_kbs : allocator_max); if (size_kbs > min_size_kbs) { if ((*buf_addr = allocator_allocate_dma (size_kbs, GFP_KERNEL)) != 0) { - printk ("DT3155: Managed to allocate: %d KB\n", (u_int)size_kbs); + printk ("DT3155: Managed to allocate: %d KB\n", (u32)size_kbs); *total_size_kbs = size_kbs; return; } @@ -298,17 +298,17 @@ void allocate_buffers (u_long *buf_addr, u_long* total_size_kbs, * 4MB boundary. Also, add error checking. This * function will return -ENOMEM when not enough memory. *****************************************************/ -u_long dt3155_setup_buffers(u_long *allocatorAddr) +u64 dt3155_setup_buffers(u64 *allocatorAddr) { - u_long index; - u_long rambuff_addr; /* start of allocation */ - u_long rambuff_size; /* total size allocated to driver */ - u_long rambuff_acm; /* accumlator, keep track of how much + u64 index; + u64 rambuff_addr; /* start of allocation */ + u64 rambuff_size; /* total size allocated to driver */ + u64 rambuff_acm; /* accumlator, keep track of how much is left after being split up*/ - u_long rambuff_end; /* end of rambuff */ - u_long numbufs; /* number of useful buffers allocated (per device) */ - u_long bufsize = DT3155_MAX_ROWS * DT3155_MAX_COLS; + u64 rambuff_end; /* end of rambuff */ + u64 numbufs; /* number of useful buffers allocated (per device) */ + u64 bufsize = DT3155_MAX_ROWS * DT3155_MAX_COLS; int m; /* minor # of device, looped for all devs */ /* zero the fbuffer status and address structure */ @@ -327,8 +327,8 @@ u_long dt3155_setup_buffers(u_long *allocatorAddr) /* allocate a large contiguous chunk of RAM */ allocate_buffers (&rambuff_addr, &rambuff_size, bufsize); printk( "DT3155: mem info\n" ); - printk( " - rambuf_addr = 0x%x \n", (u_int)rambuff_addr ); - printk( " - length (kb) = %u \n", (u_int)rambuff_size ); + printk( " - rambuf_addr = 0x%x \n", (u32)rambuff_addr ); + printk( " - length (kb) = %u \n", (u32)rambuff_size ); if( rambuff_addr == 0 ) { printk( KERN_INFO @@ -350,7 +350,7 @@ u_long dt3155_setup_buffers(u_long *allocatorAddr) /* Following line is OK, will waste buffers if index * not evenly divisible by ndevices -NJC*/ numbufs = index / ndevices; - printk (" - numbufs = %u\n", (u_int) numbufs); + printk (" - numbufs = %u\n", (u32) numbufs); if (numbufs < 2) { printk( KERN_INFO "DT3155: Error setup_buffers() couldn't allocate 2 bufs/board\n" ); |