From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/amdgpu: amdgpu{_reset}.h: fix all kernel-doc warnings
Date: Thu, 05 Mar 2026 13:13:38 +1000 [thread overview]
Message-ID: <review-patch1-20260305005556.1222863-1-rdunlap@infradead.org> (raw)
In-Reply-To: <20260305005556.1222863-1-rdunlap@infradead.org>
Patch Review
**Doc fix for `amdgpu_wb` — Correct:**
```c
- * amdgpu_wb - This struct is used for small GPU memory allocation.
+ * struct amdgpu_wb - This struct is used for small GPU memory allocation.
```
Straightforward and correct. The `struct` keyword is required by kernel-doc.
**Enum doc name fixes — Correct:**
The doc comments now use `@AMD_RESET_METHOD_LEGACY`, `@AMD_RESET_METHOD_MODE0`, etc., matching the actual enum member names. Previously the docs used shortened names (`@AMD_RESET_LEGACY`, `@AMD_RESET_MODE0`) that didn't match. The new `@AMD_RESET_METHOD_ON_INIT` description is also a good addition — it was previously undocumented.
**Circular include / forward reference issue — Problem:**
`amdgpu_reset.h` includes `amdgpu.h` at line 27:
```c
#include "amdgpu.h"
```
The patch adds `#include "amdgpu_reset.h"` near line 1335 of `amdgpu.h`:
```c
+#include "amdgpu_reset.h"
```
But `enum amd_reset_method` is used at `amdgpu.h:572`:
```c
enum amd_reset_method (*reset_method)(struct amdgpu_device *adev);
```
When a compilation unit includes `amdgpu.h` first, the compiler reaches line 572 (the `reset_method` function pointer using `enum amd_reset_method`) before the `#include "amdgpu_reset.h"` at line 1335 where the enum is now defined. The enum type is used ~760 lines before it becomes visible.
GCC may tolerate this as a GNU extension (implicit forward declaration of the enum), but it's not clean C and may produce warnings with stricter compilers. A better approach would be to either:
- Place the `#include "amdgpu_reset.h"` before the struct that uses the enum (but this requires care with the circular dependency), or
- Add a forward declaration of the enum before its first use, or
- Break the circular dependency by having `amdgpu_reset.h` not include `amdgpu.h` and instead use forward declarations for the types it needs.
**Unexplained struct reorder in `amdgpu_reset.h`:**
The patch moves `struct amdgpu_reset_control` above `struct amdgpu_reset_handler`. This reordering is not mentioned in the commit message and doesn't fix any kernel-doc warning. Both structs reference each other only through pointers, so the order doesn't matter for compilation, but the change adds unnecessary noise to the diff. If there's a reason for this move, it should be documented in the commit message.
**Minor nit in comment text:**
The MODE0 description still has "the any device" (carried over from the original):
```
* @AMD_RESET_METHOD_MODE0: Reset the entire ASIC. Not currently available for
* the any device.
```
Should be "any device" (drop the extra "the"). Since this patch is already touching these comments, it would be a good opportunity to fix this typo.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-05 3:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 0:55 [PATCH v2] drm/amdgpu: amdgpu{_reset}.h: fix all kernel-doc warnings Randy Dunlap
2026-03-05 3:13 ` Claude Code Review Bot [this message]
2026-03-05 3:13 ` 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-20260305005556.1222863-1-rdunlap@infradead.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