Skip to content

Commit 227d195

Browse files
Darksonnojeda
authored andcommitted
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>
1 parent 7caeac0 commit 227d195

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

rust/helpers/build_bug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <linux/errname.h>
44

5-
const char *rust_helper_errname(int err)
5+
__rust_helper const char *rust_helper_errname(int err)
66
{
77
return errname(err);
88
}

rust/helpers/err.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
#include <linux/err.h>
44

5-
__force void *rust_helper_ERR_PTR(long err)
5+
__rust_helper __force void *rust_helper_ERR_PTR(long err)
66
{
77
return ERR_PTR(err);
88
}
99

10-
bool rust_helper_IS_ERR(__force const void *ptr)
10+
__rust_helper bool rust_helper_IS_ERR(__force const void *ptr)
1111
{
1212
return IS_ERR(ptr);
1313
}
1414

15-
long rust_helper_PTR_ERR(__force const void *ptr)
15+
__rust_helper long rust_helper_PTR_ERR(__force const void *ptr)
1616
{
1717
return PTR_ERR(ptr);
1818
}

0 commit comments

Comments
 (0)