Commit f0d2e86c authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/atomic: Remove unneeded null check for private objects

It can be seen in drm_atomic_get_private_obj_state() that
ptr will never be NULL, so skip the check for that case.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-1-maarten.lankhorst@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 15438ab0
...@@ -182,9 +182,6 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) ...@@ -182,9 +182,6 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state)
for (i = 0; i < state->num_private_objs; i++) { for (i = 0; i < state->num_private_objs; i++) {
struct drm_private_obj *obj = state->private_objs[i].ptr; struct drm_private_obj *obj = state->private_objs[i].ptr;
if (!obj)
continue;
obj->funcs->atomic_destroy_state(obj, obj->funcs->atomic_destroy_state(obj,
state->private_objs[i].state); state->private_objs[i].state);
state->private_objs[i].ptr = NULL; state->private_objs[i].ptr = NULL;
......
...@@ -768,8 +768,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); ...@@ -768,8 +768,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
((obj) = (__state)->private_objs[__i].ptr, \ ((obj) = (__state)->private_objs[__i].ptr, \
(old_obj_state) = (__state)->private_objs[__i].old_state, \ (old_obj_state) = (__state)->private_objs[__i].old_state, \
(new_obj_state) = (__state)->private_objs[__i].new_state, 1); \ (new_obj_state) = (__state)->private_objs[__i].new_state, 1); \
(__i)++) \ (__i)++)
for_each_if (obj)
/** /**
* for_each_old_private_obj_in_state - iterate over all private objects in an atomic update * for_each_old_private_obj_in_state - iterate over all private objects in an atomic update
...@@ -787,8 +786,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); ...@@ -787,8 +786,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i) < (__state)->num_private_objs && \ (__i) < (__state)->num_private_objs && \
((obj) = (__state)->private_objs[__i].ptr, \ ((obj) = (__state)->private_objs[__i].ptr, \
(old_obj_state) = (__state)->private_objs[__i].old_state, 1); \ (old_obj_state) = (__state)->private_objs[__i].old_state, 1); \
(__i)++) \ (__i)++)
for_each_if (obj)
/** /**
* for_each_new_private_obj_in_state - iterate over all private objects in an atomic update * for_each_new_private_obj_in_state - iterate over all private objects in an atomic update
...@@ -806,8 +804,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p); ...@@ -806,8 +804,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i) < (__state)->num_private_objs && \ (__i) < (__state)->num_private_objs && \
((obj) = (__state)->private_objs[__i].ptr, \ ((obj) = (__state)->private_objs[__i].ptr, \
(new_obj_state) = (__state)->private_objs[__i].new_state, 1); \ (new_obj_state) = (__state)->private_objs[__i].new_state, 1); \
(__i)++) \ (__i)++)
for_each_if (obj)
/** /**
* drm_atomic_crtc_needs_modeset - compute combined modeset need * drm_atomic_crtc_needs_modeset - compute combined modeset need
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment