Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: dma: add __rust_helper to helpers

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>

authored by

Alice Ryhl and committed by
Danilo Krummrich
8a03afe9 93c7fa74

+9 -6
+9 -6
rust/helpers/dma.c
··· 2 2 3 3 #include <linux/dma-mapping.h> 4 4 5 - void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size, 6 - dma_addr_t *dma_handle, gfp_t flag, 7 - unsigned long attrs) 5 + __rust_helper void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size, 6 + dma_addr_t *dma_handle, 7 + gfp_t flag, unsigned long attrs) 8 8 { 9 9 return dma_alloc_attrs(dev, size, dma_handle, flag, attrs); 10 10 } 11 11 12 - void rust_helper_dma_free_attrs(struct device *dev, size_t size, void *cpu_addr, 13 - dma_addr_t dma_handle, unsigned long attrs) 12 + __rust_helper void rust_helper_dma_free_attrs(struct device *dev, size_t size, 13 + void *cpu_addr, 14 + dma_addr_t dma_handle, 15 + unsigned long attrs) 14 16 { 15 17 dma_free_attrs(dev, size, cpu_addr, dma_handle, attrs); 16 18 } 17 19 18 - int rust_helper_dma_set_mask_and_coherent(struct device *dev, u64 mask) 20 + __rust_helper int rust_helper_dma_set_mask_and_coherent(struct device *dev, 21 + u64 mask) 19 22 { 20 23 return dma_set_mask_and_coherent(dev, mask); 21 24 }