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: rcar-du: Use __free() to simplify device_node handling Date: Wed, 25 Mar 2026 07:42:40 +1000 Message-ID: In-Reply-To: <20260323164526.2292491-4-laurent.pinchart+renesas@ideasonboard.com> References: <20260323164526.2292491-1-laurent.pinchart+renesas@ideasonboard.com> <20260323164526.2292491-4-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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