Re: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2016-07-25 Thread Matthias Brugger



On 22/07/16 12:56, SF Markus Elfring wrote:

From: Markus Elfring 
Date: Fri, 22 Jul 2016 12:48:12 +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 
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



Reviewed-by: Matthias Brugger 


diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c 
b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 24aa3ba..07541d0 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -112,9 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
struct mtk_crtc_state *state;

if (crtc->state) {
-   if (crtc->state->mode_blob)
-   drm_property_unreference_blob(crtc->state->mode_blob);
-
+   drm_property_unreference_blob(crtc->state->mode_blob);
state = to_mtk_crtc_state(crtc->state);
memset(state, 0, sizeof(*state));
} else {



Re: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2016-07-25 Thread Matthias Brugger



On 22/07/16 12:56, SF Markus Elfring wrote:

From: Markus Elfring 
Date: Fri, 22 Jul 2016 12:48:12 +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 
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)



Reviewed-by: Matthias Brugger 


diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c 
b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 24aa3ba..07541d0 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -112,9 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
struct mtk_crtc_state *state;

if (crtc->state) {
-   if (crtc->state->mode_blob)
-   drm_property_unreference_blob(crtc->state->mode_blob);
-
+   drm_property_unreference_blob(crtc->state->mode_blob);
state = to_mtk_crtc_state(crtc->state);
memset(state, 0, sizeof(*state));
} else {



[PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2016-07-22 Thread SF Markus Elfring
From: Markus Elfring 
Date: Fri, 22 Jul 2016 12:48:12 +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 
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c 
b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 24aa3ba..07541d0 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -112,9 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
struct mtk_crtc_state *state;
 
if (crtc->state) {
-   if (crtc->state->mode_blob)
-   drm_property_unreference_blob(crtc->state->mode_blob);
-
+   drm_property_unreference_blob(crtc->state->mode_blob);
state = to_mtk_crtc_state(crtc->state);
memset(state, 0, sizeof(*state));
} else {
-- 
2.9.2



[PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2016-07-22 Thread SF Markus Elfring
From: Markus Elfring 
Date: Fri, 22 Jul 2016 12:48:12 +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 
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c 
b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 24aa3ba..07541d0 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -112,9 +112,7 @@ static void mtk_drm_crtc_reset(struct drm_crtc *crtc)
struct mtk_crtc_state *state;
 
if (crtc->state) {
-   if (crtc->state->mode_blob)
-   drm_property_unreference_blob(crtc->state->mode_blob);
-
+   drm_property_unreference_blob(crtc->state->mode_blob);
state = to_mtk_crtc_state(crtc->state);
memset(state, 0, sizeof(*state));
} else {
-- 
2.9.2



Re: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2015-07-06 Thread Daniel Vetter
On Mon, Jul 06, 2015 at 10:01:52AM +0800, John Hunter wrote:
> On Mon, Jul 6, 2015 at 4:00 AM, SF Markus Elfring <
> elfr...@users.sourceforge.net> wrote:
> 
> > From: Markus Elfring 
> > Date: Sun, 5 Jul 2015 21:55:10 +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 
> >
> 
> Reviewed-by: Zhao Junwang 

Applied to topic/drm-misc, thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2015-07-06 Thread Daniel Vetter
On Mon, Jul 06, 2015 at 10:01:52AM +0800, John Hunter wrote:
 On Mon, Jul 6, 2015 at 4:00 AM, SF Markus Elfring 
 elfr...@users.sourceforge.net wrote:
 
  From: Markus Elfring elfr...@users.sourceforge.net
  Date: Sun, 5 Jul 2015 21:55:10 +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 elfr...@users.sourceforge.net
 
 
 Reviewed-by: Zhao Junwang zhjw...@gmail.com

Applied to topic/drm-misc, thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2015-07-05 Thread SF Markus Elfring
From: Markus Elfring 
Date: Sun, 5 Jul 2015 21:55:10 +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 
---
 drivers/gpu/drm/drm_crtc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 2d57fc5..6e4c8b0 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4469,9 +4469,7 @@ static int drm_property_replace_global_blob(struct 
drm_device *dev,
goto err_created;
}
 
-   if (old_blob)
-   drm_property_unreference_blob(old_blob);
-
+   drm_property_unreference_blob(old_blob);
*replace = new_blob;
 
return 0;
-- 
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] GPU-DRM: Delete an unnecessary check before drm_property_unreference_blob()

2015-07-05 Thread SF Markus Elfring
From: Markus Elfring elfr...@users.sourceforge.net
Date: Sun, 5 Jul 2015 21:55:10 +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 elfr...@users.sourceforge.net
---
 drivers/gpu/drm/drm_crtc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 2d57fc5..6e4c8b0 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -4469,9 +4469,7 @@ static int drm_property_replace_global_blob(struct 
drm_device *dev,
goto err_created;
}
 
-   if (old_blob)
-   drm_property_unreference_blob(old_blob);
-
+   drm_property_unreference_blob(old_blob);
*replace = new_blob;
 
return 0;
-- 
2.4.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/