From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/atomic: Remove state argument to drm_atomic_private_obj_init
Date: Fri, 27 Feb 2026 15:05:37 +1000 [thread overview]
Message-ID: <review-patch4-20260224-drm-private-obj-reset-v5-4-5a72f8ec9934@kernel.org> (raw)
In-Reply-To: <20260224-drm-private-obj-reset-v5-4-5a72f8ec9934@kernel.org>
Patch Review
**Commit message**: Clear. Has multiple Reviewed-by tags (Dmitry Baryshkov, Tomi Valkeinen, Liviu Dudau, Maíra Canal), which is good.
**Code review**:
The core change in `drm_atomic.c` is clean and correct:
```c
int drm_atomic_private_obj_init(struct drm_device *dev,
struct drm_private_obj *obj,
const struct drm_private_state_funcs *funcs)
{
struct drm_private_state *state;
memset(obj, 0, sizeof(*obj));
drm_modeset_lock_init(&obj->lock);
obj->dev = dev;
obj->funcs = funcs;
list_add_tail(&obj->head, &dev->mode_config.privobj_list);
state = obj->funcs->atomic_create_state(obj);
if (IS_ERR(state))
return PTR_ERR(state);
obj->state = state;
return 0;
}
```
The removal of the fallback path and state parameter is the logical conclusion of the conversion. The function is now simpler and has a single code path.
**Nit**: When the function returns an error from `atomic_create_state`, the object has already been added to `dev->mode_config.privobj_list` with `obj->state = NULL` (from memset). This could be problematic if anything iterates the list before the caller has a chance to clean up. Consider moving the `list_add_tail` after the successful state creation, or removing from the list on error. This is a pre-existing issue from the earlier NULL-handling code, but now is a good time to fix it.
All driver-side changes in this patch are purely mechanical removal of the `NULL` argument from every `drm_atomic_private_obj_init()` call — these are all correct.
The header change removing the parameter from the declaration is correct:
```c
int drm_atomic_private_obj_init(struct drm_device *dev,
struct drm_private_obj *obj,
- struct drm_private_state *state,
const struct drm_private_state_funcs *funcs);
```
**No issues with this patch itself.**
---
### Cover Letter Note
The v3 changelog was not filled in:
```
Changes in v3:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
```
This is a minor cosmetic issue but looks unprofessional in the archives. Should be fixed if a v6 is needed.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-27 5:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-24 16:10 [PATCH v5 0/4] drm/atomic: Allocate drm_private_state through a callback Maxime Ripard
2026-02-24 16:10 ` [PATCH v5 1/4] drm/amdgpu: Switch private_obj initialization to atomic_create_state Maxime Ripard
2026-02-27 5:05 ` Claude review: " Claude Code Review Bot
2026-02-24 16:10 ` [PATCH v5 2/4] drm/omapdrm: " Maxime Ripard
2026-02-27 5:05 ` Claude review: " Claude Code Review Bot
2026-02-24 16:10 ` [PATCH v5 3/4] drm/tegra: " Maxime Ripard
2026-02-27 5:05 ` Claude review: " Claude Code Review Bot
2026-02-24 16:10 ` [PATCH v5 4/4] drm/atomic: Remove state argument to drm_atomic_private_obj_init Maxime Ripard
2026-02-27 5:05 ` Claude Code Review Bot [this message]
2026-02-27 5:05 ` Claude review: drm/atomic: Allocate drm_private_state through a callback 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-patch4-20260224-drm-private-obj-reset-v5-4-5a72f8ec9934@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