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: err: 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>
Link: https://patch.msgid.link/20260105-define-rust-helper-v2-8-51da5f454a67@google.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

authored by

Alice Ryhl and committed by
Miguel Ojeda
227d1955 7caeac0b

+4 -4
+1 -1
rust/helpers/build_bug.c
··· 2 2 3 3 #include <linux/errname.h> 4 4 5 - const char *rust_helper_errname(int err) 5 + __rust_helper const char *rust_helper_errname(int err) 6 6 { 7 7 return errname(err); 8 8 }
+3 -3
rust/helpers/err.c
··· 2 2 3 3 #include <linux/err.h> 4 4 5 - __force void *rust_helper_ERR_PTR(long err) 5 + __rust_helper __force void *rust_helper_ERR_PTR(long err) 6 6 { 7 7 return ERR_PTR(err); 8 8 } 9 9 10 - bool rust_helper_IS_ERR(__force const void *ptr) 10 + __rust_helper bool rust_helper_IS_ERR(__force const void *ptr) 11 11 { 12 12 return IS_ERR(ptr); 13 13 } 14 14 15 - long rust_helper_PTR_ERR(__force const void *ptr) 15 + __rust_helper long rust_helper_PTR_ERR(__force const void *ptr) 16 16 { 17 17 return PTR_ERR(ptr); 18 18 }