staging: rts5208: Convert non-returned local variable to boolean when relevant
authorQuentin Lambert <lambert.quentin@gmail.com>
Wed, 4 Mar 2015 10:31:01 +0000 (11:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 01:25:00 +0000 (17:25 -0800)
commitde904bf0e4610a7651f3eb0c8b7b63e2ae32b805
tree0c142eb07b73dfafab3d5083e8eb98e13fde16dc
parent6725e52d22a4d99ea752fa0d0422a3a544545b03
staging: rts5208: Convert non-returned local variable to boolean when relevant

This patch was produced using Coccinelle. A simplified version of the
semantic patch is:

@r exists@
identifier f;
local idexpression u8 x;
identifier xname;
@@

f(...) {
...when any
(
  x@xname = 1;
|
  x@xname = 0;
)
...when any
}

@bad exists@
identifier r.f;
local idexpression u8 r.x
expression e1 != {0, 1}, e2;
@@

f(...) {
...when any
(
  x = e1;
|
  x + e2
)
...when any
}

@depends on !bad@
identifier r.f;
local idexpression u8 r.x;
identifier r.xname;
@@

f(...) {
...
++ bool xname;
- int xname;
<...
(
  x =
- 1
+ true
|
  x =
- -1
+ false
)
...>

}

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rts5208/ms.c
drivers/staging/rts5208/rtsx_chip.c
drivers/staging/rts5208/rtsx_scsi.c
drivers/staging/rts5208/sd.c