Received: by 10.223.164.202 with SMTP id h10csp3177998wrb; Tue, 28 Nov 2017 07:20:19 -0800 (PST) X-Google-Smtp-Source: AGs4zMb08ISMxZv9UO2ogbH9D3wEuj7lC81zeofXn14ensjqiCkbxCZn2/vSZk3RxtcmSfcy2xAn X-Received: by 10.84.174.4 with SMTP id q4mr8447036plb.306.1511882418800; Tue, 28 Nov 2017 07:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511882418; cv=none; d=google.com; s=arc-20160816; b=V/mvezWost4a10VTRqapWNxd0xbMq5jQBU8G9aB43yV5ACn0RfzWw43RO6B7DR2fcf gM20Y+5mYvFQ8glnYWhyl8cj+8AXHwEKdtgjifkH/nKZ+ylO5ACT46JZEdTs4REbf807 tbVwpVkcJpPy08TjYhu5hQy0SJo2NS302Zb7mmslZmg/wTVzfJd9Ai5cBvieBh+oHxA7 5sSZbjwwMZMtf3dw3XmaSCNDosqo3ks8CMRoPB0jyz1C4zDax4SOuNowNXYYgXsqGkIi 2id0ko6zyfR/OwJTapIgYNLZERMqZmEXDxBWiZKld+zfLuUwUe48FQs1vj9mCgupHskM FX0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=PCq/+RdKLqZzkzSH2/JWa4JjXj3cliG6r86G8IL53m4=; b=tJx9EEOk0S6I5qeo9udIVprJfwoMLzSsgusO819/wKlAJjMKF9a5Yt5i8qU1pyvu41 Qs2YCS/7qEG/TjTJ3/UOlmsOSpFiEAgxjhJEfclMcTD8ZEds1qJ25V4vEopMKbc8LD0X LgaNsQP+MYt955Qg9wsxynRhM+lhu5GnuPciPlisXzbAkhnMh4OyTgresqmF5sWJHJof hjQ2FhoRT192xT8yIkBBaE6QMu/JF8etG+hk+7QXcs6ltSItIveVEa8v3oqi//iEChrY xkiCffenrF8iaWS+Nv64PRYXjzvLQrMWLTDFsLtJb0nsZWA26uyfA2touOowftpcLA90 gjBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h52WaIhX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si24722675pgc.47.2017.11.28.07.20.07; Tue, 28 Nov 2017 07:20:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h52WaIhX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753738AbdK1PSg (ORCPT + 77 others); Tue, 28 Nov 2017 10:18:36 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:45443 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753263AbdK1PSS (ORCPT ); Tue, 28 Nov 2017 10:18:18 -0500 Received: by mail-lf0-f67.google.com with SMTP id f13so165040lff.12; Tue, 28 Nov 2017 07:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=PCq/+RdKLqZzkzSH2/JWa4JjXj3cliG6r86G8IL53m4=; b=h52WaIhXyBbImkIT3yX7nSd3FGx7Z61EF6gWcVdTDedqTobYnWXAGDTPzXJ0mkIu5Q 7bjGaLAyOMVXnS3u1s0muGmGNZzRuo97XNEtoDl/LJ4s25kQDrEUFUksdFZ8efM6Yx4y A/JSjzpmcPxPB5DkO/X2FHYVXqD7NnCP2Y4CENdayCQHaAFbrmBl2ONzFD+aeBvPg4Gs Urx48fE8cMf7qVKcQPxM54cV3FBrlbphRQlBDNYjlVVRWf9SuUP3ZXevkvAKRnBjKBHd /nwVAacJeJ8xxhUhjcjFfTPwu52++S/JFsFqExanpdT9iEJUYGlzBagELZsQXrrfl8Xp JlRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PCq/+RdKLqZzkzSH2/JWa4JjXj3cliG6r86G8IL53m4=; b=Y4GCXpDCcd47lmPUwfpm25Twoi3dYB7Qx9HjPvIyAL45u3SABrfDW3PN3rjO0699rS nAspjwYnnBvtJT7du/e/To55UnTZH6rI7scZJgT52PrjMGQmRmoXOZfVn5fj+vMHGing EKfnIGhYDFbN0WhZG2fTOfO/K8thUpKApLJHukFsrEBAAQmBZg1elJpUoKOvdSxTnF+e uBvnhCbYiXJKbXEQY/ygFw7Qx0Rpp23+T4qbqe8vSXlgDvWTSi9Y8EavIMpVian6g+Dg SMIcz6Zu2wkSjL28KqeqF3U942Ng2PTznFnawqjHZw+D26xb49TpT+if1qRYx/ia5yXA gNbg== X-Gm-Message-State: AJaThX48n9yVn6SNrytYmDehJoTWTHY45TWj7zXd5BYgXK6u9MSmWIjT q6loLBtpkOKvFCo/tP1N9ak= X-Received: by 10.25.178.139 with SMTP id t11mr7549734lfk.13.1511882297041; Tue, 28 Nov 2017 07:18:17 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id j8sm2691287lje.83.2017.11.28.07.18.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Nov 2017 07:18:16 -0800 (PST) From: Vasyl Gomonovych To: dledford@redhat.com, jgg@ziepe.ca, leonro@mellanox.com, yishaih@mellanox.com, matanb@mellanox.com, don.hiatt@intel.com, dasaratharaman.chandramouli@intel.com, noaos@mellanox.com, parav@mellanox.com, artemyko@mellanox.com, bodong@mellanox.com, linux-rdma@vger.kernel.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] IB/core: Use PTR_ERR_OR_ZERO() Date: Tue, 28 Nov 2017 16:18:07 +0100 Message-Id: <1511882287-450-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix ptr_ret.cocci warnings: drivers/infiniband/core/uverbs_cmd.c:1156: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: Vasyl Gomonovych --- drivers/infiniband/core/uverbs_cmd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 16d55710b116..adc6a2379c76 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -1145,10 +1145,7 @@ int ib_uverbs_ex_create_cq(struct ib_uverbs_file *file, min(ucore->inlen, sizeof(cmd)), ib_uverbs_ex_create_cq_cb, NULL); - if (IS_ERR(obj)) - return PTR_ERR(obj); - - return 0; + return PTR_ERR_OR_ZERO(obj); } ssize_t ib_uverbs_resize_cq(struct ib_uverbs_file *file, -- 1.9.1 From 1587125743398197398@xxx Mon Dec 18 12:44:18 +0000 2017 X-GM-THRID: 1586591576860985617 X-Gmail-Labels: Inbox,Category Forums