]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: helpers: Move #define __rust_helper out of atomic.c
authorAlice Ryhl <aliceryhl@google.com>
Wed, 7 Jan 2026 14:14:13 +0000 (14:14 +0000)
committerBoqun Feng <boqun.feng@gmail.com>
Fri, 9 Jan 2026 11:01:42 +0000 (19:01 +0800)
In order to support inline helpers [1], we need to have __rust_helper
defined for all helper files. Current we are lucky that atomic.c is the
first file in helpers.c, but this is fragile. Thus, move it to
helpers.c.

[boqun: Reword the commit message and apply file hash changes]

Link: https://lore.kernel.org/r/20260105-define-rust-helper-v2-0-51da5f454a67@google.com
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Link: https://patch.msgid.link/20260107-move-rust_helper-define-v1-1-4109d58ef275@google.com
rust/helpers/atomic.c
rust/helpers/helpers.c
scripts/atomic/gen-rust-atomic-helpers.sh

index cf06b7ef9a1c559e8d7bdfc2bcd2aeb8951c29d1..4b24eceef5fc76113bcf052aa16299a52831c269 100644 (file)
 
 #include <linux/atomic.h>
 
-// TODO: Remove this after INLINE_HELPERS support is added.
-#ifndef __rust_helper
-#define __rust_helper
-#endif
-
 __rust_helper int
 rust_helper_atomic_read(const atomic_t *v)
 {
@@ -1037,4 +1032,4 @@ rust_helper_atomic64_dec_if_positive(atomic64_t *v)
 }
 
 #endif /* _RUST_ATOMIC_API_H */
-// 615a0e0c98b5973a47fe4fa65e92935051ca00ed
+// e4edb6174dd42a265284958f00a7cea7ddb464b1
index 15d75578f45995faf6a76770ba588d1ddc9b354a..a3c42e51f00a0990bea81ebce6e99bb397ce7533 100644 (file)
@@ -7,6 +7,8 @@
  * Sorted alphabetically.
  */
 
+#define __rust_helper
+
 #include "atomic.c"
 #include "atomic_ext.c"
 #include "auxiliary.c"
index 45b1e100ed7c63108ee6cb07e48a17668f860d47..a3732153af29f415e397e17cab6e75cb5d7efafc 100755 (executable)
@@ -47,11 +47,6 @@ cat << EOF
 
 #include <linux/atomic.h>
 
-// TODO: Remove this after INLINE_HELPERS support is added.
-#ifndef __rust_helper
-#define __rust_helper
-#endif
-
 EOF
 
 grep '^[a-z]' "$1" | while read name meta args; do