Re: [PATCH v2 0/3] Inline helpers into Rust without full LTO

From: Marek Szyprowski

Date: Mon Mar 23 2026 - 04:50:49 EST


On 22.03.2026 20:46, Miguel Ojeda wrote:
> On Sun, 22 Mar 2026 20:21:59 +0100 Miguel Ojeda <ojeda@xxxxxxxxxx> wrote:
>> I will reply to a couple other bindings in separate emails to avoid
>> spamming people too much.
> Under UML, I got `-Wstatic-in-inline` for `dma_free_attrs`:
>
> BINDGEN rust/bindings/bindings_generated.rs - due to target missing
> In file included from rust/helpers/helpers.c:59:
> rust/helpers/dma.c:17:2: warning: static function 'dma_free_attrs' is used in an inline function with external linkage [-Wstatic-in-inline]
> 17 | dma_free_attrs(dev, size, cpu_addr, dma_handle, attrs);
> | ^
> rust/helpers/dma.c:12:1: note: use 'static' to give inline function 'rust_helper_dma_free_attrs' internal linkage
> 12 | __rust_helper void rust_helper_dma_free_attrs(struct device *dev, size_t size,
> | ^
> | static
>
> For some reason, `dma_free_attrs` is not marked `inline` in
> `include/linux/dma-mapping.h` to begin with, unlike the rest.
>
> Unless I am missing something and there is a reason for that, it looks
> like it has just been missing since it was added in commit ed6ccf10f24b
> ("dma-mapping: properly stub out the DMA API for !CONFIG_HAS_DMA").
>
> Do you want a patch?

Yes please, this looks like an oversight.

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland