public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: dma-buf: heaps: cma: Turn the heap into a module
Date: Fri, 27 Feb 2026 13:12:04 +1000	[thread overview]
Message-ID: <review-patch6-20260225-dma-buf-heaps-as-modules-v1-6-2109225a090d@kernel.org> (raw)
In-Reply-To: <20260225-dma-buf-heaps-as-modules-v1-6-2109225a090d@kernel.org>

Patch Review

```c
-	bool "DMA-BUF CMA Heap"
+	tristate "DMA-BUF CMA Heap"
```

```c
+MODULE_LICENSE("GPL");
+MODULE_IMPORT_NS("DMA_BUF");
+MODULE_IMPORT_NS("DMA_BUF_HEAP");
```

**Issue - No `module_exit` function:**
The patch adds `MODULE_LICENSE` but does not add a `module_exit()` handler. When built as a module, this means the module cannot be unloaded. While this may be acceptable (many kernel modules are not unloadable), it should either:
1. Be explicitly documented/noted in the commit message that the module is intentionally non-unloadable, or
2. Have a `module_exit()` added that calls `dma_heap_remove()` or similar cleanup (if such an API exists).

Currently the existing code already has `module_init(add_cma_heaps)` but no exit. This works for built-in, but for a module it means `rmmod` will fail.

**Issue - `__init` annotations become no-ops for modules:**
Both `__add_cma_heap` and `add_cma_heaps` are marked `__init`:

```c
static int __init __add_cma_heap(struct cma *cma, const char *name)
...
static int __init add_cma_heaps(void)
```

When compiled as a module, `__init` is defined as nothing (it's a no-op for modules). This is safe but means the functions persist in module memory. This is the standard behavior and not a bug, just worth being aware of.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-02-27  3:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 16:41 [PATCH 0/7] dma-buf: heaps: Turn heaps into modules Maxime Ripard
2026-02-25 16:41 ` [PATCH 1/7] dma: contiguous: Turn heap registration logic around Maxime Ripard
2026-02-25 19:32   ` T.J. Mercier
2026-02-27  3:12   ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 2/7] mm: cma: Export cma_alloc and cma_release Maxime Ripard
2026-02-25 19:34   ` T.J. Mercier
2026-02-26 10:25   ` David Hildenbrand (Arm)
2026-02-26 10:38     ` Maxime Ripard
2026-02-26 10:49       ` David Hildenbrand (Arm)
2026-02-26 16:58       ` T.J. Mercier
2026-02-27  3:12   ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 3/7] mm: cma: Export cma_get_name Maxime Ripard
2026-02-25 19:34   ` T.J. Mercier
2026-02-27  3:12   ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 4/7] mm: cma: Export dma_contiguous_default_area Maxime Ripard
2026-02-25 19:52   ` T.J. Mercier
2026-02-27  3:12   ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 5/7] dma-buf: heaps: Export mem_accounting parameter Maxime Ripard
2026-02-25 19:53   ` T.J. Mercier
2026-02-27  3:12   ` Claude review: " Claude Code Review Bot
2026-02-25 16:41 ` [PATCH 6/7] dma-buf: heaps: cma: Turn the heap into a module Maxime Ripard
2026-02-25 19:54   ` T.J. Mercier
2026-02-27  3:12   ` Claude Code Review Bot [this message]
2026-02-25 16:41 ` [PATCH 7/7] dma-buf: heaps: system: " Maxime Ripard
2026-02-25 19:55   ` T.J. Mercier
2026-02-27  3:12   ` Claude review: " Claude Code Review Bot
2026-02-25 18:51 ` [PATCH 0/7] dma-buf: heaps: Turn heaps into modules John Stultz
2026-02-26 10:18   ` Maxime Ripard
2026-02-26 18:03     ` John Stultz
2026-02-27  3:12 ` Claude review: " Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-03 10:13 [PATCH v3 0/8] " Maxime Ripard
2026-03-03 10:13 ` [PATCH v3 7/8] dma-buf: heaps: cma: Turn the heap into a module Maxime Ripard
2026-03-03 21:41   ` Claude review: " 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-patch6-20260225-dma-buf-heaps-as-modules-v1-6-2109225a090d@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