OSDN Git Service

iio: fix error return code
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 8 Jun 2014 20:12:00 +0000 (21:12 +0100)
committerJonathan Cameron <jic23@kernel.org>
Thu, 7 Aug 2014 09:26:53 +0000 (10:26 +0100)
commit889c558095e96312d81b4084567c11a52b285393
tree0d481ba8421cce7c07b8435e589bdf043e058fb0
parentd7b79519faa926a9d6d1cdebfddea7a58a9951f3
iio: fix error return code

Convert a zero return value on error to a negative one, as returned
elsewhere in the function.

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

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/xilinx-xadc-core.c