Skip to content
  • Julia Lawall's avatar
    drivers/isdn: delete double assignment · 4101e976
    Julia Lawall authored
    Delete successive assignments to the same location.  In the first case, the
    hscx array has two elements, so change the assignment to initialize the
    second one.  In the second case, the two assignments are simply identical.
    Furthermore, neither is necessary, because the effect of the assignment is
    only visible in the next line, in the assignment in the if test.  The patch
    inlines the right hand side value in the latter assignment and pulls that
    assignment out of the if test.
    
    A simplified version of the semantic match that finds this problem is as
    follows: (http://coccinelle.lip6.fr/
    
    )
    
    // <smpl>
    @@
    expression i;
    @@
    
    *i = ...;
     i = ...;
    // </smpl>
    
    Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    4101e976