]> git.baikalelectronics.ru Git - kernel.git/commit
avr32: fix error return code
authorJulia Lawall <Julia.Lawall@lip6.fr>
Thu, 7 Aug 2014 12:49:05 +0000 (14:49 +0200)
committerHans-Christian Egtvedt <egtvedt@samfundet.no>
Thu, 7 Aug 2014 13:28:35 +0000 (15:28 +0200)
commitea5e8e7a48640f6178ce46fb78bd7db53bf48c2a
treeb90dbd58c8b22d1d9dcc675dbfc7cf23d0e740bd
parentc83f2e692773c1d525f046d68fd4c33b37d81c93
avr32: 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>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
arch/avr32/boards/hammerhead/flash.c