[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o71ne6oo.fsf@kernel.org>
Date: Sat, 07 Dec 2024 18:36:39 +0100
From: Andreas Hindborg <a.hindborg@...nel.org>
To: "Guangbo Cui" <2407018371@...com>
Cc: <alex.gaynor@...il.com>, <aliceryhl@...gle.com>,
<anna-maria@...utronix.de>, <benno.lossin@...ton.me>,
<bjorn3_gh@...tonmail.com>, <boqun.feng@...il.com>, <dakr@...nel.org>,
<frederic@...nel.org>, <gary@...yguo.net>,
<linux-kernel@...r.kernel.org>, <lyude@...hat.com>, <ojeda@...nel.org>,
<rust-for-linux@...r.kernel.org>, <tglx@...utronix.de>,
<tmgross@...ch.edu>
Subject: Re: [PATCH v4 02/14] rust: hrtimer: introduce hrtimer support
"Guangbo Cui" <2407018371@...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
Powered by blists - more mailing lists