Skip to content

Commit 3f5ea7e

Browse files
tobluxtdz
authored andcommitted
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: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240701195607.228852-1-thorsten.blum@toblux.com
1 parent b84c28f commit 3f5ea7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/drm_managed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void drmm_release_action(struct drm_device *dev,
197197
spin_lock_irqsave(&dev->managed.lock, flags);
198198
list_for_each_entry_reverse(dr, &dev->managed.resources, node.entry) {
199199
if (dr->node.release == action) {
200-
if (!data || (data && *(void **)dr->data == data)) {
200+
if (!data || *(void **)dr->data == data) {
201201
dr_match = dr;
202202
del_dr(dev, dr_match);
203203
break;

0 commit comments

Comments
 (0)