Skip to contentSkip to conversation

media: imx214: Remove unnecessary self assignment in for loop

PATCH New Nathan Chancellor 1 participant 1 message Nov 7, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: imx214: Remove unnecessary self assignment in for loop

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.

---
 drivers/media/i2c/imx214.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/i2c/imx214.c +1 -1
index 284b9b49ebde..ec3d1b855f62 100644
@@ -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);
Signature · 1 line
2.19.1