]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/xe/vm: Simplify if condition
authorThorsten Blum <thorsten.blum@toblux.com>
Mon, 3 Jun 2024 18:00:07 +0000 (20:00 +0200)
committerMatthew Brost <matthew.brost@intel.com>
Wed, 5 Jun 2024 16:35:53 +0000 (09:35 -0700)
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.

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240603180005.191578-1-thorsten.blum@toblux.com
drivers/gpu/drm/xe/xe_vm.c

index 26b409e1b0f037690b371a0c7ebb4794a70de43b..99bf7412475c085da557ebfc52ae8a1829a0d657 100644 (file)
@@ -85,8 +85,8 @@ static bool preempt_fences_waiting(struct xe_vm *vm)
 
        list_for_each_entry(q, &vm->preempt.exec_queues, compute.link) {
                if (!q->compute.pfence ||
-                   (q->compute.pfence && test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
-                                                  &q->compute.pfence->flags))) {
+                   test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
+                            &q->compute.pfence->flags)) {
                        return true;
                }
        }