diff mbox

[v3,10/10] drm/rockchip: Remove unnecessary NULL check

Message ID 20170321081358.27237-11-thierry.reding@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thierry Reding March 21, 2017, 8:13 a.m. UTC
From: Thierry Reding <treding@nvidia.com>

The expression &private->fbdev_helper can never be NULL, so the check is
completely unnecessary.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Daniel Vetter March 21, 2017, 10:27 a.m. UTC | #1
On Tue, Mar 21, 2017 at 09:13:58AM +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> The expression &private->fbdev_helper can never be NULL, so the check is
> completely unnecessary.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>

On the 3 drivers patches (all except exynos):

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

For merging, do you want to push it all through drm-misc? Or planning on
sending a pull request to Dave?
-Daniel


> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> index 81f9548672b0..df6bceabeca8 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
> @@ -168,10 +168,8 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
>  static void rockchip_drm_output_poll_changed(struct drm_device *dev)
>  {
>  	struct rockchip_drm_private *private = dev->dev_private;
> -	struct drm_fb_helper *fb_helper = &private->fbdev_helper;
>  
> -	if (fb_helper)
> -		drm_fb_helper_hotplug_event(fb_helper);
> +	drm_fb_helper_hotplug_event(&private->fbdev_helper);
>  }
>  
>  static void
> -- 
> 2.12.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Thierry Reding March 21, 2017, 11:13 a.m. UTC | #2
On Tue, Mar 21, 2017 at 11:27:04AM +0100, Daniel Vetter wrote:
> On Tue, Mar 21, 2017 at 09:13:58AM +0100, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> > 
> > The expression &private->fbdev_helper can never be NULL, so the check is
> > completely unnecessary.
> > 
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> 
> On the 3 drivers patches (all except exynos):
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> For merging, do you want to push it all through drm-misc? Or planning on
> sending a pull request to Dave?

I think this is perfect material for drm-misc. I'll resend v4 shortly
with a build fix and the fix Andrzej pointed out folded into the Exynos
driver.

Thierry
diff mbox

Patch

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index 81f9548672b0..df6bceabeca8 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -168,10 +168,8 @@  rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
 static void rockchip_drm_output_poll_changed(struct drm_device *dev)
 {
 	struct rockchip_drm_private *private = dev->dev_private;
-	struct drm_fb_helper *fb_helper = &private->fbdev_helper;
 
-	if (fb_helper)
-		drm_fb_helper_hotplug_event(fb_helper);
+	drm_fb_helper_hotplug_event(&private->fbdev_helper);
 }
 
 static void