From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260225-dma-buf-heaps-as-modules-v1-6-2109225a090d@kernel.org> References: <20260225-dma-buf-heaps-as-modules-v1-0-2109225a090d@kernel.org> <20260225-dma-buf-heaps-as-modules-v1-6-2109225a090d@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 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