From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/ttm/tests: fix lru_count ASSERT
Date: Sun, 12 Apr 2026 11:28:14 +1000 [thread overview]
Message-ID: <review-patch1-20260409111032.72141-2-matthew.auld@intel.com> (raw)
In-Reply-To: <20260409111032.72141-2-matthew.auld@intel.com>
Patch Review
**The bug:** After pool initialization via `__list_lru_init -> init_one_lru`, the LRU count for each node should be zero. The original assertion had a spurious `!` negation:
```c
KUNIT_ASSERT_FALSE(test,
!list_lru_count(&pt.pages));
```
`KUNIT_ASSERT_FALSE(test, !list_lru_count(...))` means "assert that `!count` is false", which is equivalent to "assert count is **non-zero**". That's the opposite of what the test intended — it should be verifying the LRU is empty after initialization.
**The fix:** Removing the `!` gives:
```c
KUNIT_ASSERT_FALSE(test,
list_lru_count(&pt.pages));
```
This correctly asserts that `list_lru_count(&pt.pages)` is zero (falsy), matching the expected post-init state.
I confirmed that the kernel tree at `drivers/gpu/drm/ttm/tests/ttm_device_test.c:178-179` already has the corrected version (without the `!`), consistent with this fix having been applied on drm-next.
**Minor style observation:** Using `KUNIT_ASSERT_EQ(test, list_lru_count(&pt.pages), 0)` would make the intent unambiguous and avoid future confusion with negation, but the existing form is fine and consistent with current test style.
**Reviewed-by worthy:** Yes. The fix is correct, minimal, and well-described. The `Fixes:` tag is appropriate (references `444e2a19d7fd` which ported ttm/pool to list_lru and introduced this test).
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-12 1:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 11:10 [PATCH] drm/ttm/tests: fix lru_count ASSERT Matthew Auld
2026-04-09 12:07 ` Knop, Ryszard
2026-04-09 12:18 ` [PATCH] " Christian König
2026-04-12 1:28 ` Claude Code Review Bot [this message]
2026-04-12 1:28 ` Claude review: " Claude Code Review Bot
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-20260409111032.72141-2-matthew.auld@intel.com \
--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