From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: dma/contiguous: Fix broken build
Date: Tue, 31 Mar 2026 17:07:44 +1000 [thread overview]
Message-ID: <review-patch1-20260330-dma-build-fix-v2-1-26d844575815@kernel.org> (raw)
In-Reply-To: <20260330-dma-build-fix-v2-1-26d844575815@kernel.org>
Patch Review
**Commit message**: The description is clear about the problem and rationale. One sentence is grammatically broken:
> In the case where the default CMA region is not defined in the DT though used to be the case covered by the now removed dma_heap_cma_register_heap() in dma_contiguous_reserve().
This should read something like: "In the case where the default CMA region is not defined in the DT, this used to be the case covered by..."
**Forward declaration and stub** (`kernel/dma/contiguous.c`):
```c
+#ifdef CONFIG_OF_RESERVED_MEM
+static int rmem_cma_insert_area(struct cma *cma);
+#else
+static inline int rmem_cma_insert_area(struct cma *cma)
+{
+ return 0;
+}
+#endif
```
This is the correct pattern for conditionally-compiled functions in the kernel. The `#else` stub returning 0 means that when `CONFIG_OF_RESERVED_MEM` is disabled, the default CMA area silently won't be queued for legacy-name heap creation. This seems acceptable since:
- The "default_cma_region" name is still created via `dev_get_cma_area()` in the CMA heap driver.
- The legacy name is primarily relevant for DT-based systems, which would have `CONFIG_OF_RESERVED_MEM` enabled.
One minor concern: the forward declaration lacks `__init`. If the actual definition of `rmem_cma_insert_area()` (from commit 3a236f6a5cf2) is marked `__init`, there would be a section mismatch warning. I can't verify this since the function definition isn't in the drm-next tree I have access to, but it's worth checking.
**Call site replacement** (`kernel/dma/contiguous.c`):
```c
- ret = dma_heap_cma_register_heap(dma_contiguous_default_area);
+ ret = rmem_cma_insert_area(dma_contiguous_default_area);
if (ret)
- pr_warn("Couldn't register default CMA heap.");
+ pr_warn("Couldn't queue default CMA region for heap creation.");
```
Clean replacement. The updated warning message is more accurate for the new semantics.
**Header removal** (`include/linux/dma-buf/heaps/cma.h`): The header only contained the `dma_heap_cma_register_heap()` declaration. With the function gone, removing the entire header and its includes from `cma_heap.c` and `contiguous.c` is correct cleanup.
**Verdict**: The patch looks correct as a build fix. The only actionable item is the grammatical issue in the commit message and verifying the `__init` annotation on the actual `rmem_cma_insert_area()` definition.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-31 7:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20260330154021eucas1p1ddf347acd21646c96fda4b266ddfc03b@eucas1p1.samsung.com>
2026-03-30 15:40 ` [PATCH v2] dma/contiguous: Fix broken build Maxime Ripard
2026-03-30 17:49 ` Marek Szyprowski
2026-03-31 7:07 ` Claude Code Review Bot [this message]
2026-03-31 7:07 ` Claude review: " Claude Code Review Bot
2026-03-30 8:40 [PATCH] " Maxime Ripard
2026-03-31 7:29 ` Claude review: " Claude Code Review Bot
2026-03-31 7:29 ` 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-20260330-dma-build-fix-v2-1-26d844575815@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