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: helpers: Move #define __rust_helper out of atomic.c

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 [1]
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

authored by

Alice Ryhl and committed by
Boqun Feng
abf2111d 5628f051

+3 -11
+1 -6
rust/helpers/atomic.c
··· 11 11 12 12 #include <linux/atomic.h> 13 13 14 - // TODO: Remove this after INLINE_HELPERS support is added. 15 - #ifndef __rust_helper 16 - #define __rust_helper 17 - #endif 18 - 19 14 __rust_helper int 20 15 rust_helper_atomic_read(const atomic_t *v) 21 16 { ··· 1032 1037 } 1033 1038 1034 1039 #endif /* _RUST_ATOMIC_API_H */ 1035 - // 615a0e0c98b5973a47fe4fa65e92935051ca00ed 1040 + // e4edb6174dd42a265284958f00a7cea7ddb464b1
+2
rust/helpers/helpers.c
··· 7 7 * Sorted alphabetically. 8 8 */ 9 9 10 + #define __rust_helper 11 + 10 12 #include "atomic.c" 11 13 #include "atomic_ext.c" 12 14 #include "auxiliary.c"
-5
scripts/atomic/gen-rust-atomic-helpers.sh
··· 47 47 48 48 #include <linux/atomic.h> 49 49 50 - // TODO: Remove this after INLINE_HELPERS support is added. 51 - #ifndef __rust_helper 52 - #define __rust_helper 53 - #endif 54 - 55 50 EOF 56 51 57 52 grep '^[a-z]' "$1" | while read name meta args; do