Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/vm: Simplify if condition
@ 2024-06-03 18:00 Thorsten Blum
  2024-06-04 18:06 ` Matthew Brost
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Thorsten Blum @ 2024-06-03 18:00 UTC (permalink / raw)
  To: lucas.demarchi, ogabbay, thomas.hellstrom, maarten.lankhorst,
	mripard, tzimmermann, airlied, daniel
  Cc: intel-xe, dri-devel, linux-kernel, Thorsten Blum

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>
---
 drivers/gpu/drm/xe/xe_vm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 4aa3943e6f29..3137cbbaabde 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -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;
 		}
 	}
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-05 16:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 18:00 [PATCH] drm/xe/vm: Simplify if condition Thorsten Blum
2024-06-04 18:06 ` Matthew Brost
2024-06-05 16:37   ` Matthew Brost
2024-06-05  1:54 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-05  1:54 ` ✓ CI.checkpatch: " Patchwork
2024-06-05  1:55 ` ✓ CI.KUnit: " Patchwork
2024-06-05  2:07 ` ✓ CI.Build: " Patchwork
2024-06-05  2:07 ` ✗ CI.Hooks: failure " Patchwork
2024-06-05  2:08 ` ✓ CI.checksparse: success " Patchwork
2024-06-05  2:36 ` ✓ CI.BAT: " Patchwork
2024-06-05 11:10 ` ✗ CI.FULL: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox