*****************************************************/
static int get_tail(int m)
{
- return (dt3155_fbuffer[m]->ready_head -
- dt3155_fbuffer[m]->ready_len +
- dt3155_fbuffer[m]->nbuffers)%
- (dt3155_fbuffer[m]->nbuffers);
+ int ncount;
+ ncount = (dt3155_fbuffer[m]->ready_head -
+ dt3155_fbuffer[m]->ready_len +
+ dt3155_fbuffer[m]->nbuffers)%
+ (dt3155_fbuffer[m]->nbuffers);
+ return ncount;
}
tail = get_tail(m);
- printk("\n R:");
+ printk(KERN_INFO "\n R:");
for (index = tail; index != head; index++, index = index % (num)) {
frame_index = dt3155_fbuffer[m]->ready_que[index];
printk(" %d ", frame_index);
}
- printk("\n E:");
+ printk(KERN_INFO "\n E:");
for (index = 0; index < dt3155_fbuffer[m]->empty_len; index++) {
frame_index = dt3155_fbuffer[m]->empty_buffers[index];
printk(" %d ", frame_index);
}
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;
- printk("\n L: %d\n", frame_index);
+ printk(KERN_INFO "\n L: %d\n", frame_index);
}
#endif
size_kbs = full_size_kbs;
*buf_addr = 0;
- printk("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("DT3155: ...the allocator has: %d KB\n", allocator_max);
+ printk(KERN_INFO "DT3155: We would like to get: %d KB\n", full_size_kbs);
+ printk(KERN_INFO "DT3155: ...but need at least: %d KB\n", min_size_kbs);
+ printk(KERN_INFO "DT3155: ...the allocator has: %d KB\n", 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", size_kbs);
+ *buf_addr = allocator_allocate_dma(size_kbs, GFP_KERNEL);
+ if (*buf_addr != 0) {
+ printk(KERN_INFO "DT3155: Managed to allocate: %d KB\n",
+ size_kbs);
*total_size_kbs = size_kbs;
return;
}
}
/* If we got here, the allocation failed */
- printk("DT3155: Allocator failed!\n");
+ printk(KERN_INFO "DT3155: Allocator failed!\n");
*buf_addr = 0;
*total_size_kbs = 0;
return;
/* 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", rambuff_addr);
- printk(" - length (kb) = %u\n", rambuff_size);
+ printk(KERN_INFO "DT3155: mem info\n");
+ printk(KERN_INFO " - rambuf_addr = 0x%x\n", rambuff_addr);
+ printk(KERN_INFO " - length (kb) = %u\n", rambuff_size);
if (rambuff_addr == 0) {
printk(KERN_INFO
"DT3155: Error setup_buffers() allocator dma failed\n");
are so we can give an equal number to each device */
rambuff_acm = rambuff_addr;
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)
break;
rambuff_acm += bufsize;
/* Following line is OK, will waste buffers if index
* not evenly divisible by ndevices -NJC*/
numbufs = index / ndevices;
- printk(" - numbufs = %u\n", numbufs);
+ printk(KERN_INFO " - numbufs = %u\n", numbufs);
if (numbufs < 2) {
printk(KERN_INFO
"DT3155: Error setup_buffers() couldn't allocate 2 bufs/board\n");
rambuff_acm = adjust_4MB(rambuff_acm, bufsize);
if (rambuff_acm + bufsize > rambuff_end) {
/* Should never happen */
- printk("DT3155 PROGRAM ERROR (GCS)\n"
+ printk(KERN_INFO "DT3155 PROGRAM ERROR (GCS)\n"
"Error distributing allocated buffers\n");
return -ENOMEM;
}
/* setup the ready queue */
dt3155_fbuffer[m]->ready_head = 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);
}