Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1521342
| From | Leon Romanovsky <leon@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR |
| Date | 2016-11-14 07:10 +0100 |
| Message-ID | <sDiCS-37w-19@gated-at.bofh.it> (permalink) |
| References | <sCpGp-8u6-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
On Fri, Nov 11, 2016 at 08:04:26PM +0100, Julia Lawall wrote: > 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> Thanks, Julia. Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH] IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR Leon Romanovsky <leon@kernel.org> - 2016-11-14 07:10 +0100
csiph-web