• Julia Lawall's avatar
    IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR · 5f4c7e4e
    Julia Lawall authored
    The function usnic_ib_qp_grp_get_chunk only returns an ERR_PTR value or a
    valid pointer, never NULL.  The same is true of get_qp_res_chunk, which
    just returns the result of calling usnic_ib_qp_grp_get_chunk.  Simplify
    IS_ERR_OR_NULL to IS_ERR in both cases.
    
    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)
    
    // <smpl>
    @@
    expression t,e;
    @@
    
    t = \(usnic_ib_qp_grp_get_chunk(...)\|get_qp_res_chunk(...)\)
    ... when != t=e
    - IS_ERR_OR_NULL(t)
    + IS_ERR(t)
    
    @@
    expression t,e,e1;
    @@
    
    t = \(usnic_ib_qp_grp_get_chunk(...)\|get_qp_res_chunk(...)\)
    ... when != t=e
    ?- t ? PTR_ERR(t) : e1
    + PTR_ERR(t)
    ... when any
    // </smpl>
    Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
    Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    5f4c7e4e
usnic_ib_verbs.c 19.6 KB