From patchwork Thu Mar 8 02:03:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Siqueira X-Patchwork-Id: 10265821 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 5F10760211 for ; Thu, 8 Mar 2018 02:03:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C45D296E1 for ; Thu, 8 Mar 2018 02:03:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4121B296E3; Thu, 8 Mar 2018 02:03:08 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 BB38E296E1 for ; Thu, 8 Mar 2018 02:03:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B90006E200; Thu, 8 Mar 2018 02:03:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vk0-x243.google.com (mail-vk0-x243.google.com [IPv6:2607:f8b0:400c:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E0E6C6E200 for ; Thu, 8 Mar 2018 02:03:04 +0000 (UTC) Received: by mail-vk0-x243.google.com with SMTP id f6so2693593vkh.6 for ; Wed, 07 Mar 2018 18:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=raMdyOKnjfNgwq3DTbIomX/gdyAe0uAgNyMQ854syXY=; b=YX9WpAmPDxkXCjQmwFtZzFyQNsqQ4sPrDdaWX6obj6vdvYTqrZtdCaxcKl03KNsC9N 2D0TeN4LjlSbyTcDpUbtJS9buhlYIcXttzU6Ax5cTvAvRtNK+JFOWMhBLHktnlgeU1+I RE3tTBp7d/9W11O7jJNIw1gNA7DwwYgLC46lipQCagVFsfV5vi7fRpP9LR3sAp43ZDxX M+VHanOcPgFp3NzCy9rmzk9vR3Kvd3fA5SPQ4AAgx972KbCD6+6Cp9IliMlZVhIbfdke jkUWo1yY1oh1beSKQthH3aM7vw2M3sCZgbNWL8Q/uszSlSYASr5Zx/LN69GSHOnF/tTC ckZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=raMdyOKnjfNgwq3DTbIomX/gdyAe0uAgNyMQ854syXY=; b=ud6+vmDu3+gBiYax9X533nMwAwAcP1E8mfHVMBgYWBuZhA5V5kIPQJ2IiJfUNiUMYA kYvA5AZyAKg/Xfxwol6ANGBFiGnq1oIBB4WPg6fN4DFU3J9Af0cRvPJVlycPzPepXEVo 5tGa66CX9X4CwuvooCMSHsIWsZqdkYX3ljk3IJlhDbaKDV8pkco10noqry0pGMdbK2HO pPPaUOV/ezVxom3HIfDezvbyeVY8gCZjPQyB+lnur45bK8tKWZUJjf2YQBOhrDF2WSXf iGo5M086HBVZZNvekSr1uLDpdQweXc41QCwqiTZwj6A9TidbjlEN29g2Hj/0EZwWNMK3 xS2A== X-Gm-Message-State: APf1xPCmRXcc6mrRUqICYyfWjR9YpYEDR4g6NkrzTseDw8bNUG6uhhl+ HnorqpC2F+sVul1ia4P3Z58= X-Google-Smtp-Source: AG47ELv8fpR8D282mVUp/Ke19ohnm61azL9zSrTtJr/MUQoDBlDuEjNO2BXlhl/l9V8M38S9RbF08A== X-Received: by 10.31.226.134 with SMTP id z128mr17583894vkg.72.1520474583792; Wed, 07 Mar 2018 18:03:03 -0800 (PST) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id x30sm16469237uah.30.2018.03.07.18.03.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Mar 2018 18:03:03 -0800 (PST) Date: Wed, 7 Mar 2018 23:03:01 -0300 From: Rodrigo Siqueira To: David Airlie Subject: [PATCH 2/5] drm/vgem: Remove assignment in if condition Message-ID: <092e934559446abe0aa381c0390d49caa1c42062.1520474055.git.rodrigosiqueiramelo@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the checkpatch.pl error: vgem_fence.c:196: ERROR: do not use assignment in if condition Signed-off-by: Rodrigo Siqueira --- drivers/gpu/drm/vgem/vgem_fence.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index b28876c222b4..f5b659463b00 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -191,10 +191,13 @@ int vgem_fence_attach_ioctl(struct drm_device *dev, /* Expose the fence via the dma-buf */ ret = 0; reservation_object_lock(resv, NULL); - if (arg->flags & VGEM_FENCE_WRITE) + if (arg->flags & VGEM_FENCE_WRITE) { reservation_object_add_excl_fence(resv, fence); - else if ((ret = reservation_object_reserve_shared(resv)) == 0) - reservation_object_add_shared_fence(resv, fence); + } else { + ret = reservation_object_reserve_shared(resv); + if (!ret) + reservation_object_add_shared_fence(resv, fence); + } reservation_object_unlock(resv); /* Record the fence in our idr for later signaling */