diff mbox

[2/2] drm/crtc_helper/set_config: Remove redundant NULL pointer check on set->mode

Message ID 1452751210-19216-2-git-send-email-gnuiyl@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ying Liu Jan. 14, 2016, 6 a.m. UTC
We've done sanity NULL pointer check on set->mode at the beginning of
drm_crtc_helper_set_config() and bailed out if necessary, thus any later on
check is redundant.

Signed-off-by: Liu Ying <gnuiyl@gmail.com>
---
 drivers/gpu/drm/drm_crtc_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter Jan. 14, 2016, 2:22 p.m. UTC | #1
On Thu, Jan 14, 2016 at 02:00:10PM +0800, Liu Ying wrote:
> We've done sanity NULL pointer check on set->mode at the beginning of
> drm_crtc_helper_set_config() and bailed out if necessary, thus any later on
> check is redundant.
> 
> Signed-off-by: Liu Ying <gnuiyl@gmail.com>

Both applied to drm-misc, thanks.
-Daniel

> ---
>  drivers/gpu/drm/drm_crtc_helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
> index cd3fbc1..e333358 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -551,7 +551,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
>  	if (set->x != set->crtc->x || set->y != set->crtc->y)
>  		fb_changed = true;
>  
> -	if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
> +	if (!drm_mode_equal(set->mode, &set->crtc->mode)) {
>  		DRM_DEBUG_KMS("modes are different, full mode set\n");
>  		drm_mode_debug_printmodeline(&set->crtc->mode);
>  		drm_mode_debug_printmodeline(set->mode);
> -- 
> 2.5.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index cd3fbc1..e333358 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -551,7 +551,7 @@  int drm_crtc_helper_set_config(struct drm_mode_set *set)
 	if (set->x != set->crtc->x || set->y != set->crtc->y)
 		fb_changed = true;
 
-	if (set->mode && !drm_mode_equal(set->mode, &set->crtc->mode)) {
+	if (!drm_mode_equal(set->mode, &set->crtc->mode)) {
 		DRM_DEBUG_KMS("modes are different, full mode set\n");
 		drm_mode_debug_printmodeline(&set->crtc->mode);
 		drm_mode_debug_printmodeline(set->mode);