* [PATCH] dma-mapping: add missing `inline` for `dma_free_attrs`
@ 2026-03-25 1:55 ` Miguel Ojeda
2026-03-25 7:02 ` Marek Szyprowski
2026-03-25 8:34 ` Leon Romanovsky
0 siblings, 2 replies; 3+ messages in thread
From: Miguel Ojeda @ 2026-03-25 1:55 UTC (permalink / raw)
To: Marek Szyprowski, Miguel Ojeda, Alex Gaynor
Cc: Robin Murphy, iommu, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, rust-for-linux
Under an UML build for an upcoming series [1], 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
The issue is that `dma_free_attrs` was not marked `inline` when it was
introduced alongside the rest of the stubs.
Thus mark it.
Fixes: ed6ccf10f24b ("dma-mapping: properly stub out the DMA API for !CONFIG_HAS_DMA")
Closes: https://lore.kernel.org/rust-for-linux/20260322194616.89847-1-ojeda@kernel.org/ [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
---
Not sure if you would consider this a bug (I used "Fixes" and "Closes"
because it was not originally intended) or whether you would want to
backport it -- of course, feel free to edit the tags as you prefer!
include/linux/dma-mapping.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 29973baa0581..f46a0848cb24 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -248,8 +248,8 @@ static inline void *dma_alloc_attrs(struct device *dev, size_t size,
{
return NULL;
}
-static void dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
- dma_addr_t dma_handle, unsigned long attrs)
+static inline void dma_free_attrs(struct device *dev, size_t size,
+ void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
{
}
static inline void *dmam_alloc_attrs(struct device *dev, size_t size,
base-commit: c369299895a591d96745d6492d4888259b004a9e
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] dma-mapping: add missing `inline` for `dma_free_attrs`
2026-03-25 1:55 ` [PATCH] dma-mapping: add missing `inline` for `dma_free_attrs` Miguel Ojeda
@ 2026-03-25 7:02 ` Marek Szyprowski
2026-03-25 8:34 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Marek Szyprowski @ 2026-03-25 7:02 UTC (permalink / raw)
To: Miguel Ojeda, Alex Gaynor
Cc: Robin Murphy, iommu, Boqun Feng, Gary Guo, Björn Roy Baron,
Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
Danilo Krummrich, rust-for-linux
On 25.03.2026 02:55, Miguel Ojeda wrote:
> Under an UML build for an upcoming series [1], 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
>
> The issue is that `dma_free_attrs` was not marked `inline` when it was
> introduced alongside the rest of the stubs.
>
> Thus mark it.
>
> Fixes: ed6ccf10f24b ("dma-mapping: properly stub out the DMA API for !CONFIG_HAS_DMA")
> Closes: https://lore.kernel.org/rust-for-linux/20260322194616.89847-1-ojeda@kernel.org/ [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Applied to dma-mapping-fixes, thanks!
> ---
> Not sure if you would consider this a bug (I used "Fixes" and "Closes"
> because it was not originally intended) or whether you would want to
> backport it -- of course, feel free to edit the tags as you prefer!
>
> include/linux/dma-mapping.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index 29973baa0581..f46a0848cb24 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -248,8 +248,8 @@ static inline void *dma_alloc_attrs(struct device *dev, size_t size,
> {
> return NULL;
> }
> -static void dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
> - dma_addr_t dma_handle, unsigned long attrs)
> +static inline void dma_free_attrs(struct device *dev, size_t size,
> + void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
> {
> }
> static inline void *dmam_alloc_attrs(struct device *dev, size_t size,
>
> base-commit: c369299895a591d96745d6492d4888259b004a9e
> --
> 2.53.0
>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] dma-mapping: add missing `inline` for `dma_free_attrs`
2026-03-25 1:55 ` [PATCH] dma-mapping: add missing `inline` for `dma_free_attrs` Miguel Ojeda
2026-03-25 7:02 ` Marek Szyprowski
@ 2026-03-25 8:34 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2026-03-25 8:34 UTC (permalink / raw)
To: Miguel Ojeda
Cc: Marek Szyprowski, Alex Gaynor, Robin Murphy, iommu, Boqun Feng,
Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
Alice Ryhl, Trevor Gross, Danilo Krummrich, rust-for-linux
On Wed, Mar 25, 2026 at 02:55:48AM +0100, Miguel Ojeda wrote:
> Under an UML build for an upcoming series [1], 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
>
> The issue is that `dma_free_attrs` was not marked `inline` when it was
> introduced alongside the rest of the stubs.
>
> Thus mark it.
>
> Fixes: ed6ccf10f24b ("dma-mapping: properly stub out the DMA API for !CONFIG_HAS_DMA")
> Closes: https://lore.kernel.org/rust-for-linux/20260322194616.89847-1-ojeda@kernel.org/ [1]
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
> Not sure if you would consider this a bug (I used "Fixes" and "Closes"
> because it was not originally intended) or whether you would want to
> backport it -- of course, feel free to edit the tags as you prefer!
>
> include/linux/dma-mapping.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-25 8:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20260325015610eucas1p29097fe4c456890db026adb691da60c12@eucas1p2.samsung.com>
2026-03-25 1:55 ` [PATCH] dma-mapping: add missing `inline` for `dma_free_attrs` Miguel Ojeda
2026-03-25 7:02 ` Marek Szyprowski
2026-03-25 8:34 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox