linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nathan Chancellor <natechancellor@gmail.com>
Subject: [PATCH] media: imx214: Remove unnecessary self assignment in for loop
Date: Tue,  6 Nov 2018 23:24:50 -0700	[thread overview]
Message-ID: <20181107062450.5511-1-natechancellor@gmail.com> (raw)

Clang warns when a variable is assigned to itself:

drivers/media/i2c/imx214.c:695:13: error: explicitly assigning value of
variable of type 'const struct reg_8 *' to itself
[-Werror,-Wself-assign]
        for (table = table; table->addr != IMX214_TABLE_END ; table++) {
             ~~~~~ ^ ~~~~~
1 error generated.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
 drivers/media/i2c/imx214.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
index 284b9b49ebde..ec3d1b855f62 100644
--- a/drivers/media/i2c/imx214.c
+++ b/drivers/media/i2c/imx214.c
@@ -692,7 +692,7 @@ static int imx214_write_table(struct imx214 *imx214,
 	int i;
 	int ret;
 
-	for (table = table; table->addr != IMX214_TABLE_END ; table++) {
+	for (; table->addr != IMX214_TABLE_END ; table++) {
 		if (table->addr == IMX214_TABLE_WAIT_MS) {
 			usleep_range(table->val * 1000,
 				     table->val * 1000 + 500);
-- 
2.19.1


                 reply	other threads:[~2018-11-07  6:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20181107062450.5511-1-natechancellor@gmail.com \
    --to=natechancellor@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ricardo.ribalda@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).