From: Ingo Molnar <mingo@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
"H . Peter Anvin" <hpa@zytor.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Alex Gaynor <alex.gaynor@gmail.com>,
Andreas Hindborg <a.hindborg@kernel.org>,
Anna-Maria Behnsen <anna-maria@linutronix.de>,
Boqun Feng <boqun.feng@gmail.com>, Lyude Paul <lyude@redhat.com>,
Miguel Ojeda <ojeda@kernel.org>
Subject: [PATCH 01/17] rust: Rename timer_container_of() to hrtimer_container_of()
Date: Mon, 14 Apr 2025 12:22:35 +0200 [thread overview]
Message-ID: <20250414102301.332225-2-mingo@kernel.org> (raw)
In-Reply-To: <20250414102301.332225-1-mingo@kernel.org>
This primitive is dealing with 'struct hrtimer' objects, not
'struct timer_list' objects - so clarify the name.
We want to introduce the timer_container_of() symbol in the kernel
for timer_list, make sure there's no clash of namespaces, at least
on the conceptual plane.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Alex Gaynor <alex.gaynor@gmail.com>
Cc: Andreas Hindborg <a.hindborg@kernel.org>
Cc: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
rust/kernel/time/hrtimer.rs | 4 ++--
rust/kernel/time/hrtimer/arc.rs | 2 +-
rust/kernel/time/hrtimer/pin.rs | 2 +-
rust/kernel/time/hrtimer/pin_mut.rs | 2 +-
rust/kernel/time/hrtimer/tbox.rs | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/rust/kernel/time/hrtimer.rs b/rust/kernel/time/hrtimer.rs
index ce53f8579d18..f3fb7a0caf2f 100644
--- a/rust/kernel/time/hrtimer.rs
+++ b/rust/kernel/time/hrtimer.rs
@@ -338,7 +338,7 @@ pub unsafe trait HasHrTimer<T> {
/// # Safety
///
/// `ptr` must point to a [`HrTimer<T>`] field in a struct of type `Self`.
- unsafe fn timer_container_of(ptr: *mut HrTimer<T>) -> *mut Self
+ unsafe fn hrtimer_container_of(ptr: *mut HrTimer<T>) -> *mut Self
where
Self: Sized;
@@ -498,7 +498,7 @@ unsafe fn raw_get_timer(
}
#[inline]
- unsafe fn timer_container_of(
+ unsafe fn hrtimer_container_of(
ptr: *mut $crate::time::hrtimer::HrTimer<$timer_type>,
) -> *mut Self {
// SAFETY: As per the safety requirement of this function, `ptr`
diff --git a/rust/kernel/time/hrtimer/arc.rs b/rust/kernel/time/hrtimer/arc.rs
index 4a984d85b4a1..5cfe6c27795f 100644
--- a/rust/kernel/time/hrtimer/arc.rs
+++ b/rust/kernel/time/hrtimer/arc.rs
@@ -80,7 +80,7 @@ impl<T> RawHrTimerCallback for Arc<T>
// SAFETY: By C API contract `ptr` is the pointer we passed when
// queuing the timer, so it is a `HrTimer<T>` embedded in a `T`.
- let data_ptr = unsafe { T::timer_container_of(timer_ptr) };
+ let data_ptr = unsafe { T::hrtimer_container_of(timer_ptr) };
// SAFETY:
// - `data_ptr` is derived form the pointer to the `T` that was used to
diff --git a/rust/kernel/time/hrtimer/pin.rs b/rust/kernel/time/hrtimer/pin.rs
index f760db265c7b..d16a676b0639 100644
--- a/rust/kernel/time/hrtimer/pin.rs
+++ b/rust/kernel/time/hrtimer/pin.rs
@@ -83,7 +83,7 @@ impl<'a, T> RawHrTimerCallback for Pin<&'a T>
// SAFETY: By the safety requirement of this function, `timer_ptr`
// points to a `HrTimer<T>` contained in an `T`.
- let receiver_ptr = unsafe { T::timer_container_of(timer_ptr) };
+ let receiver_ptr = unsafe { T::hrtimer_container_of(timer_ptr) };
// SAFETY:
// - By the safety requirement of this function, `timer_ptr`
diff --git a/rust/kernel/time/hrtimer/pin_mut.rs b/rust/kernel/time/hrtimer/pin_mut.rs
index 90c0351d62e4..17c68f8fbb37 100644
--- a/rust/kernel/time/hrtimer/pin_mut.rs
+++ b/rust/kernel/time/hrtimer/pin_mut.rs
@@ -87,7 +87,7 @@ impl<'a, T> RawHrTimerCallback for Pin<&'a mut T>
// SAFETY: By the safety requirement of this function, `timer_ptr`
// points to a `HrTimer<T>` contained in an `T`.
- let receiver_ptr = unsafe { T::timer_container_of(timer_ptr) };
+ let receiver_ptr = unsafe { T::hrtimer_container_of(timer_ptr) };
// SAFETY:
// - By the safety requirement of this function, `timer_ptr`
diff --git a/rust/kernel/time/hrtimer/tbox.rs b/rust/kernel/time/hrtimer/tbox.rs
index 2071cae07234..9dace895ce58 100644
--- a/rust/kernel/time/hrtimer/tbox.rs
+++ b/rust/kernel/time/hrtimer/tbox.rs
@@ -103,7 +103,7 @@ impl<T, A> RawHrTimerCallback for Pin<Box<T, A>>
// SAFETY: By C API contract `ptr` is the pointer we passed when
// queuing the timer, so it is a `HrTimer<T>` embedded in a `T`.
- let data_ptr = unsafe { T::timer_container_of(timer_ptr) };
+ let data_ptr = unsafe { T::hrtimer_container_of(timer_ptr) };
// SAFETY:
// - As per the safety requirements of the trait `HrTimerHandle`, the
--
2.45.2
next prev parent reply other threads:[~2025-04-14 10:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 10:22 [PATCH 00/17] timers: Complete the timer_*() API renames Ingo Molnar
2025-04-14 10:22 ` Ingo Molnar [this message]
2025-04-14 10:22 ` [PATCH 02/17] scsi: bfa: Rename 'timer_mod' to 'timer_module' Ingo Molnar
2025-04-14 10:59 ` Thomas Weißschuh
2025-04-14 11:21 ` [PATCH -v2 " Ingo Molnar
2025-04-14 16:57 ` [PATCH " Linus Torvalds
2025-04-16 5:28 ` Ingo Molnar
2025-04-16 5:37 ` Ingo Molnar
2025-04-14 18:02 ` Thomas Gleixner
2025-04-16 5:32 ` Ingo Molnar
2025-04-16 5:39 ` Ingo Molnar
2025-04-15 17:50 ` David Laight
2025-04-14 10:22 ` [PATCH 03/17] treewide, timers: Rename add_timer_global() => timer_add_global() Ingo Molnar
2025-04-14 10:22 ` [PATCH 04/17] treewide, timers: Rename add_timer_local() => timer_add_local() Ingo Molnar
2025-04-14 10:22 ` [PATCH 05/17] treewide, timers: Rename from_timer() => timer_container_of() Ingo Molnar
2025-04-14 10:22 ` [PATCH 06/17] treewide, timers: Rename mod_timer_pending() => timer_mod_pending() Ingo Molnar
2025-04-14 10:22 ` [PATCH 07/17] treewide, timers: Rename try_to_del_timer_sync() => timer_delete_sync_try() Ingo Molnar
2025-04-14 10:22 ` [PATCH 08/17] treewide, timers: Rename add_timer() => timer_add() Ingo Molnar
2025-04-14 10:22 ` [PATCH 09/17] treewide, timers: Rename add_timer_on() => timer_add_on() Ingo Molnar
2025-04-14 10:22 ` [PATCH 10/17] treewide, timers: Rename mod_timer() => timer_mod() Ingo Molnar
2025-04-14 10:22 ` [PATCH 11/17] treewide, timers: Rename destroy_timer_on_stack() => timer_destroy_on_stack() Ingo Molnar
2025-04-14 10:22 ` [PATCH 12/17] treewide, timers: Rename init_timer_key() => timer_init_key() Ingo Molnar
2025-04-14 10:22 ` [PATCH 13/17] treewide, timers: Rename init_timer_on_stack_key() => timer_init_on_stack_key() Ingo Molnar
2025-04-14 10:22 ` [PATCH 14/17] treewide, timers: Rename __init_timer() => __timer_init() Ingo Molnar
2025-04-14 10:22 ` [PATCH 15/17] treewide, timers: Rename __init_timer_on_stack() => __timer_init_on_stack() Ingo Molnar
2025-04-14 10:22 ` [PATCH 16/17] treewide, timers: Rename NEXT_TIMER_MAX_DELTA => TIMER_NEXT_MAX_DELTA Ingo Molnar
2025-04-14 10:22 ` [PATCH 17/17] treewide, timers: Rename init_timers() => timers_init() Ingo Molnar
2025-04-14 10:35 ` [PATCH 00/17] timers: Complete the timer_*() API renames Ingo Molnar
2025-04-14 18:34 ` Thomas Gleixner
2025-04-16 9:04 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250414102301.332225-2-mingo@kernel.org \
--to=mingo@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=anna-maria@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox