Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1447337 > unrolled thread

[PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-07-20 18:10 +0200
Last post2016-07-20 19:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] drm/atomic: Delete an unnecessary check before  drm_property_unreference_blob() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-20 18:10 +0200
    Re: [PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob() Sean Paul <seanpaul@chromium.org> - 2016-07-20 19:40 +0200

#1447337 — [PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-07-20 18:10 +0200
Subject[PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob()
Message-ID<rX2em-3Bs-31@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 20 Jul 2016 17:54:32 +0200

The drm_property_unreference_blob() 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/drm_atomic.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 3cee084..8d2f111 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -404,8 +404,7 @@ drm_atomic_replace_property_blob(struct drm_property_blob **blob,
 	if (old_blob == new_blob)
 		return;
 
-	if (old_blob)
-		drm_property_unreference_blob(old_blob);
+	drm_property_unreference_blob(old_blob);
 	if (new_blob)
 		drm_property_reference_blob(new_blob);
 	*blob = new_blob;
-- 
2.9.2

[toc] | [next] | [standalone]


#1447379 — Re: [PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob()

FromSean Paul <seanpaul@chromium.org>
Date2016-07-20 19:40 +0200
SubjectRe: [PATCH] drm/atomic: Delete an unnecessary check before drm_property_unreference_blob()
Message-ID<rX3Ds-4pB-7@gated-at.bofh.it>
In reply to#1447337
On Wed, Jul 20, 2016 at 12:02 PM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 20 Jul 2016 17:54:32 +0200
>
> The drm_property_unreference_blob() 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/drm_atomic.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 3cee084..8d2f111 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -404,8 +404,7 @@ drm_atomic_replace_property_blob(struct drm_property_blob **blob,
>         if (old_blob == new_blob)
>                 return;
>
> -       if (old_blob)
> -               drm_property_unreference_blob(old_blob);
> +       drm_property_unreference_blob(old_blob);
>         if (new_blob)
>                 drm_property_reference_blob(new_blob);


I wonder whether it'd be worthwhile to add the same check to
drm_property_reference_blob to make things symmetric.

Musings aside, I've applied this to drm-misc.

Sean


>         *blob = new_blob;
> --
> 2.9.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web