Hi Miguel, On Mon Sep 8, 2025 at 11:21 PM JST, Miguel Ojeda wrote:> On Mon, Sep 8, 2025 at 3:26?PM Alexandre Courbot <acourbot at nvidia.com> wrote: >> >> + if ALIGN.is_power_of_two() { >> + // INVARIANT: `align` is a power of two. >> + // SAFETY: `align` is a power of two, and thus non-zero. >> + Self(unsafe { NonZero::new_unchecked(ALIGN) }) >> + } else { >> + build_error!("Provided alignment is not a power of two."); >> + } > > Would `build_assert!` at the top work instead?Oops, it certainly would.> >> + /// Returns this alignment as a `usize`. > > Intra-doc link. > >> + // SAFETY: per the invariants, `self.0` is always a power of two so this block will > > "Per". > > I can pick this, with or without the user -- or do you need this in > Nova this cycle?With -rc6 approaching, I don't think we will merge any Nova code taking advantage of this for this cycle, so please feel free to take this patch. We can then merge patch 2 through drm-rust after -rc1 is released. Should I send a new revision with your fixes, or will you apply them?
On Tue, Sep 9, 2025 at 9:05?AM Alexandre Courbot <acourbot at nvidia.com> wrote:> > With -rc6 approaching, I don't think we will merge any Nova code taking > advantage of this for this cycle, so please feel free to take this > patch. We can then merge patch 2 through drm-rust after -rc1 is > released.Sure, sounds good. I can also take patch 2 already as a user of this if you prefer (ideally with an Acked-by).> Should I send a new revision with your fixes, or will you apply them?I can, no worries, thanks! Cheers, Miguel
On Tue Sep 9, 2025 at 4:21 PM JST, Miguel Ojeda wrote:> On Tue, Sep 9, 2025 at 9:05?AM Alexandre Courbot <acourbot at nvidia.com> wrote: >> >> With -rc6 approaching, I don't think we will merge any Nova code taking >> advantage of this for this cycle, so please feel free to take this >> patch. We can then merge patch 2 through drm-rust after -rc1 is >> released. > > Sure, sounds good. I can also take patch 2 already as a user of this > if you prefer (ideally with an Acked-by).Ah right, you will want to introduce a user for this new API. Sure, feel free to take patch 2 as well! Acked-by: Alexandre Courbot <acourbot at nvidia.com>
On Tue Sep 9, 2025 at 9:21 AM CEST, Miguel Ojeda wrote:> On Tue, Sep 9, 2025 at 9:05?AM Alexandre Courbot <acourbot at nvidia.com> wrote: >> >> With -rc6 approaching, I don't think we will merge any Nova code taking >> advantage of this for this cycle, so please feel free to take this >> patch. We can then merge patch 2 through drm-rust after -rc1 is >> released. > > Sure, sounds good. I can also take patch 2 already as a user of this > if you prefer (ideally with an Acked-by).Yeah, this way around make much more sense, Acked-by: Danilo Krummrich <dakr at kernel.org>