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

Commit 0f28b793 authored by roel kluin's avatar roel kluin Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (10064): mt9m111: mt9m111_get_global_gain() - unsigned >= 0 is always true



unsigned >= 0 is always true and fix formula

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d25cb646
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -634,18 +634,15 @@ static int mt9m111_set_flip(struct soc_camera_device *icd, int flip, int mask)

static int mt9m111_get_global_gain(struct soc_camera_device *icd)
{
	unsigned int data, gain;
	int data;

	data = reg_read(GLOBAL_GAIN);
	if (data >= 0)
		gain = ((data & (1 << 10)) * 2)
			| ((data & (1 << 9)) * 2)
			| (data & 0x2f);
	else
		gain = data;

	return gain;
		return (data & 0x2f) * (1 << ((data >> 10) & 1)) *
			(1 << ((data >> 9) & 1));
	return data;
}

static int mt9m111_set_global_gain(struct soc_camera_device *icd, int gain)
{
	u16 val;