Skip to contentSkip to conversation

ASoC: fix odd_ptr_err.cocci warnings (fwd)

PATCH In review Julia Lawall 3 participants 3 messages Apr 21, 2017 – Apr 24, 2017

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

PATCH 1/1 ASoC: fix odd_ptr_err.cocci warnings (fwd)

I don't think the patch is correct, so I haven't bothered signing off on it. Probably the & is not correct in the IS_ERR call?

julia

---------- Forwarded message ----------
Date: Sat, 22 Apr 2017 06:09:26 +0800
From: kbuild test robot <[email protected]>
To: [email protected]
Cc: Julia Lawall <[email protected]>
Subject: [PATCH] ASoC: fix odd_ptr_err.cocci warnings

PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
There can be false positives in the patch case, where it is the call to IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

---

Please take the patch only if it's a positive warning. Thanks!

 cx2072x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cx2072x.c +1 -1
@@ -2183,7 +2183,7 @@ static int cx2072x_i2c_probe(struct i2c_
 		&cx2072x_regmap);
 
 	if (IS_ERR(&cx2072x->regmap)) {
-		ret = PTR_ERR(cx2072x->regmap);
+		ret = PTR_ERR(&cx2072x->regmap);
 		dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret);
 		return ret;
 	}
#1 lore raw
Quoted 3 lines · Julia Lawall

I don't think the patch is correct, so I haven't bothered signing off on it. Probably the & is not correct in the IS_ERR call?

Yes, IS_ERR() was called with the wrong argument. I fixed it now.

Note that it's no branch to be merged to upstream yet, it's just a testing for the previously submitted patchset.

Simon, my latest version is found in topic/soc-cx2072x branch in sound git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git

Please check that before the next submission.

thanks,

Takashi

Quoted 39 lines

julia

---------- Forwarded message ----------
Date: Sat, 22 Apr 2017 06:09:26 +0800
From: kbuild test robot <[email protected]>
To: [email protected]
Cc: Julia Lawall <[email protected]>
Subject: [PATCH] ASoC: fix odd_ptr_err.cocci warnings

PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
There can be false positives in the patch case, where it is the call to IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

---

Please take the patch only if it's a positive warning. Thanks!

 cx2072x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cx2072x.c +1 -1
@@ -2183,7 +2183,7 @@ static int cx2072x_i2c_probe(struct i2c_
 		&cx2072x_regmap);
 
 	if (IS_ERR(&cx2072x->regmap)) {
-		ret = PTR_ERR(cx2072x->regmap);
+		ret = PTR_ERR(&cx2072x->regmap);
 		dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret);
 		return ret;
 	}
#2 lore raw
Quoted 15 lines · Takashi Iwai
Quoted 3 lines · Julia Lawall

I don't think the patch is correct, so I haven't bothered signing off on it. Probably the & is not correct in the IS_ERR call?

Yes, IS_ERR() was called with the wrong argument. I fixed it now.

Note that it's no branch to be merged to upstream yet, it's just a testing for the previously submitted patchset.

Simon, my latest version is found in topic/soc-cx2072x branch in sound git tree:
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git

Quoted 7 lines

Please check that before the next submission.

thanks,

Takashi

I will merge this to my new patch, thank you for all your assistance.

Thanks,

Simon

Quoted 43 lines
Quoted 31 lines

julia

---------- Forwarded message ----------
Date: Sat, 22 Apr 2017 06:09:26 +0800
From: kbuild test robot <[email protected]>
To: [email protected]
Cc: Julia Lawall <[email protected]>
Subject: [PATCH] ASoC: fix odd_ptr_err.cocci warnings

PTR_ERR should access the value just tested by IS_ERR

Semantic patch information:
There can be false positives in the patch case, where it is the call to IS_ERR that is wrong.

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

---

Please take the patch only if it's a positive warning. Thanks!

 cx2072x.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

sound/soc/codecs/cx2072x.c static int cx2072x_i2c_probe(struct i2c_ · line 2189

Quoted 8 lines
sound/soc/codecs/cx2072x.c +1 -1
@@ -2183,7 +2183,7 @@ static int cx2072x_i2c_probe(struct i2c_
 		&cx2072x_regmap);
 
 	if (IS_ERR(&cx2072x->regmap)) {
-		ret = PTR_ERR(cx2072x->regmap);
+		ret = PTR_ERR(&cx2072x->regmap);
 		dev_err(&i2c->dev, "Failed to init regmap: %d\n", ret);
 		return ret;
 	}

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel