Re: [PATCH v5 21/38] rust: ptr: add const_align_up() and enable inline_const feature

From: John Hubbard

Date: Sun Feb 22 2026 - 14:03:34 EST


On 2/21/26 12:50 PM, Miguel Ojeda wrote:
On Sat, Feb 21, 2026 at 3:11 AM John Hubbard <jhubbard@xxxxxxxxxx> wrote:

[1] https://lore.kernel.org/rust-for-linux/20260206171253.2704684-2-gary@xxxxxxxxxx/

Link: https://lore.kernel.org/rust-for-linux/20260206171253.2704684-2-gary@xxxxxxxxxx/
[1]

+pub const fn const_align_up<const ALIGN: usize>(value: usize) -> usize {

Ah, I thought you wanted to put this in `drivers/gpu/nova-core/num.rs`
like in the previous version.

Works for me. I was anticipating that people wanted it in rust/ but
I'm perfectly happy to keep it local to nova-core.


If it is here instead, then you shouldn't need the
`rust_allowed_features` change anymore, because we already enable
`inline_const` in the `kernel` crate.

I see.


diff --git a/scripts/Makefile.build b/scripts/Makefile.build

Having said that, if you do end up needing it elsewhere, then please
add the other line added by Gary's patch, i.e.:

+# - Stable since Rust 1.79.0: `feature(inline_const)`.

Thanks!

Cheers,
Miguel

thanks,
--
John Hubbard