Skip to contentSkip to conversation

ASoC: sun4i-i2s: fix odd_ptr_err.cocci warnings

PATCH In review Julia Lawall 2 participants 2 messages Oct 4, 2016 – Oct 5, 2016

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

PATCH 1/1 ASoC: sun4i-i2s: fix odd_ptr_err.cocci warnings

sound/soc/sunxi/sun4i-i2s.c:633:5-11: inconsistent IS_ERR and PTR_ERR on line 635.

PTR_ERR should normally access the value just tested by IS_ERR

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

---

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

 sun4i-i2s.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sunxi/sun4i-i2s.c +1 -1
@@ -632,7 +632,7 @@ static int sun4i_i2s_probe(struct platfo
 	reset_apb = devm_reset_control_get(&pdev->dev, "apb_reset");
 	if (IS_ERR(reset_apb)) {
 		dev_err(&pdev->dev, "Can't get apb reset\n");
-		return PTR_ERR(i2s->mod_clk);
+		return PTR_ERR(reset_apb);
 	}
 
 	ret = reset_control_deassert(reset_apb);
maintainer
#1 lore raw
Quoted 5 lines · Julia Lawall

sound/soc/sunxi/sun4i-i2s.c:633:5-11: inconsistent IS_ERR and PTR_ERR on line 635.

PTR_ERR should normally access the value just tested by IS_ERR

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

Looks like a good catch but this doesn't apply against current code, please check and resend.