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: device: 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-14-a2e13cbc17a6@google.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Alice Ryhl and committed by
Danilo Krummrich
93c7fa74 3365b71b

+8 -8
+8 -8
rust/helpers/device.c
··· 2 2 3 3 #include <linux/device.h> 4 4 5 - int rust_helper_devm_add_action(struct device *dev, 6 - void (*action)(void *), 7 - void *data) 5 + __rust_helper int rust_helper_devm_add_action(struct device *dev, 6 + void (*action)(void *), 7 + void *data) 8 8 { 9 9 return devm_add_action(dev, action, data); 10 10 } 11 11 12 - int rust_helper_devm_add_action_or_reset(struct device *dev, 13 - void (*action)(void *), 14 - void *data) 12 + __rust_helper int rust_helper_devm_add_action_or_reset(struct device *dev, 13 + void (*action)(void *), 14 + void *data) 15 15 { 16 16 return devm_add_action_or_reset(dev, action, data); 17 17 } 18 18 19 - void *rust_helper_dev_get_drvdata(const struct device *dev) 19 + __rust_helper void *rust_helper_dev_get_drvdata(const struct device *dev) 20 20 { 21 21 return dev_get_drvdata(dev); 22 22 } 23 23 24 - void rust_helper_dev_set_drvdata(struct device *dev, void *data) 24 + __rust_helper void rust_helper_dev_set_drvdata(struct device *dev, void *data) 25 25 { 26 26 dev_set_drvdata(dev, data); 27 27 }