From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: rcar-du: Use __free() to simplify device_node handling
Date: Wed, 25 Mar 2026 07:42:40 +1000 [thread overview]
Message-ID: <review-patch3-20260323164526.2292491-4-laurent.pinchart+renesas@ideasonboard.com> (raw)
In-Reply-To: <20260323164526.2292491-4-laurent.pinchart+renesas@ideasonboard.com>
Patch Review
**Status: Good, one minor style nit**
The `__free(device_node)` usage is correct in all three cases:
1. **`entity` in `rcar_du_encoders_init_one()`**: Simple function-scoped lifetime, replaces two `of_node_put()` calls.
2. **`ep_node` in `rcar_du_encoders_init()`**: Used with `for_each_endpoint_of_node()`. This works correctly because:
- On early `return`, `__free` puts the current node reference (previously needed manual `of_node_put(ep_node)`)
- On normal loop completion, `ep_node` is NULL, and `of_node_put(NULL)` is a no-op
- On `continue`, the macro's next iteration handles the put internally
3. **`cmm` in `rcar_du_cmm_init()`**: Simple loop-scoped lifetime, replaces three `of_node_put()` calls.
**Minor style nit:** After patch 3, the following pattern appears:
```c
if (!of_device_is_available(cmm))
/* It's fine to have a phandle to a non-enabled CMM. */
continue;
```
This places a comment between an `if` condition and its body without braces. While technically valid C, the kernel coding style (and common sense) would prefer braces here since the comment makes it look like two statements under the `if`. The original code had braces. Consider keeping them:
```c
if (!of_device_is_available(cmm)) {
/* It's fine to have a phandle to a non-enabled CMM. */
continue;
}
```
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-24 21:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 16:45 [PATCH v2 0/4] drm: rcar-du: Improve device_link handling Laurent Pinchart
2026-03-23 16:45 ` [PATCH v2 1/4] drm: rcar-du: Ensure correct suspend/resume ordering with VSP Laurent Pinchart
2026-03-24 21:42 ` Claude review: " Claude Code Review Bot
2026-03-23 16:45 ` [PATCH v2 2/4] drm: rcar-du: Store CMM device pointer instead of platform_device Laurent Pinchart
2026-03-24 21:42 ` Claude review: " Claude Code Review Bot
2026-03-23 16:45 ` [PATCH v2 3/4] drm: rcar-du: Use __free() to simplify device_node handling Laurent Pinchart
2026-03-24 21:42 ` Claude Code Review Bot [this message]
2026-03-23 16:45 ` [PATCH v2 4/4] drm: rcar-du: Don't leak device_link to CMM Laurent Pinchart
2026-03-24 21:42 ` Claude review: " Claude Code Review Bot
2026-03-24 21:42 ` Claude review: drm: rcar-du: Improve device_link handling 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-patch3-20260323164526.2292491-4-laurent.pinchart+renesas@ideasonboard.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