• J
    mtd: Use BLOCK_NIL consistently in NFTL/INFTL · 70ec3bb8
    Julia Lawall 提交于
    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: NJulia Lawall <julia@diku.dk>
    Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
    70ec3bb8
inftlcore.c 24.8 KB