From patchwork Thu Sep 22 06:23:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9345777 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 A2F01607D0 for ; Thu, 22 Sep 2016 16:10:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9076F2AAA9 for ; Thu, 22 Sep 2016 16:10:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FA442AB17; Thu, 22 Sep 2016 16:10:42 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM 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 A67DE2AAA9 for ; Thu, 22 Sep 2016 16:10:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1BB46E8F7; Thu, 22 Sep 2016 16:10:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id CFF696E8F7 for ; Thu, 22 Sep 2016 16:10:36 +0000 (UTC) Received: from [192.168.1.2] ([77.182.99.72]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0LrKIO-1aqgrP2QN2-0135HY; Thu, 22 Sep 2016 08:23:55 +0200 Subject: [PATCH 4/4] GPU-DRM-QXL: Adjust checks for null pointers in three functions To: dri-devel@lists.freedesktop.org, Bhaktipriya Shridhar , Daniel Vetter , David Airlie , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , Tejun Heo , Thierry Reding References: From: SF Markus Elfring Message-ID: <0b282ff2-cafe-0b51-912f-def4d840c4ef@users.sourceforge.net> Date: Thu, 22 Sep 2016 08:23:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:LAcNH85mItee3f3dIrlIB38gym0N6qTpPYphSHiTsScNgGtxZMh WDvnyqP49vuuKAqwqKBN63Mc2bwoI75pxhrZgXh8VDHJyLV5PUKQhdfr4Uw+Nw0ENFuUO0c DTP23vHMg28k9sS+DV0Ucjeoh65cV860x/Rg1XW4GUFlX0VRYIFPTbkkxu2qHMl/aWG/Li8 ttTKOd0bTgVxuu8595XcA== X-UI-Out-Filterresults: notjunk:1; V01:K0:TeTBjfGdP2k=:ritJHkT/isiBbq1eHObt6H 0JJwX64lD2+uH94BtH9fw1AZFefHBMl1pUfr7zILHLBn54hXAuOMEuHqX1QjyrDkZ1w1Pct+w 1nA6OWMSGCf3yJHtvyf2AosXXJv2J9lGNRd7eMkXu+uvCa4NNPcbLKnvt9cBKhow7ZnFEz9TP 9xWJK2AFzTIwbg5CF/IdhBNnCx1HgS71nlo4kUlWNZu187dsK/5zl2+uI101pasjsvl1BDzOB 57UtxHdKejHuggwpLJDxE0YQCJPyMGhmK1lwKkGhAn8XNXXKhB57n7PoLOq3qTKTmzCnID1eE UDFN0zpHNXMEGT5fILhAsYRdGeV3PeV5v0S60ZZVvYAnYB4javL2vpKgU2IP5Nh4M63vabwfy m3m1wYQELk3uxnQf4XXqh4+zr9v9Ae8LNrt6hQ5elPpu7vCBaWpMfQm4lBeoJ6rxnXMLGKlJw TPXFXzm2yWdoJE3bz1JfSTekKkfuw7koaP0O4Opc2l1vEwvcgoL9OIOAyLypidrEftJTZ/PaN etrGMASbCVG5mrFfeev5rgoB85vCmPPNs52kuyAbxMOjzGi3s2/kkyFNay2ZHJGtRoIbPqjjg RCPi65oR9OKtMtL8ICL2BIG/gTylXg6Z0euooR2m4Z6BFeHDikOq7wxAKCTnyYHm3pgez0SKn sY3kJLX4ioeeLBGX2LW96JoaL3RHaPqkIj9DYhmGfSgqLPZMRUyu8a2Vu3s/ZJ9V8LoH3PfdV NXBcn5HPEAvKxZyjN8CqRz29mGy+LhQRkVJyD2uz5HSdBuSS+YDkbsIEo4SMxxScnOri+04EK 6sQWB/a Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML 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 From: Markus Elfring Date: Thu, 22 Sep 2016 08:00:08 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script "checkpatch.pl" can point information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/gpu/drm/qxl/qxl_kms.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c index f8f0261..f594430 100644 --- a/drivers/gpu/drm/qxl/qxl_kms.c +++ b/drivers/gpu/drm/qxl/qxl_kms.c @@ -149,7 +149,7 @@ static int qxl_device_init(struct qxl_device *qdev, io_mapping_create_wc(qdev->surfaceram_base, qdev->surfaceram_size); } - if (qdev->surface_mapping == NULL) { + if (!qdev->surface_mapping) { /* 64bit surface bar not present (or mapping failed) */ sb = 1; qdev->surfaceram_base = pci_resource_start(pdev, sb); @@ -288,7 +288,7 @@ int qxl_driver_unload(struct drm_device *dev) { struct qxl_device *qdev = dev->dev_private; - if (qdev == NULL) + if (!qdev) return 0; drm_vblank_cleanup(dev); @@ -307,7 +307,7 @@ int qxl_driver_load(struct drm_device *dev, unsigned long flags) int r; qdev = kzalloc(sizeof(*qdev), GFP_KERNEL); - if (qdev == NULL) + if (!qdev) return -ENOMEM; dev->dev_private = qdev;