Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1521342 > unrolled thread

Re: [PATCH] IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR

Started byLeon Romanovsky <leon@kernel.org>
First post2016-11-14 07:10 +0100
Last post2016-11-14 07:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR Leon Romanovsky <leon@kernel.org> - 2016-11-14 07:10 +0100

#1521342 — Re: [PATCH] IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR

FromLeon Romanovsky <leon@kernel.org>
Date2016-11-14 07:10 +0100
SubjectRe: [PATCH] IB/usnic: simplify IS_ERR_OR_NULL to IS_ERR
Message-ID<sDiCS-37w-19@gated-at.bofh.it>

[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>

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web