From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260305005556.1222863-1-rdunlap@infradead.org> References: <20260305005556.1222863-1-rdunlap@infradead.org> <20260305005556.1222863-1-rdunlap@infradead.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Doc fix for `amdgpu_wb` =E2=80=94 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 =E2=80=94 Correct:** The doc comments now use `@AMD_RESET_METHOD_LEGACY`, `@AMD_RESET_METHOD_MOD= E0`, 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 = =E2=80=94 it was previously undocumented. **Circular include / forward reference issue =E2=80=94 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 lin= e 572 (the `reset_method` function pointer using `enum amd_reset_method`) b= efore the `#include "amdgpu_reset.h"` at line 1335 where the enum is now de= fined. The enum type is used ~760 lines before it becomes visible. GCC may tolerate this as a GNU extension (implicit forward declaration of t= he enum), but it's not clean C and may produce warnings with stricter compi= lers. A better approach would be to either: - Place the `#include "amdgpu_reset.h"` before the struct that uses the enu= m (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 `amd= gpu.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_ha= ndler`. 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 ori= ginal): ``` * @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