Skip to content

Commit 67e6590

Browse files
dhowellsmchehab
authored andcommitted
[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: David Howells <[email protected]> Signed-off-by: Antti Palosaari <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 0fd68f2 commit 67e6590

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/media/tuners/m88ts2022.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
static int m88ts2022_cmd(struct m88ts2022_dev *dev, int op, int sleep, u8 reg,
2222
u8 mask, u8 val, u8 *reg_val)
2323
{
24-
int ret, i;
24+
int ret, i, j;
2525
unsigned int utmp;
2626
struct m88ts2022_reg_val reg_vals[] = {
2727
{0x51, 0x1f - op},
@@ -35,9 +35,9 @@ static int m88ts2022_cmd(struct m88ts2022_dev *dev, int op, int sleep, u8 reg,
3535
"i=%d op=%02x reg=%02x mask=%02x val=%02x\n",
3636
i, op, reg, mask, val);
3737

38-
for (i = 0; i < ARRAY_SIZE(reg_vals); i++) {
39-
ret = regmap_write(dev->regmap, reg_vals[i].reg,
40-
reg_vals[i].val);
38+
for (j = 0; j < ARRAY_SIZE(reg_vals); j++) {
39+
ret = regmap_write(dev->regmap, reg_vals[j].reg,
40+
reg_vals[j].val);
4141
if (ret)
4242
goto err;
4343
}

0 commit comments

Comments
 (0)