[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0b282ff2-cafe-0b51-912f-def4d840c4ef@users.sourceforge.net>
Date: Thu, 22 Sep 2016 08:23:54 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: dri-devel@...ts.freedesktop.org,
Bhaktipriya Shridhar <bhaktipriya96@...il.com>,
Daniel Vetter <daniel.vetter@...ll.ch>,
David Airlie <airlied@...ux.ie>,
Noralf Trønnes <noralf@...nnes.org>,
Tejun Heo <tj@...nel.org>, Thierry Reding <treding@...dia.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 4/4] GPU-DRM-QXL: Adjust checks for null pointers in three
functions
From: Markus Elfring <elfring@...rs.sourceforge.net>
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 <elfring@...rs.sourceforge.net>
---
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;
--
2.10.0
Powered by blists - more mailing lists