From: Andreas Hindborg <a.hindborg@kernel.org>
To: "Guangbo Cui" <2407018371@qq.com>
Cc: <alex.gaynor@gmail.com>, <aliceryhl@google.com>,
<anna-maria@linutronix.de>, <benno.lossin@proton.me>,
<bjorn3_gh@protonmail.com>, <boqun.feng@gmail.com>,
<dakr@kernel.org>, <frederic@kernel.org>, <gary@garyguo.net>,
<linux-kernel@vger.kernel.org>, <lyude@redhat.com>,
<ojeda@kernel.org>, <rust-for-linux@vger.kernel.org>,
<tglx@linutronix.de>, <tmgross@umich.edu>
Subject: Re: [PATCH v4 02/14] rust: hrtimer: introduce hrtimer support
Date: Sat, 07 Dec 2024 18:36:39 +0100 [thread overview]
Message-ID: <87o71ne6oo.fsf@kernel.org> (raw)
In-Reply-To: <tencent_4237DDAC9DC29A9774F0F24D438C0ED31C05@qq.com> (Guangbo Cui's message of "Sat, 07 Dec 2024 22:35:54 +0800")
"Guangbo Cui" <2407018371@qq.com> writes:
>> +#[macro_export]
>> +macro_rules! impl_has_timer {
>> + (
>> + impl$({$($generics:tt)*})?
>> + HasTimer<$timer_type:ty>
>> + for $self:ty
>> + { self.$field:ident }
>> + $($rest:tt)*
>> + ) => {
>> + // SAFETY: This implementation of `raw_get_timer` only compiles if the
>> + // field has the right type.
>> + unsafe impl$(<$($generics)*>)? $crate::time::hrtimer::HasTimer<$timer_type> for $self {
>> + const OFFSET: usize = ::core::mem::offset_of!(Self, $field) as usize;
>> +
>> + #[inline]
>> + unsafe fn raw_get_timer(ptr: *const Self) ->
>> + *const $crate::::time::hrtimer::Timer<$timer_type>
>
> Hi Andreas, an extra `::` here.
One of these days I hope to have refined my workflow to a degree that
would prevent things like this. I thought I was there, but not yet it
seems. Thanks for spotting.
I _did_ actually fix this, but the fix was hiding in a commit with test
code that did not make it in to the series 🤦 And when ran my script to
make sure all the commits build, this macro was no longer invoked and
the typo was hiding.
For reference, I am holding the examples back until we get either a
spinlock/condvar combo that can work in irq disabled context, or atomics
that work with LKMM.
Best regards,
Andreas Hindborg
next prev parent reply other threads:[~2024-12-07 17:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-06 19:32 [PATCH v4 00/14] hrtimer Rust API Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 01/14] rust: time: Add Ktime::from_ns() Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 02/14] rust: hrtimer: introduce hrtimer support Andreas Hindborg
2024-12-07 14:35 ` Guangbo Cui
2024-12-07 17:36 ` Andreas Hindborg [this message]
2024-12-06 19:32 ` [PATCH v4 03/14] rust: sync: add `Arc::as_ptr` Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 04/14] rust: hrtimer: implement `TimerPointer` for `Arc` Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 05/14] rust: hrtimer: allow timer restart from timer handler Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 06/14] rust: hrtimer: add `UnsafeTimerPointer` Andreas Hindborg
2024-12-06 19:32 ` [PATCH v4 07/14] rust: hrtimer: implement `UnsafeTimerPointer` for `Pin<&T>` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 08/14] rust: hrtimer: implement `UnsafeTimerPointer` for `Pin<&mut T>` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 09/14] rust: hrtimer: add `hrtimer::ScopedTimerPointer` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 10/14] rust: alloc: add `Box::into_pin` Andreas Hindborg
2024-12-06 20:17 ` Danilo Krummrich
2024-12-06 21:25 ` Andreas Hindborg
2024-12-09 10:25 ` Danilo Krummrich
2024-12-06 19:33 ` [PATCH v4 11/14] rust: hrtimer: implement `TimerPointer` for `Pin<Box<T>>` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 12/14] rust: hrtimer: add `TimerMode` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 13/14] rust: hrtimer: add clocksource selection through `ClockSource` Andreas Hindborg
2024-12-06 19:33 ` [PATCH v4 14/14] rust: hrtimer: add maintainer entry Andreas Hindborg
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=87o71ne6oo.fsf@kernel.org \
--to=a.hindborg@kernel.org \
--cc=2407018371@qq.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=anna-maria@linutronix.de \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=frederic@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tmgross@umich.edu \
/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