mtd: Use BLOCK_NIL consistently in NFTL/INFTL
commit70ec3bb8ea3f8c55b255f41d122c7d4d8c0d00b4
authorJulia Lawall <julia@diku.dk>
Sat, 27 Jun 2009 07:55:32 +0000 (27 09:55 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Sat, 27 Jun 2009 08:22:10 +0000 (27 09:22 +0100)
tree8d61fcbd6d49c8dde71426513b6945dd147935b5
parent89bb871e96cdc3d78b7f69f0bacc94b21bbaccfd
mtd: Use BLOCK_NIL consistently in NFTL/INFTL

Use BLOCK_NIL consistently rather than sometimes 0xffff and sometimes
BLOCK_NIL.

The semantic patch that finds this issue is below
(http://www.emn.fr/x-info/coccinelle/).  On the other hand, the changes
were made by hand, in part because drivers/mtd/inftlcore.c contains dead
code that causes spatch to ignore a relevant function.  Specifically, the
function INFTL_findwriteunit contains a do-while loop, but always takes a
return that leaves the loop on the first iteration.

// <smpl>
@r exists@
identifier f,C;
@@

f(...) { ... return C; }

@s@
identifier r.C;
expression E;
@@

@@
identifier r.f,r.C,I;
expression s.E;
@@

f(...) {
 <...
(
  I
|
- E
+ C
)
 ...>
}

// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/inftlcore.c
drivers/mtd/nftlcore.c