From: SF Markus Elfring <elfring@users.sourceforge.net>
To: David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org
Cc: Ben Skeggs <bskeggs@redhat.com>,
Ilia Mirkin <imirkin@alum.mit.edu>,
Alexandre Courbot <acourbot@nvidia.com>,
Thierry Reding <treding@nvidia.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
trivial@kernel.org, Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [PATCH 1/1] GPU-DRM-nouveau: Deletion of unnecessary checks before two function calls
Date: Wed, 22 Oct 2014 16:30:09 +0200 [thread overview]
Message-ID: <5447BF71.7040200@users.sourceforge.net> (raw)
In-Reply-To: <5317A59D.4@users.sourceforge.net>
>> If you are convinced that dropping the null tests is a good idea, then you
>> can submit the patch that makes the change to the relevant maintainers and
>> mailing lists.
Would you like to integrate the following proposal into your source code repository?
Regards,
Markus
>From 29e61d5ccc44cd5e5961acff61b6938e0705044d Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 22 Oct 2014 15:45:22 +0200
Subject: [PATCH] GPU-DRM-nouveau: Deletion of unnecessary checks before two
function calls
A semantic patch approach was proposed with the subject "[PATCH with
Coccinelle?] Deletion of unnecessary checks before specific function calls"
on 2014-03-05.
https://lkml.org/lkml/2014/3/5/344
http://article.gmane.org/gmane.comp.version-control.coccinelle/3513/
This patch pattern application was repeated with the help of the software
"Coccinelle 1.0.0-rc22" on the source files for Linux 3.17.1. An extract
of the automatically generated update suggestions is shown here.
It was determined that the affected source code places call functions
which perform input parameter validation already. It is therefore not
needed that a similar safety check is repeated at the call site.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/gpu/drm/nouveau/core/core/handle.c | 3 +--
drivers/gpu/drm/nouveau/nouveau_drm.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/core/core/handle.c
b/drivers/gpu/drm/nouveau/core/core/handle.c
index a490b80..75d0c2c 100644
--- a/drivers/gpu/drm/nouveau/core/core/handle.c
+++ b/drivers/gpu/drm/nouveau/core/core/handle.c
@@ -219,8 +219,7 @@ nouveau_handle_get_cinst(struct nouveau_object *engctx, u32
cinst)
void
nouveau_handle_put(struct nouveau_handle *handle)
{
- if (handle)
- nouveau_namedb_put(handle);
+ nouveau_namedb_put(handle);
}
int
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 5723807..5c29079 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -512,8 +512,7 @@ nouveau_drm_unload(struct drm_device *dev)
nouveau_vga_fini(drm);
nvif_device_fini(&drm->device);
- if (drm->hdmi_device)
- pci_dev_put(drm->hdmi_device);
+ pci_dev_put(drm->hdmi_device);
nouveau_cli_destroy(&drm->client);
return 0;
}
--
2.1.2
next parent reply other threads:[~2014-10-22 14:30 UTC|newest]
Thread overview: 123+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5307CAA2.8060406@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6>
[not found] ` <530A086E.8010901@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6>
[not found] ` <530A72AA.3000601@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6>
[not found] ` <530B5FB6.6010207@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402241710370.2074@hadrien>
[not found] ` <530C5E18.1020800@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402251014170.2080@hadrien>
[not found] ` <530CD2C4.4050903@users.sourceforge.net>
[not found] ` <alpine.DEB.2.10.1402251840450.7035@hadrien>
[not found] ` <530CF8FF.8080600@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6>
[not found] ` <530DD06F.4090703@users.sourceforge.net>
[not found] ` <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6>
[not found] ` <5317A59D.4@users.so urceforge.net>
[not found] ` <5317A59D.4@users.sourceforge.net>
2014-10-22 14:30 ` SF Markus Elfring [this message]
2015-07-05 18:22 ` [PATCH] GPU-DRM-nouveau: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-20 17:50 ` [PATCH] GPU-DRM-nouveau: Delete an unnecessary check before the function call "pci_dev_put" SF Markus Elfring
2014-10-22 16:48 ` [PATCH 1/1] GPU-DRM-GMA500: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-10-23 11:26 ` One Thousand Gnomes
2014-10-26 12:10 ` SF Markus Elfring
2014-10-26 14:56 ` Arthur Borsboom
2016-07-22 8:45 ` [PATCH] GPU-DRM-GMA500: Delete " SF Markus Elfring
2016-07-22 9:32 ` Daniel Vetter
2014-11-19 15:40 ` [PATCH 1/1] DRM-EDID: Deletion of an unnecessary check before the function call "release_firmware" SF Markus Elfring
2014-11-20 4:03 ` Thierry Reding
2014-11-19 16:14 ` [PATCH 1/1] DRM-tilcdc: Deletion of an unnecessary check before the function call "drm_fbdev_cma_hotplug_event" SF Markus Elfring
2014-11-20 4:11 ` Thierry Reding
2014-11-19 16:37 ` [PATCH 1/1] DRM-UDL: Deletion of an unnecessary check before the function call "vunmap" SF Markus Elfring
2014-11-20 4:17 ` Thierry Reding
2014-11-19 16:55 ` [PATCH 1/1] DRM-vmwgfx: Deletion of an unnecessary check before the function call "vfree" SF Markus Elfring
2014-11-20 4:22 ` Thierry Reding
2015-07-06 8:01 ` SF Markus Elfring
2015-07-08 5:49 ` John Hunter
2015-07-08 16:55 ` SF Markus Elfring
2015-07-09 0:08 ` John Hunter
2016-07-22 11:45 ` [PATCH] drm/vmwgfx: Delete " SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 15:33 ` Sinclair Yeh
2014-11-25 12:50 ` [PATCH 1/1] GPU-DRM-MSM-Adreno: Deletion of unnecessary checks before the function call "release_firmware" SF Markus Elfring
2014-12-01 16:01 ` Thierry Reding
2014-11-25 13:33 ` [PATCH 1/1] GPU-DRM-MSM: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-12-01 16:04 ` Thierry Reding
2014-12-01 16:09 ` Rob Clark
2014-12-01 16:14 ` Rob Clark
2015-02-04 21:00 ` [PATCH] GPU-DRM-Exynos: Delete " SF Markus Elfring
2015-02-05 8:29 ` Joonyoung Shim
2015-06-27 17:17 ` SF Markus Elfring
2016-07-21 17:42 ` [PATCH] GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
2016-07-21 18:07 ` Sean Paul
2015-02-04 21:25 ` [PATCH] GPU-DRM-OMAP: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-22 6:45 ` SF Markus Elfring
2015-02-05 9:20 ` [PATCH] GPU-DRM-Tegra: Delete an unnecessary check before the function call "vunmap" SF Markus Elfring
2015-07-08 18:40 ` SF Markus Elfring
2015-07-13 14:16 ` Alexandre Courbot
2016-07-16 5:30 ` [PATCH] drm/tegra: " SF Markus Elfring
2015-06-27 18:51 ` [PATCH] drm/bridge: ps8622: Delete a check before backlight_device_unregister() SF Markus Elfring
2016-07-22 12:54 ` [PATCH] drm/bridge: ps8622: Delete an unnecessary " SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2015-06-27 21:16 ` [PATCH 0/2] drm/msm/dsi: Deletion of an unnecessary check SF Markus Elfring
2015-06-27 21:20 ` [PATCH 1/2] drm/msm/dsi: Delete an unnecessary check before the function call "dsi_destroy" SF Markus Elfring
2015-06-27 21:23 ` [PATCH 2/2] drm/msm/dsi: One function call less in dsi_init() after error detection SF Markus Elfring
2015-06-28 8:45 ` [PATCH] drm/amdgpu: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2015-06-29 15:30 ` Alex Deucher
2016-07-16 14:33 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations SF Markus Elfring
2016-07-16 14:45 ` [PATCH 1/8] drm/amdgpu: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-16 14:48 ` [PATCH 2/8] drm/amdgpu/powerplay: Delete unnecessary checks before the function call "kfree" SF Markus Elfring
2016-07-16 14:50 ` [PATCH 3/8] drm/amdgpu: One function call less in amdgpu_cgs_acpi_eval_object() after error detection SF Markus Elfring
2016-07-16 14:54 ` [PATCH 4/8] drm/amdgpu: Delete a variable in amdgpu_cgs_acpi_eval_object() SF Markus Elfring
2016-07-16 14:56 ` [PATCH 5/8] drm/amdgpu: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-07-16 15:00 ` SF Markus Elfring
2016-07-16 15:05 ` [PATCH 6/8] drm/amdgpu: Change assignment for a variable " SF Markus Elfring
2016-07-16 15:08 ` [PATCH 7/8] drm/amd/powerplay: Change assignment for a buffer variable in phm_dispatch_table() SF Markus Elfring
2016-07-17 15:03 ` walter harms
2016-07-16 15:10 ` [PATCH 8/8] drm/amd/powerplay: Delete an unnecessary variable initialisation " SF Markus Elfring
2016-07-18 7:41 ` [PATCH 0/8] drm/amdgpu: Fine-tuning for three function implementations Christian König
2016-07-28 16:10 ` Alex Deucher
2015-07-05 20:00 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
2015-07-06 2:01 ` John Hunter
2015-07-06 6:53 ` Daniel Vetter
2015-11-06 11:13 ` [PATCH] GPU-DRM: Delete unnecessary checks " SF Markus Elfring
2015-11-16 14:04 ` Daniel Vetter
2016-07-20 16:02 ` [PATCH] drm/atomic: Delete an unnecessary check " SF Markus Elfring
2016-07-20 17:29 ` Sean Paul
2015-07-05 20:50 ` [PATCH] GPU-DRM-IMX: Delete an unnecessary check before drm_fbdev_cma_restore_mode() SF Markus Elfring
2015-11-20 12:53 ` Philipp Zabel
2015-11-06 12:43 ` [PATCH] GPU-DRM-i915: Delete an unnecessary check before the function call "pwm_put" SF Markus Elfring
2015-11-06 12:52 ` Jani Nikula
2015-11-06 12:55 ` SF Markus Elfring
2015-11-06 13:17 ` Jani Nikula
2015-11-06 13:45 ` [PATCH] GPU-DRM-ps8622: Delete an unnecessary check before backlight_device_unregister() SF Markus Elfring
2015-11-06 14:05 ` [PATCH] HDMI-HDCP: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2015-11-06 15:08 ` [PATCH] GPU-DRM-vc4: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-15 19:21 ` [PATCH] drm/vc4: " SF Markus Elfring
2015-11-16 14:45 ` [PATCH] GPU-DRM-TTM: Delete an unnecessary check before the function call "ttm_tt_destroy" SF Markus Elfring
2016-07-15 18:28 ` [PATCH] drm/ttm: " SF Markus Elfring
2016-07-18 7:12 ` Daniel Vetter
2016-07-18 14:10 ` [PATCH v3] " SF Markus Elfring
2016-07-18 14:45 ` Daniel Vetter
2016-07-18 17:00 ` SF Markus Elfring
2016-07-19 8:14 ` [PATCH v3] " Geert Uytterhoeven
2016-07-19 8:21 ` Daniel Vetter
2016-07-12 20:22 ` [PATCH] GPU-DRM-Radeon: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-28 15:58 ` Alex Deucher
2016-07-13 17:54 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks SF Markus Elfring
2016-07-13 18:00 ` [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2016-07-13 18:01 ` [PATCH 2/3] drm/msm: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-13 18:02 ` [PATCH 3/3] drm/msm: Delete an unnecessary check before drm_gem_object_unreference() SF Markus Elfring
2016-07-15 2:08 ` [PATCH 0/3] drm/msm: Deletion of a few unnecessary checks Rob Clark
2016-07-15 12:30 ` [PATCH] drm/bochs: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-15 13:35 ` [PATCH] drm/rockchip: " SF Markus Elfring
2016-07-19 1:59 ` Mark yao
2016-07-15 20:00 ` [PATCH] drm/arcpgu: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
2016-07-19 18:04 ` Alexey Brodkin
2016-07-15 20:44 ` [PATCH] drm/virtgpu: Delete unnecessary checks before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-16 6:40 ` [PATCH] drm/cirrus: Delete an unnecessary check " SF Markus Elfring
2016-07-16 7:20 ` [PATCH] drm/hdlcd: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
2016-07-18 9:21 ` Liviu Dudau
2016-07-16 8:04 ` [PATCH] drm/ast: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-18 6:53 ` Daniel Vetter
2016-07-20 16:40 ` [PATCH] GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() SF Markus Elfring
2016-07-20 17:47 ` Daniel Vetter
2016-07-22 9:32 ` [PATCH] drm/mgag200: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 10:56 ` [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob() SF Markus Elfring
2016-07-25 8:43 ` Matthias Brugger
2016-07-22 12:22 ` [PATCH] drm/qxl: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-22 15:25 ` Sean Paul
2016-07-22 15:42 ` [PATCH 0/4] GPU-DRM-Etnaviv: Fine-tuning for a few functions SF Markus Elfring
2016-07-22 15:47 ` [PATCH 1/4] GPU-DRM-Etnaviv: Delete unnecessary checks before two function calls SF Markus Elfring
2016-07-22 17:53 ` Sean Paul
2016-07-22 15:48 ` [PATCH 2/4] GPU-DRM-Etnaviv: Delete unnecessary if statement in __etnaviv_gem_new() SF Markus Elfring
2016-07-22 16:41 ` walter harms
2016-07-22 17:44 ` [PATCH] drm/etnaviv: Improve readability in __etnaviv_gem_new Sean Paul
2016-07-22 15:50 ` [PATCH 3/4] GPU-DRM-Etnaviv: Rename jump labels SF Markus Elfring
2016-07-22 17:45 ` Sean Paul
2016-07-22 15:51 ` [PATCH 4/4] GPU-DRM-Etnaviv: Optimize error handling in etnaviv_gem_new_userptr() SF Markus Elfring
2016-07-22 17:54 ` Sean Paul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5447BF71.7040200@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=acourbot@nvidia.com \
--cc=airlied@linux.ie \
--cc=bskeggs@redhat.com \
--cc=cocci@systeme.lip6.fr \
--cc=dri-devel@lists.freedesktop.org \
--cc=imirkin@alum.mit.edu \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=treding@nvidia.com \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox