Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 473d8024 authored by Julia Lawall's avatar Julia Lawall Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB: drivers/media/video: Adjust confusing if indentation

In cx23885/cx23885-video.c, cx88/cx88-video.c, davinci/vpif_capture.c, and
davinci/vpif_display.c, group the aligned code into a single if branch.

In saa7134/saa7134-video.c, outdent the code following the if.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/

)

// <smpl>
@r disable braces4@
position p1,p2;
statement S1,S2;
@@

(
if (...) { ... }
|
if (...) S1@p1 S2@p2
)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

if (p1[0].column == p2[0].column):
  cocci.print_main("branch",p1)
  cocci.print_secs("after",p2)
// </smpl>

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6c2d4dd1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1165,9 +1165,10 @@ static int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i)
	i->type  = V4L2_INPUT_TYPE_CAMERA;
	strcpy(i->name, iname[INPUT(n)->type]);
	if ((CX23885_VMUX_TELEVISION == INPUT(n)->type) ||
		(CX23885_VMUX_CABLE == INPUT(n)->type))
		(CX23885_VMUX_CABLE == INPUT(n)->type)) {
		i->type = V4L2_INPUT_TYPE_TUNER;
		i->std = CX23885_NORMS;
	}
	return 0;
}

+2 −1
Original line number Diff line number Diff line
@@ -1267,9 +1267,10 @@ int cx88_enum_input (struct cx88_core *core,struct v4l2_input *i)
	i->type  = V4L2_INPUT_TYPE_CAMERA;
	strcpy(i->name,iname[INPUT(n).type]);
	if ((CX88_VMUX_TELEVISION == INPUT(n).type) ||
	    (CX88_VMUX_CABLE      == INPUT(n).type))
	    (CX88_VMUX_CABLE      == INPUT(n).type)) {
		i->type = V4L2_INPUT_TYPE_TUNER;
		i->std = CX88_NORMS;
	}
	return 0;
}
EXPORT_SYMBOL(cx88_enum_input);
+2 −1
Original line number Diff line number Diff line
@@ -1030,9 +1030,10 @@ static int vpif_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
			goto qbuf_exit;

		if ((VIDEOBUF_NEEDS_INIT != buf1->state)
			    && (buf1->baddr != tbuf.m.userptr))
			    && (buf1->baddr != tbuf.m.userptr)) {
			vpif_buffer_release(&common->buffer_queue, buf1);
			buf1->baddr = tbuf.m.userptr;
		}
		break;

	default:
+2 −1
Original line number Diff line number Diff line
@@ -935,9 +935,10 @@ static int vpif_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
			goto qbuf_exit;

		if ((VIDEOBUF_NEEDS_INIT != buf1->state)
			    && (buf1->baddr != tbuf.m.userptr))
			    && (buf1->baddr != tbuf.m.userptr)) {
			vpif_buffer_release(&common->buffer_queue, buf1);
			buf1->baddr = tbuf.m.userptr;
		}
		break;

	default:
+1 −1

File changed.

Contains only whitespace changes.