linux/sound/soc/davinci
Julia Lawall 02ffc5f3f9 ASoC: davinci-mcasp.c: Return error code in failure
In this code, 0 is returned on failure, even though other
failures return -ENOMEM or other similar values.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@a@
identifier alloc;
identifier ret;
constant C;
expression x;
@@

x = alloc(...);
if (x == NULL) { <+... \(ret = -C; \| return -C; \) ...+> }

@@
identifier f, a.alloc;
expression ret;
expression x,e1,e2,e3;
@@

ret = 0
... when != ret = e1
*x = alloc(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
  return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-18 16:29:24 -07:00
..
davinci-evm.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
davinci-i2s.c ALSA: ASoc: DaVinci Delay start of ASP to trigger 2010-10-04 17:55:17 -07:00
davinci-i2s.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
davinci-mcasp.c ASoC: davinci-mcasp.c: Return error code in failure 2010-10-18 16:29:24 -07:00
davinci-mcasp.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
davinci-pcm.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
davinci-pcm.h ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
davinci-sffsdr.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
davinci-vcif.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
Kconfig DaVinci: DM365: Voice Codec support for the DM365 EVM 2010-03-12 11:12:24 +00:00
Makefile ASoC: DaVinci: Voice Codec Interface 2010-03-12 11:12:21 +00:00