diff mbox series

[2/3] drm/tilcdc: remove unnecessary state->fb check

Message ID 20200429104234.18910-2-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/tilcdc: fix leak & null ref in panel_connector_get_modes | expand

Commit Message

Tomi Valkeinen April 29, 2020, 10:42 a.m. UTC
tilcdc_plane_atomic_check() exits if state->fb == NULL, so no need to
check it again later.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_plane.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jyri Sarha May 19, 2020, 6:06 a.m. UTC | #1
On 29/04/2020 13:42, Tomi Valkeinen wrote:
> tilcdc_plane_atomic_check() exits if state->fb == NULL, so no need to
> check it again later.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

Reviewed-by: Jyri Sarha <jsarha@ti.com>

> ---
>  drivers/gpu/drm/tilcdc/tilcdc_plane.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
> index e2090020b3a0..0d09b31ae759 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
> @@ -62,8 +62,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane *plane,
>  		return -EINVAL;
>  	}
>  
> -	if (state->fb && old_state->fb &&
> -	    state->fb->format != old_state->fb->format) {
> +	if (old_state->fb && state->fb->format != old_state->fb->format) {
>  		dev_dbg(plane->dev->dev,
>  			"%s(): pixel format change requires mode_change\n",
>  			__func__);
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
index e2090020b3a0..0d09b31ae759 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
@@ -62,8 +62,7 @@  static int tilcdc_plane_atomic_check(struct drm_plane *plane,
 		return -EINVAL;
 	}
 
-	if (state->fb && old_state->fb &&
-	    state->fb->format != old_state->fb->format) {
+	if (old_state->fb && state->fb->format != old_state->fb->format) {
 		dev_dbg(plane->dev->dev,
 			"%s(): pixel format change requires mode_change\n",
 			__func__);