Category: Linux

pinctrl-tegra: add missing of_node_put

Author: Julia Lawall <Julia.Lawall@lip6.fr> for_each_child_of_node performs an of_node_get on each iteration, so a return from the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ local idexpression n; expression e,e1; @@ for_each_child_of_node(e1,n) { … ( of_node_put(n); | e = n | return n; …

Continue reading

ASoC: Intel: add NULL test

Author: Julia Lawall <Julia.Lawall@lip6.fr> Add NULL test on call to devm_kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; identifier fld; @@ * x = devm_kzalloc(…); … when != x == NULL x->fld // Signed-off-by: Julia Lawall Signed-off-by: Mark Brown — sound/soc/intel/baytrail/sst-baytrail-pcm.c | 2 ++ 1 file changed, …

Continue reading

s390/cio: add NULL test

Author: Julia Lawall <Julia.Lawall@lip6.fr> Add NULL test on call to kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; identifier fld; @@ * x = kzalloc(…); … when != x == NULL x->fld // Signed-off-by: Julia Lawall Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky — drivers/s390/char/con3215.c | 2 ++ …

Continue reading

ASoC: omap-hdmi-audio: add NULL test

Author: Julia Lawall <Julia.Lawall@lip6.fr> Add NULL test on call to devm_kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; identifier fld; @@ * x = devm_kzalloc(…); … when != x == NULL x->fld // Signed-off-by: Julia Lawall Acked-by: Peter Ujfalusi Signed-off-by: Mark Brown — sound/soc/omap/omap-hdmi-audio.c | 2 ++ …

Continue reading

ASoC: imx-pcm-dma: add NULL test

Author: Julia Lawall <Julia.Lawall@lip6.fr> Add NULL test on call to devm_kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ * x = devm_kzalloc(…); … when != x == NULL *x // Signed-off-by: Julia Lawall Acked-by: Nicolin Chen Signed-off-by: Mark Brown — sound/soc/fsl/imx-pcm-dma.c | 2 ++ 1 file …

Continue reading

ASoC: ssm2518: Use a signed return type for ssm2518_lookup_mcs()

Author: Markus Elfring <elfring@users.sourceforge.net> The return type “unsigned int” was used by the ssm2518_lookup_mcs() function even though it will eventually return a negative error code. Improve this implementation detail by deletion of the type modifier then. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Mark Brown — sound/soc/codecs/ssm2518.c | 2 …

Continue reading

IB/usnic: delete unneeded IS_ERR test

Author: Julia Lawall <Julia.Lawall@lip6.fr> kzalloc doesn’t return ERR_PTR, so there is no need to test for it. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,e; @@ * x = kzalloc(…) … when != x = e * IS_ERR_OR_NULL(x) // Signed-off-by: Julia Lawall Reviewed-by: Dave Goodell Signed-off-by: Doug Ledford …

Continue reading

regulator: lp8788: constify regulator_ops structures

Author: Julia Lawall <Julia.Lawall@lip6.fr> The regulator_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Acked-by: Milo Kim Signed-off-by: Mark Brown — drivers/regulator/lp8788-buck.c | 4 ++– drivers/regulator/lp8788-ldo.c | 4 ++– 2 files changed, 4 insertions(+), 4 deletions(-)   diff –git a/drivers/regulator/lp8788-buck.c b/drivers/regulator/lp8788-buck.c index a97bed9..ec46290 100644 — …

Continue reading

regulator: wm8*: constify regulator_ops structures

Author: Julia Lawall <Julia.Lawall@lip6.fr> The regulator_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Acked-by: Charles Keepax Signed-off-by: Mark Brown — drivers/regulator/wm831x-dcdc.c | 8 ++++—- drivers/regulator/wm831x-isink.c | 2 +- drivers/regulator/wm831x-ldo.c | 6 +++— drivers/regulator/wm8350-regulator.c | 8 ++++—- drivers/regulator/wm8400-regulator.c | 4 ++– drivers/regulator/wm8994-regulator.c | 4 ++– …

Continue reading

regulator: da9*: constify regulator_ops structures

Author: Julia Lawall <Julia.Lawall@lip6.fr> The regulator_ops structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Mark Brown — drivers/regulator/da903x.c | 10 +++++—– drivers/regulator/da9052-regulator.c | 4 ++– drivers/regulator/da9055-regulator.c | 4 ++– drivers/regulator/da9062-regulator.c | 4 ++– drivers/regulator/da9063-regulator.c | 4 ++– drivers/regulator/da9210-regulator.c | 2 +- drivers/regulator/da9211-regulator.c | 2 …

Continue reading