On Tue, 2016-06-14 at 13:25 +0800, kbuild test robot wrote:
> drivers/nvme/target/rdma.c:1441:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> 
> 
>  Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
> 
> Generated by: scripts/coccinelle/api/ptr_ret.cocci
> 
> Signed-off-by: Fengguang Wu <[email protected]>
> ---
> 
>  rdma.c |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -1438,10 +1438,7 @@ static int nvmet_rdma_add_port(struct nv
>       mutex_unlock(&nvmet_rdma_ports_mutex);
>  
>       rdma_port = nvmet_rdma_listen_cmid(pb);
> -     if (IS_ERR(rdma_port))
> -             return PTR_ERR(rdma_port);
> -
> -     return 0;
> +     return PTR_ERR_OR_ZERO(rdma_port);
>  }
>  

Applied.  Thanks Fengguang!

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to