From 8a03afe94763108537e33b48378bbc7472b4cc9d Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Tue, 2 Dec 2025 19:37:39 +0000 Subject: [PATCH] rust: dma: add __rust_helper to helpers This is needed to inline these helpers into Rust code. Signed-off-by: Alice Ryhl Reviewed-by: Gary Guo Reviewed-by: Boqun Feng Link: https://patch.msgid.link/20251202-define-rust-helper-v1-15-a2e13cbc17a6@google.com Signed-off-by: Danilo Krummrich --- rust/helpers/dma.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/rust/helpers/dma.c b/rust/helpers/dma.c index 6e741c1972425..8c7e8d7b888e3 100644 --- a/rust/helpers/dma.c +++ b/rust/helpers/dma.c @@ -2,20 +2,23 @@ #include -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); } -- 2.47.3