[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250620210533.400889-3-andrewjballance@gmail.com>
Date: Fri, 20 Jun 2025 16:05:31 -0500
From: Andrew Ballance <andrewjballance@...il.com>
To: jbaron@...mai.com,
jim.cromie@...il.com,
daniel.almeida@...labora.com,
acourbot@...dia.com,
ojeda@...nel.org,
alex.gaynor@...il.com,
boqun.feng@...il.com,
gary@...yguo.net,
bjorn3_gh@...tonmail.com,
lossin@...nel.org,
a.hindborg@...nel.org,
aliceryhl@...gle.com,
tmgross@...ch.edu,
dakr@...nel.org,
gregkh@...uxfoundation.org,
rafael@...nel.org,
rostedt@...dmis.org,
andrewjballance@...il.com
Cc: viresh.kumar@...aro.org,
lina+kernel@...hilina.net,
tamird@...il.com,
jubalh@...oru.org,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH v2 2/4] rust: jump label: add STATIC_KEY_INIT_FALSE
adds a const STATIC_KEY_INIT_FALSE which should be used to init
a static_key_false.
Signed-off-by: Andrew Ballance <andrewjballance@...il.com>
---
rust/kernel/jump_label.rs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/rust/kernel/jump_label.rs b/rust/kernel/jump_label.rs
index 002cc3bd73da..e30db2d06c76 100644
--- a/rust/kernel/jump_label.rs
+++ b/rust/kernel/jump_label.rs
@@ -72,3 +72,8 @@ macro_rules! arch_static_branch {
pub const fn bool_to_int(b: bool) -> i32 {
b as i32
}
+
+/// Default value for a `static_key_false`.
+// SAFETY: a unlikely static key is always zeroed
+#[allow(dead_code)]
+pub(crate) const STATIC_KEY_INIT_FALSE: bindings::static_key_false = unsafe { core::mem::zeroed() };
--
2.49.0
Powered by blists - more mailing lists