drm/atomic: Remove pointless private object NULL state check
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 12 Jul 2017 15:51:01 +0000 (18:51 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 13 Jul 2017 16:28:43 +0000 (19:28 +0300)
We will never add private objects with a NULL state into the atomic
state, hence checking for that is pointless.

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170712155102.26276-2-ville.syrjala@linux.intel.com
drivers/gpu/drm/drm_atomic.c

index 09ca662fcd35fd105505df3ac3f42b1515cdf0c2..f0482247b31faaa89d897a6dc6388726dff8b5a3 100644 (file)
@@ -1013,8 +1013,7 @@ drm_atomic_get_private_obj_state(struct drm_atomic_state *state, void *obj,
        struct __drm_private_objs_state *arr;
 
        for (i = 0; i < state->num_private_objs; i++)
-               if (obj == state->private_objs[i].obj &&
-                   state->private_objs[i].obj_state)
+               if (obj == state->private_objs[i].obj)
                        return state->private_objs[i].obj_state;
 
        num_objs = state->num_private_objs + 1;