IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 11 Nov 2016 19:04:26 +0000 (20:04 +0100)
committerDoug Ledford <dledford@redhat.com>
Wed, 14 Dec 2016 17:57:54 +0000 (12:57 -0500)
commit5f4c7e4eb5f36974ed46a485290f5d01ace5fdba
treec795a84cd9b9cdd323f0c082f0f316bf05f933aa
parent9315bc9a133011fdb084f2626b86db3ebb64661f
IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR

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: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c
drivers/infiniband/hw/usnic/usnic_ib_verbs.c