From patchwork Tue Nov 28 12:56:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 10080251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A9C5960353 for ; Tue, 28 Nov 2017 12:56:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7F0B28438 for ; Tue, 28 Nov 2017 12:56:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBC84288EA; Tue, 28 Nov 2017 12:56:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3468C28438 for ; Tue, 28 Nov 2017 12:56:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4678A6E0E4; Tue, 28 Nov 2017 12:56:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by gabe.freedesktop.org (Postfix) with ESMTPS id B02986E0E4 for ; Tue, 28 Nov 2017 12:56:29 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.44,468,1505772000"; d="scan'208";a="246360544" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Nov 2017 13:56:26 +0100 Date: Tue, 28 Nov 2017 13:56:24 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Ben Skeggs Subject: [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings (fwd) Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Cc: David Airlie , nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kbuild-all@01.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is a false positive, but I wonder if it is really necessary to put the assignment in the conditional test expression. julia ---------- Forwarded message ---------- Date: Tue, 28 Nov 2017 13:23:36 +0800 From: kbuild test robot To: kbuild@01.org Cc: Julia Lawall Subject: [PATCH] drm/nouveau/mmu: fix odd_ptr_err.cocci warnings CC: kbuild-all@01.org CC: linux-kernel@vger.kernel.org TO: Ben Skeggs CC: David Airlie CC: dri-devel@lists.freedesktop.org CC: nouveau@lists.freedesktop.org CC: linux-kernel@vger.kernel.org drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c:109:5-11: inconsistent IS_ERR and PTR_ERR on line 110. drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c:109:5-11: inconsistent IS_ERR and PTR_ERR on line 111. PTR_ERR should access the value just tested by IS_ERR Semantic patch information: There can be false positives in the patch case, where it is the call to IS_ERR that is wrong. Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci Fixes: 920d2b5ef215 ("drm/nouveau/mmu: define user interfaces to mmu vmm opertaions") Signed-off-by: Fengguang Wu --- Please take the patch only if it's a positive warning. Thanks! uvmm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c @@ -107,8 +107,9 @@ nvkm_uvmm_mthd_map(struct nvkm_uvmm *uvm return ret; if (IS_ERR((memory = nvkm_umem_search(client, handle)))) { - VMM_DEBUG(vmm, "memory %016llx %ld\n", handle, PTR_ERR(memory)); - return PTR_ERR(memory); + VMM_DEBUG(vmm, "memory %016llx %ld\n", handle, + PTR_ERR((memory = nvkm_umem_search(client, handle)))); + return PTR_ERR((memory = nvkm_umem_search(client, handle))); } mutex_lock(&vmm->mutex);