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

Commit b3d930aa authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Mauro Carvalho Chehab
Browse files

media: i2c: tvp5150: remove useless variable assignment in tvp5150_set_vbi()



Value assigned to variable _type_ at line 678 is overwritten at line 688
before it can be used. This makes such variable assignment useless.

Remove this variable assignment and fix some coding style issues.

Addresses-Coverity-ID: 1226968

Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d83bc7b6
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -675,27 +675,24 @@ static int tvp5150_set_vbi(struct v4l2_subdev *sd,
	while (regs->reg != (u16)-1) {
		if ((type & regs->type.vbi_type) &&
		    (line >= regs->type.ini_line) &&
		    (line<=regs->type.end_line)) {
			type=regs->type.vbi_type;
		    (line <= regs->type.end_line))
			break;
		}

		regs++;
		pos++;
	}

	if (regs->reg == (u16)-1)
		return 0;

	type = pos | (flags & 0xf0);
	reg = ((line - 6) << 1) + TVP5150_LINE_MODE_INI;

	if (fields&1) {
	if (fields & 1)
		tvp5150_write(sd, reg, type);
	}

	if (fields&2) {
	if (fields & 2)
		tvp5150_write(sd, reg + 1, type);
	}

	return type;
}