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: refcount: Add __rust_helper to helpers

This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-17-51da5f454a67@google.com

authored by

Alice Ryhl and committed by
Boqun Feng
9ba1aaf2 5e03edae

+5 -5
+5 -5
rust/helpers/refcount.c
··· 2 2 3 3 #include <linux/refcount.h> 4 4 5 - refcount_t rust_helper_REFCOUNT_INIT(int n) 5 + __rust_helper refcount_t rust_helper_REFCOUNT_INIT(int n) 6 6 { 7 7 return (refcount_t)REFCOUNT_INIT(n); 8 8 } 9 9 10 - void rust_helper_refcount_set(refcount_t *r, int n) 10 + __rust_helper void rust_helper_refcount_set(refcount_t *r, int n) 11 11 { 12 12 refcount_set(r, n); 13 13 } 14 14 15 - void rust_helper_refcount_inc(refcount_t *r) 15 + __rust_helper void rust_helper_refcount_inc(refcount_t *r) 16 16 { 17 17 refcount_inc(r); 18 18 } 19 19 20 - void rust_helper_refcount_dec(refcount_t *r) 20 + __rust_helper void rust_helper_refcount_dec(refcount_t *r) 21 21 { 22 22 refcount_dec(r); 23 23 } 24 24 25 - bool rust_helper_refcount_dec_and_test(refcount_t *r) 25 + __rust_helper bool rust_helper_refcount_dec_and_test(refcount_t *r) 26 26 { 27 27 return refcount_dec_and_test(r); 28 28 }