Commit 67e6590a authored by David Howells's avatar David Howells Committed by Mauro Carvalho Chehab

[media] m88ts2022: Nested loops shouldn't use the same index variable

There are a pair of nested loops inside m88ts2022_cmd() that use the same
index variable, but for different things.  Split the variable.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 0fd68f2f
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
static int m88ts2022_cmd(struct m88ts2022_dev *dev, int op, int sleep, u8 reg, static int m88ts2022_cmd(struct m88ts2022_dev *dev, int op, int sleep, u8 reg,
u8 mask, u8 val, u8 *reg_val) u8 mask, u8 val, u8 *reg_val)
{ {
int ret, i; int ret, i, j;
unsigned int utmp; unsigned int utmp;
struct m88ts2022_reg_val reg_vals[] = { struct m88ts2022_reg_val reg_vals[] = {
{0x51, 0x1f - op}, {0x51, 0x1f - op},
...@@ -35,9 +35,9 @@ static int m88ts2022_cmd(struct m88ts2022_dev *dev, int op, int sleep, u8 reg, ...@@ -35,9 +35,9 @@ static int m88ts2022_cmd(struct m88ts2022_dev *dev, int op, int sleep, u8 reg,
"i=%d op=%02x reg=%02x mask=%02x val=%02x\n", "i=%d op=%02x reg=%02x mask=%02x val=%02x\n",
i, op, reg, mask, val); i, op, reg, mask, val);
for (i = 0; i < ARRAY_SIZE(reg_vals); i++) { for (j = 0; j < ARRAY_SIZE(reg_vals); j++) {
ret = regmap_write(dev->regmap, reg_vals[i].reg, ret = regmap_write(dev->regmap, reg_vals[j].reg,
reg_vals[i].val); reg_vals[j].val);
if (ret) if (ret)
goto err; goto err;
} }
......
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