lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150320133738.19894.45270.stgit@warthog.procyon.org.uk>
Date:	Fri, 20 Mar 2015 13:37:38 +0000
From:	David Howells <dhowells@...hat.com>
To:	crope@....fi
Cc:	dhowells@...hat.com, linux-kernel@...r.kernel.org,
	linux-media@...r.kernel.org
Subject: [PATCH] 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 <dhowells@...hat.com>
---

 drivers/media/tuners/m88ts2022.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/media/tuners/m88ts2022.c b/drivers/media/tuners/m88ts2022.c
index 066e543..cdf9fe5 100644
--- a/drivers/media/tuners/m88ts2022.c
+++ b/drivers/media/tuners/m88ts2022.c
@@ -21,7 +21,7 @@
 static int m88ts2022_cmd(struct m88ts2022_dev *dev, int op, int sleep, u8 reg,
 		u8 mask, u8 val, u8 *reg_val)
 {
-	int ret, i;
+	int ret, i, j;
 	unsigned int utmp;
 	struct m88ts2022_reg_val reg_vals[] = {
 		{0x51, 0x1f - op},
@@ -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, op, reg, mask, val);
 
-		for (i = 0; i < ARRAY_SIZE(reg_vals); i++) {
-			ret = regmap_write(dev->regmap, reg_vals[i].reg,
-					reg_vals[i].val);
+		for (j = 0; j < ARRAY_SIZE(reg_vals); j++) {
+			ret = regmap_write(dev->regmap, reg_vals[j].reg,
+					reg_vals[j].val);
 			if (ret)
 				goto err;
 		}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ