Commit 3f5ea7ed authored by Thorsten Blum's avatar Thorsten Blum Committed by Thomas Zimmermann

drm/managed: Simplify if condition

The if condition !A || A && B can be simplified to !A || B.

Fixes the following Coccinelle/coccicheck warning reported by
excluded_middle.cocci:

	WARNING !A || A && B is equivalent to !A || B

Compile-tested only.
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: default avatarThorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240701195607.228852-1-thorsten.blum@toblux.com
parent b84c28f3
...@@ -197,7 +197,7 @@ void drmm_release_action(struct drm_device *dev, ...@@ -197,7 +197,7 @@ void drmm_release_action(struct drm_device *dev,
spin_lock_irqsave(&dev->managed.lock, flags); spin_lock_irqsave(&dev->managed.lock, flags);
list_for_each_entry_reverse(dr, &dev->managed.resources, node.entry) { list_for_each_entry_reverse(dr, &dev->managed.resources, node.entry) {
if (dr->node.release == action) { if (dr->node.release == action) {
if (!data || (data && *(void **)dr->data == data)) { if (!data || *(void **)dr->data == data) {
dr_match = dr; dr_match = dr;
del_dr(dev, dr_match); del_dr(dev, dr_match);
break; break;
......
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