Commit 70eef90e authored by Nanakos Chrysostomos's avatar Nanakos Chrysostomos Committed by Greg Kroah-Hartman

Staging: dt3155: dt3155_isr.c: Fix checkpatch.pl issues.

Fix resolves checkpatch.pl issues.
Signed-off-by: default avatarNanakos Chrysostomos <nanakos@wired-net.gr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0374e91c
...@@ -153,10 +153,12 @@ void push_ready(int m, int index) ...@@ -153,10 +153,12 @@ void push_ready(int m, int index)
*****************************************************/ *****************************************************/
static int get_tail(int m) static int get_tail(int m)
{ {
return (dt3155_fbuffer[m]->ready_head - int ncount;
dt3155_fbuffer[m]->ready_len + ncount = (dt3155_fbuffer[m]->ready_head -
dt3155_fbuffer[m]->nbuffers)% dt3155_fbuffer[m]->ready_len +
(dt3155_fbuffer[m]->nbuffers); dt3155_fbuffer[m]->nbuffers)%
(dt3155_fbuffer[m]->nbuffers);
return ncount;
} }
...@@ -191,23 +193,23 @@ void printques(int m) ...@@ -191,23 +193,23 @@ void printques(int m)
tail = get_tail(m); tail = get_tail(m);
printk("\n R:"); printk(KERN_INFO "\n R:");
for (index = tail; index != head; index++, index = index % (num)) { for (index = tail; index != head; index++, index = index % (num)) {
frame_index = dt3155_fbuffer[m]->ready_que[index]; frame_index = dt3155_fbuffer[m]->ready_que[index];
printk(" %d ", frame_index); printk(" %d ", frame_index);
} }
printk("\n E:"); printk(KERN_INFO "\n E:");
for (index = 0; index < dt3155_fbuffer[m]->empty_len; index++) { for (index = 0; index < dt3155_fbuffer[m]->empty_len; index++) {
frame_index = dt3155_fbuffer[m]->empty_buffers[index]; frame_index = dt3155_fbuffer[m]->empty_buffers[index];
printk(" %d ", frame_index); printk(" %d ", frame_index);
} }
frame_index = dt3155_fbuffer[m]->active_buf; frame_index = dt3155_fbuffer[m]->active_buf;
printk("\n A: %d", frame_index); printk(KERN_INFO "\n A: %d", frame_index);
frame_index = dt3155_fbuffer[m]->locked_buf; frame_index = dt3155_fbuffer[m]->locked_buf;
printk("\n L: %d\n", frame_index); printk(KERN_INFO "\n L: %d\n", frame_index);
} }
...@@ -263,19 +265,21 @@ void allocate_buffers(u32 *buf_addr, u32* total_size_kbs, ...@@ -263,19 +265,21 @@ void allocate_buffers(u32 *buf_addr, u32* total_size_kbs,
#endif #endif
size_kbs = full_size_kbs; size_kbs = full_size_kbs;
*buf_addr = 0; *buf_addr = 0;
printk("DT3155: We would like to get: %d KB\n", full_size_kbs); printk(KERN_INFO "DT3155: We would like to get: %d KB\n", full_size_kbs);
printk("DT3155: ...but need at least: %d KB\n", min_size_kbs); printk(KERN_INFO "DT3155: ...but need at least: %d KB\n", min_size_kbs);
printk("DT3155: ...the allocator has: %d KB\n", allocator_max); printk(KERN_INFO "DT3155: ...the allocator has: %d KB\n", allocator_max);
size_kbs = (full_size_kbs <= allocator_max ? full_size_kbs : allocator_max); size_kbs = (full_size_kbs <= allocator_max ? full_size_kbs : allocator_max);
if (size_kbs > min_size_kbs) { if (size_kbs > min_size_kbs) {
if ((*buf_addr = allocator_allocate_dma(size_kbs, GFP_KERNEL)) != 0) { *buf_addr = allocator_allocate_dma(size_kbs, GFP_KERNEL);
printk("DT3155: Managed to allocate: %d KB\n", size_kbs); if (*buf_addr != 0) {
printk(KERN_INFO "DT3155: Managed to allocate: %d KB\n",
size_kbs);
*total_size_kbs = size_kbs; *total_size_kbs = size_kbs;
return; return;
} }
} }
/* If we got here, the allocation failed */ /* If we got here, the allocation failed */
printk("DT3155: Allocator failed!\n"); printk(KERN_INFO "DT3155: Allocator failed!\n");
*buf_addr = 0; *buf_addr = 0;
*total_size_kbs = 0; *total_size_kbs = 0;
return; return;
...@@ -324,9 +328,9 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr) ...@@ -324,9 +328,9 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr)
/* allocate a large contiguous chunk of RAM */ /* allocate a large contiguous chunk of RAM */
allocate_buffers(&rambuff_addr, &rambuff_size, bufsize); allocate_buffers(&rambuff_addr, &rambuff_size, bufsize);
printk("DT3155: mem info\n"); printk(KERN_INFO "DT3155: mem info\n");
printk(" - rambuf_addr = 0x%x\n", rambuff_addr); printk(KERN_INFO " - rambuf_addr = 0x%x\n", rambuff_addr);
printk(" - length (kb) = %u\n", rambuff_size); printk(KERN_INFO " - length (kb) = %u\n", rambuff_size);
if (rambuff_addr == 0) { if (rambuff_addr == 0) {
printk(KERN_INFO printk(KERN_INFO
"DT3155: Error setup_buffers() allocator dma failed\n"); "DT3155: Error setup_buffers() allocator dma failed\n");
...@@ -339,7 +343,8 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr) ...@@ -339,7 +343,8 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr)
are so we can give an equal number to each device */ are so we can give an equal number to each device */
rambuff_acm = rambuff_addr; rambuff_acm = rambuff_addr;
for (index = 0; index < MAXBUFFERS; index++) { for (index = 0; index < MAXBUFFERS; index++) {
rambuff_acm = adjust_4MB(rambuff_acm, bufsize);/*avoid spanning 4MB bdry*/ /*avoid spanning 4MB bdry*/
rambuff_acm = adjust_4MB(rambuff_acm, bufsize);
if (rambuff_acm + bufsize > rambuff_end) if (rambuff_acm + bufsize > rambuff_end)
break; break;
rambuff_acm += bufsize; rambuff_acm += bufsize;
...@@ -347,7 +352,7 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr) ...@@ -347,7 +352,7 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr)
/* Following line is OK, will waste buffers if index /* Following line is OK, will waste buffers if index
* not evenly divisible by ndevices -NJC*/ * not evenly divisible by ndevices -NJC*/
numbufs = index / ndevices; numbufs = index / ndevices;
printk(" - numbufs = %u\n", numbufs); printk(KERN_INFO " - numbufs = %u\n", numbufs);
if (numbufs < 2) { if (numbufs < 2) {
printk(KERN_INFO printk(KERN_INFO
"DT3155: Error setup_buffers() couldn't allocate 2 bufs/board\n"); "DT3155: Error setup_buffers() couldn't allocate 2 bufs/board\n");
...@@ -367,7 +372,7 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr) ...@@ -367,7 +372,7 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr)
rambuff_acm = adjust_4MB(rambuff_acm, bufsize); rambuff_acm = adjust_4MB(rambuff_acm, bufsize);
if (rambuff_acm + bufsize > rambuff_end) { if (rambuff_acm + bufsize > rambuff_end) {
/* Should never happen */ /* Should never happen */
printk("DT3155 PROGRAM ERROR (GCS)\n" printk(KERN_INFO "DT3155 PROGRAM ERROR (GCS)\n"
"Error distributing allocated buffers\n"); "Error distributing allocated buffers\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -395,7 +400,7 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr) ...@@ -395,7 +400,7 @@ u32 dt3155_setup_buffers(u32 *allocatorAddr)
/* setup the ready queue */ /* setup the ready queue */
dt3155_fbuffer[m]->ready_head = 0; dt3155_fbuffer[m]->ready_head = 0;
dt3155_fbuffer[m]->ready_len = 0; dt3155_fbuffer[m]->ready_len = 0;
printk("Available buffers for device %d: %d\n", printk(KERN_INFO "Available buffers for device %d: %d\n",
m, dt3155_fbuffer[m]->nbuffers); m, dt3155_fbuffer[m]->nbuffers);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment