public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: mark.yao@rock-chips•com (Mark yao)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] drm/rockchip: Delete an unnecessary check before drm_gem_object_unreference_unlocked()
Date: Tue, 19 Jul 2016 09:59:29 +0800	[thread overview]
Message-ID: <578D8981.2070102@rock-chips.com> (raw)
In-Reply-To: <b66399ed-278b-b85d-4a21-b34164936ef6@users.sourceforge.net>

On 2016?07?15? 21:35, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users•sourceforge.net>
> Date: Fri, 15 Jul 2016 15:23:22 +0200
>
> The drm_gem_object_unreference_unlocked() function tests whether
> its argument is NULL and then returns immediately.
> Thus the test around the call is not needed.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users•sourceforge.net>
> ---
>   drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 20f12bc..6f64e79 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -43,14 +43,10 @@ struct drm_gem_object *rockchip_fb_get_gem_obj(struct drm_framebuffer *fb,
>   static void rockchip_drm_fb_destroy(struct drm_framebuffer *fb)
>   {
>   	struct rockchip_drm_fb *rockchip_fb = to_rockchip_fb(fb);
> -	struct drm_gem_object *obj;
>   	int i;
>   
> -	for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++) {
> -		obj = rockchip_fb->obj[i];
> -		if (obj)
> -			drm_gem_object_unreference_unlocked(obj);
> -	}
> +	for (i = 0; i < ROCKCHIP_MAX_FB_BUFFER; i++)
> +		drm_gem_object_unreference_unlocked(rockchip_fb->obj[i]);
>   
Good, Thanks for the fixes, Applied to my drm-fixes.

>   	drm_framebuffer_cleanup(fb);
>   	kfree(rockchip_fb);


-- 
?ark Yao

  reply	other threads:[~2016-07-19  1:59 UTC|newest]

Thread overview: 64+ 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.sourceforge.net>
2014-11-20 10:50                                 ` [PATCH 1/1] [media] platform: Deletion of unnecessary checks before two function calls SF Markus Elfring
2014-11-20 13:50                                 ` [PATCH 1/1] net: Xilinx: " SF Markus Elfring
2014-11-20 17:29                                   ` Sören Brinkmann
2014-11-21 20:14                                   ` David Miller
2014-11-21 10:12                                 ` [PATCH 1/1] thermal: Exynos: " SF Markus Elfring
2014-11-21 10:17                                   ` Julia Lawall
2014-11-21 13:25                                     ` SF Markus Elfring
2014-11-21 16:17                                     ` [PATCH v2] " SF Markus Elfring
2014-11-22 10:00                                 ` [PATCH 1/1] ARM: OMAP2: Deletion of unnecessary checks before three " SF Markus Elfring
2015-06-30 12:10                                   ` [PATCH] ARM: OMAP2: Delete " SF Markus Elfring
2015-07-16  5:55                                     ` Paul Walmsley
2015-07-16  6:23                                       ` Tony Lindgren
2015-07-16 14:06                                         ` Paul Walmsley
2015-07-16 16:28                                           ` Tony Lindgren
2015-07-16  6:40                                       ` SF Markus Elfring
2014-11-22 10:40                                 ` [PATCH 1/1] ARM-kernel: Deletion of unnecessary checks before two " SF Markus Elfring
2014-12-03  8:15                                 ` [PATCH] ARM: DaVinci: Deletion of an unnecessary check before the function call "__clk_disable" SF Markus Elfring
2014-12-03  9:10                                   ` SF Markus Elfring
2015-02-04 21:00                                 ` [PATCH] GPU-DRM-Exynos: Delete unnecessary checks before two function calls 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-06-25 11:33                                 ` [PATCH 0/2] ARM-OMAP2+: Deletion of unnecessary checks before two function calls SF Markus Elfring
2015-06-25 11:38                                   ` [PATCH 1/2] ARM-OMAP2+: Delete an unnecessary check before the function call "omap_device_delete" SF Markus Elfring
2015-06-25 11:40                                   ` [PATCH 2/2] ARM-OMAP2+: Delete an unnecessary check before the function call "of_node_put" SF Markus Elfring
2015-07-15  6:41                                   ` [PATCH 0/2] ARM-OMAP2+: Deletion of unnecessary checks before two function calls Tony Lindgren
2015-06-25 13:27                                 ` [PATCH 0/2] ARM-kernel: " SF Markus Elfring
2015-06-25 13:30                                   ` [PATCH 1/2] ARM-kernel: Delete an unnecessary check before the function call "smp_set_ops" SF Markus Elfring
2015-06-25 13:32                                   ` [PATCH 2/2] ARM-kernel: Delete an unnecessary check before the function call "unwind_table_del" SF Markus Elfring
2015-06-28 14:05                                 ` [PATCH] iommu/arm-smmu: Delete an unnecessary check before the function call "free_io_pgtable_ops" SF Markus Elfring
2015-11-06 17:38                                   ` [PATCH] iommu/arm-smmu: Delete an unnecessary check before free_io_pgtable_ops() SF Markus Elfring
2015-06-28 14:52                                 ` [PATCH] PCI-iproc: Delete unnecessary checks before two function calls SF Markus Elfring
2015-06-29 16:45                                   ` Ray Jui
2015-07-14 20:10                                   ` Bjorn Helgaas
2015-07-14 20:23                                     ` Ray Jui
2015-07-14 20:51                                       ` Bjorn Helgaas
2015-07-14 20:53                                         ` Ray Jui
2015-06-29 10:48                                 ` [PATCH] net-Liquidio: Delete unnecessary checks before the function call "vfree" SF Markus Elfring
2015-06-29 16:28                                   ` David Miller
2015-11-05 16:17                                 ` [PATCH] pinctrl: Delete unnecessary checks before the function call "pinctrl_unregister" SF Markus Elfring
2015-11-05 16:53                                   ` Ray Jui
2015-11-17 10:50                                   ` Linus Walleij
2015-11-05 18:45                                 ` [PATCH 0/2] [media] c8sectpfe: Deletion of a few unnecessary checks SF Markus Elfring
2015-11-05 18:49                                   ` [PATCH 1/2] [media] c8sectpfe: Delete unnecessary checks before two function calls SF Markus Elfring
2015-11-05 18:50                                   ` [PATCH 2/2] [media] c8sectpfe: Combine three checks into a single if block SF Markus Elfring
2015-11-06 10:09                                     ` walter harms
2015-11-06  7:50                                   ` [PATCH 0/2] [media] c8sectpfe: Deletion of a few unnecessary checks Maxime Coquelin
2015-11-16 21:20                                 ` [PATCH 0/3] ste_dma40: " SF Markus Elfring
2015-11-16 21:23                                   ` [PATCH 1/3] ste_dma40: Delete an unnecessary check before the function call "kmem_cache_destroy" SF Markus Elfring
2015-11-29 21:26                                     ` Linus Walleij
2015-11-16 21:24                                   ` [PATCH 2/3] ste_dma40: Delete another unnecessary check in d40_probe() SF Markus Elfring
2015-11-29 21:28                                     ` Linus Walleij
2015-11-16 21:26                                   ` [PATCH 3/3] ste_dma40: Delete an unnecessary variable initialisation " SF Markus Elfring
2015-11-29 21:29                                     ` Linus Walleij
2015-12-10  3:47                                   ` [PATCH 0/3] ste_dma40: Deletion of a few unnecessary checks Vinod Koul
2016-07-15 13:35                                 ` [PATCH] drm/rockchip: Delete an unnecessary check before drm_gem_object_unreference_unlocked() SF Markus Elfring
2016-07-19  1:59                                   ` Mark yao [this message]
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 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-23 18:08                                 ` [PATCH] coresight: tmc: Delete an unnecessary check before the function call "kfree" SF Markus Elfring
2016-07-25 16:36                                   ` Mathieu Poirier

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=578D8981.2070102@rock-chips.com \
    --to=mark.yao@rock-chips$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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