Commit 8720427c authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] v4l2-core: don't break long lines

Due to the 80-cols restrictions, and latter due to checkpatch
warnings, several strings were broken into multiple lines. This
is not considered a good practice anymore, as it makes harder
to grep for strings at the source code.

As we're right now fixing other drivers due to KERN_CONT, we need
to be able to identify what printk strings don't end with a "\n".
It is a way easier to detect those if we don't break long lines.

So, join those continuation lines.

The patch was generated via the script below, and manually
adjusted if needed.

</script>
use Text::Tabs;
while (<>) {
	if ($next ne "") {
		$c=$_;
		if ($c =~ /^\s+\"(.*)/) {
			$c2=$1;
			$next =~ s/\"\n$//;
			$n = expand($next);
			$funpos = index($n, '(');
			$pos = index($c2, '",');
			if ($funpos && $pos > 0) {
				$s1 = substr $c2, 0, $pos + 2;
				$s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2;
				$s2 =~ s/^\s+//;

				$s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne "");

				print unexpand("$next$s1\n");
				print unexpand("$s2\n") if ($s2 ne "");
			} else {
				print "$next$c2\n";
			}
			$next="";
			next;
		} else {
			print $next;
		}
		$next="";
	} else {
		if (m/\"$/) {
			if (!m/\\n\"$/) {
				$next=$_;
				next;
			}
		}
	}
	print $_;
}
</script>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 3a611875
This diff is collapsed.
...@@ -572,8 +572,7 @@ int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b) ...@@ -572,8 +572,7 @@ int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b)
switch (b->memory) { switch (b->memory) {
case V4L2_MEMORY_MMAP: case V4L2_MEMORY_MMAP:
if (0 == buf->baddr) { if (0 == buf->baddr) {
dprintk(1, "qbuf: mmap requested " dprintk(1, "qbuf: mmap requested but buffer addr is zero!\n");
"but buffer addr is zero!\n");
goto done; goto done;
} }
if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT
......
...@@ -358,8 +358,8 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory, ...@@ -358,8 +358,8 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory,
if (memory == VB2_MEMORY_MMAP) { if (memory == VB2_MEMORY_MMAP) {
ret = __vb2_buf_mem_alloc(vb); ret = __vb2_buf_mem_alloc(vb);
if (ret) { if (ret) {
dprintk(1, "failed allocating memory for " dprintk(1, "failed allocating memory for buffer %d\n",
"buffer %d\n", buffer); buffer);
q->bufs[vb->index] = NULL; q->bufs[vb->index] = NULL;
kfree(vb); kfree(vb);
break; break;
...@@ -372,8 +372,8 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory, ...@@ -372,8 +372,8 @@ static int __vb2_queue_alloc(struct vb2_queue *q, enum vb2_memory memory,
*/ */
ret = call_vb_qop(vb, buf_init, vb); ret = call_vb_qop(vb, buf_init, vb);
if (ret) { if (ret) {
dprintk(1, "buffer %d %p initialization" dprintk(1, "buffer %d %p initialization failed\n",
" failed\n", buffer, vb); buffer, vb);
__vb2_buf_mem_free(vb); __vb2_buf_mem_free(vb);
q->bufs[vb->index] = NULL; q->bufs[vb->index] = NULL;
kfree(vb); kfree(vb);
...@@ -997,13 +997,12 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb) ...@@ -997,13 +997,12 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb)
&& vb->planes[plane].length == planes[plane].length) && vb->planes[plane].length == planes[plane].length)
continue; continue;
dprintk(3, "userspace address for plane %d changed, " dprintk(3, "userspace address for plane %d changed, reacquiring memory\n",
"reacquiring memory\n", plane); plane);
/* Check if the provided plane buffer is large enough */ /* Check if the provided plane buffer is large enough */
if (planes[plane].length < vb->planes[plane].min_length) { if (planes[plane].length < vb->planes[plane].min_length) {
dprintk(1, "provided buffer size %u is less than " dprintk(1, "provided buffer size %u is less than setup size %u for plane %d\n",
"setup size %u for plane %d\n",
planes[plane].length, planes[plane].length,
vb->planes[plane].min_length, vb->planes[plane].min_length,
plane); plane);
...@@ -1032,8 +1031,8 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb) ...@@ -1032,8 +1031,8 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const void *pb)
planes[plane].m.userptr, planes[plane].m.userptr,
planes[plane].length, dma_dir); planes[plane].length, dma_dir);
if (IS_ERR(mem_priv)) { if (IS_ERR(mem_priv)) {
dprintk(1, "failed acquiring userspace " dprintk(1, "failed acquiring userspace memory for plane %d\n",
"memory for plane %d\n", plane); plane);
ret = PTR_ERR(mem_priv); ret = PTR_ERR(mem_priv);
goto err; goto err;
} }
...@@ -1123,8 +1122,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb) ...@@ -1123,8 +1122,7 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const void *pb)
planes[plane].length = dbuf->size; planes[plane].length = dbuf->size;
if (planes[plane].length < vb->planes[plane].min_length) { if (planes[plane].length < vb->planes[plane].min_length) {
dprintk(1, "invalid dmabuf length %u for plane %d, " dprintk(1, "invalid dmabuf length %u for plane %d, minimum length %u\n",
"minimum length %u\n",
planes[plane].length, plane, planes[plane].length, plane,
vb->planes[plane].min_length); vb->planes[plane].min_length);
dma_buf_put(dbuf); dma_buf_put(dbuf);
...@@ -1472,8 +1470,7 @@ static int __vb2_wait_for_done_vb(struct vb2_queue *q, int nonblocking) ...@@ -1472,8 +1470,7 @@ static int __vb2_wait_for_done_vb(struct vb2_queue *q, int nonblocking)
} }
if (nonblocking) { if (nonblocking) {
dprintk(1, "nonblocking and no buffers to dequeue, " dprintk(1, "nonblocking and no buffers to dequeue, will not wait\n");
"will not wait\n");
return -EAGAIN; return -EAGAIN;
} }
......
...@@ -60,14 +60,13 @@ static int __verify_planes_array(struct vb2_buffer *vb, const struct v4l2_buffer ...@@ -60,14 +60,13 @@ static int __verify_planes_array(struct vb2_buffer *vb, const struct v4l2_buffer
/* Is memory for copying plane information present? */ /* Is memory for copying plane information present? */
if (b->m.planes == NULL) { if (b->m.planes == NULL) {
dprintk(1, "multi-planar buffer passed but " dprintk(1, "multi-planar buffer passed but planes array not provided\n");
"planes array not provided\n");
return -EINVAL; return -EINVAL;
} }
if (b->length < vb->num_planes || b->length > VB2_MAX_PLANES) { if (b->length < vb->num_planes || b->length > VB2_MAX_PLANES) {
dprintk(1, "incorrect planes array length, " dprintk(1, "incorrect planes array length, expected %d, got %d\n",
"expected %d, got %d\n", vb->num_planes, b->length); vb->num_planes, b->length);
return -EINVAL; return -EINVAL;
} }
...@@ -316,8 +315,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb, ...@@ -316,8 +315,7 @@ static int __fill_vb2_buffer(struct vb2_buffer *vb,
* that just says that it is either a top or a bottom field, * that just says that it is either a top or a bottom field,
* but not which of the two it is. * but not which of the two it is.
*/ */
dprintk(1, "the field is incorrectly set to ALTERNATE " dprintk(1, "the field is incorrectly set to ALTERNATE for an output buffer\n");
"for an output buffer\n");
return -EINVAL; return -EINVAL;
} }
vb->timestamp = 0; vb->timestamp = 0;
......
...@@ -151,8 +151,7 @@ static void *vb2_vmalloc_vaddr(void *buf_priv) ...@@ -151,8 +151,7 @@ static void *vb2_vmalloc_vaddr(void *buf_priv)
struct vb2_vmalloc_buf *buf = buf_priv; struct vb2_vmalloc_buf *buf = buf_priv;
if (!buf->vaddr) { if (!buf->vaddr) {
pr_err("Address of an unallocated plane requested " pr_err("Address of an unallocated plane requested or cannot map user pointer\n");
"or cannot map user pointer\n");
return NULL; return NULL;
} }
......
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