]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: dma: add __rust_helper to helpers
authorAlice Ryhl <aliceryhl@google.com>
Tue, 2 Dec 2025 19:37:39 +0000 (19:37 +0000)
committerDanilo Krummrich <dakr@kernel.org>
Mon, 15 Dec 2025 21:26:10 +0000 (22:26 +0100)
This is needed to inline these helpers into Rust code.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20251202-define-rust-helper-v1-15-a2e13cbc17a6@google.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/helpers/dma.c

index 6e741c197242572844fe550de4ddcd93520cbb42..8c7e8d7b888e3fe456b50cbb2a75306cc2a6cc2a 100644 (file)
@@ -2,20 +2,23 @@
 
 #include <linux/dma-mapping.h>
 
-void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size,
-                                 dma_addr_t *dma_handle, gfp_t flag,
-                                 unsigned long attrs)
+__rust_helper void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size,
+                                               dma_addr_t *dma_handle,
+                                               gfp_t flag, unsigned long attrs)
 {
        return dma_alloc_attrs(dev, size, dma_handle, flag, attrs);
 }
 
-void rust_helper_dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
-                               dma_addr_t dma_handle, unsigned long attrs)
+__rust_helper void rust_helper_dma_free_attrs(struct device *dev, size_t size,
+                                             void *cpu_addr,
+                                             dma_addr_t dma_handle,
+                                             unsigned long attrs)
 {
        dma_free_attrs(dev, size, cpu_addr, dma_handle, attrs);
 }
 
-int rust_helper_dma_set_mask_and_coherent(struct device *dev, u64 mask)
+__rust_helper int rust_helper_dma_set_mask_and_coherent(struct device *dev,
+                                                       u64 mask)
 {
        return dma_set_mask_and_coherent(dev, mask);
 }