public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: dma-fence: Use dma_fence_set_error() internally
Date: Thu, 04 Jun 2026 11:41:51 +1000	[thread overview]
Message-ID: <review-patch1-20260603150531.2217691-2-phasta@kernel.org> (raw)
In-Reply-To: <20260603150531.2217691-2-phasta@kernel.org>

Patch Review

**Status: Looks good**

The change at `drivers/dma-buf/dma-fence.c:602`:
```c
-		fence->error = -EDEADLK;
+		dma_fence_set_error(fence, -EDEADLK);
```

**Positive aspects:**
- Uses the proper API helper instead of poking the struct field directly, which is exactly what `dma_fence_set_error()` was designed for.
- The additional `WARN_ON` checks in the helper add a safety net — if someone ever manages to hit this path with an already-signaled fence, it will now produce a warning rather than silently corrupting state.
- Commit message is clear and accurately describes the change.

**Minor observations:**
- The commit message says "Only compile-tested" which is reasonable for a one-line cleanup, but the `WARN_ON(test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))` in the helper is worth mentioning in the commit message, since it adds a new runtime check in an error path. It's a beneficial check, but reviewers should be aware it's not a pure no-op substitution.
- The pre-existing race between the unsynchronized `!dma_fence_test_signaled_flag(fence)` check (line 581) and the locked region (line 601) is not introduced by this patch and is not a concern for this review — but if the `WARN_ON` ever fires spuriously in the field, this is the path to investigate.

**Verdict:** Reviewed-by worthy. The patch improves code consistency with negligible risk.

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-06-04  1:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-03 15:05 [PATCH] dma-fence: Use dma_fence_set_error() internally Philipp Stanner
2026-06-04  1:41 ` Claude review: " Claude Code Review Bot
2026-06-04  1:41 ` Claude Code Review Bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch1-20260603150531.2217691-2-phasta@kernel.org \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox