Skip to contentSkip to conversation

dma-mapping: add missing `inline` for `dma_free_attrs`

PATCH Applied Miguel Ojeda 3 participants 3 messages Mar 25

Subsystems (2)
lore
Share & tools
lore

Miguel Ojeda

author maintainer
#0 lore raw

PATCH 1/1 dma-mapping: add missing `inline` for `dma_free_attrs`

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")

---
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(-)
include/linux/dma-mapping.h +2 -2
index 29973baa0581..f46a0848cb24 100644
@@ -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

maintainer Applied
#1 lore raw
Quoted 13 lines · Miguel Ojeda

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

Quoted 8 lines

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")

Applied to dma-mapping-fixes, thanks!

Quoted 24 lines

---
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(-)
include/linux/dma-mapping.h +2 -2
index 29973baa0581..f46a0848cb24 100644
@@ -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,
Quoted 4 lines

base-commit: c369299895a591d96745d6492d4888259b004a9e --
2.53.0

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Reviewed-by on v1 1/1
#2 lore raw
In reply to Miguel Ojeda
Quoted 21 lines · Miguel Ojeda

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")
Quoted 8 lines

---
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,