diff options
author | Thorsten Blum <thorsten.blum@toblux.com> | 2024-07-01 22:56:08 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2024-07-03 11:11:03 +0300 |
commit | 3f5ea7ed705e8effe9cfabf912e769ccb6b7d389 (patch) | |
tree | c3036010025cff2d0a64502ba6bfd4f24f6e9b6d /drivers/gpu/drm/drm_managed.c | |
parent | b84c28f33d35361282d27ac304c888dc1ad38a15 (diff) | |
download | linux-3f5ea7ed705e8effe9cfabf912e769ccb6b7d389.tar.xz |
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
Diffstat (limited to 'drivers/gpu/drm/drm_managed.c')
-rw-r--r-- | drivers/gpu/drm/drm_managed.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_managed.c b/drivers/gpu/drm/drm_managed.c index 7646f67bda4e..79ce86a5bd67 100644 --- a/drivers/gpu/drm/drm_managed.c +++ b/drivers/gpu/drm/drm_managed.c @@ -197,7 +197,7 @@ void drmm_release_action(struct drm_device *dev, spin_lock_irqsave(&dev->managed.lock, flags); list_for_each_entry_reverse(dr, &dev->managed.resources, node.entry) { if (dr->node.release == action) { - if (!data || (data && *(void **)dr->data == data)) { + if (!data || *(void **)dr->data == data) { dr_match = dr; del_dr(dev, dr_match); break; |