mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: crope@iki.fi
Cc: dhowells@redhat.com, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org
Subject: [PATCH] m88ts2022: Nested loops shouldn't use the same index variable
Date: Fri, 20 Mar 2015 13:37:38 +0000	[thread overview]
Message-ID: <20150320133738.19894.45270.stgit@warthog.procyon.org.uk> (raw)

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@redhat.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;
 		}


             reply	other threads:[~2015-03-20 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 13:37 David Howells [this message]
2015-03-20 14:41 ` Antti Palosaari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150320133738.19894.45270.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=crope@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®