Re: [PATCH v9 16/31] rust: ptr: add const_align_up()

John Hubbard
2026-03-31T02:36:26Z

On 3/30/26 7:21 PM, Alexandre Courbot wrote:
> On Thu Mar 26, 2026 at 10:38 AM JST, John Hubbard wrote:
...
>> +/// Aligns `value` up to `align`.
>> +///
>> +/// This is the const-compatible equivalent of [`Alignable::align_up`].
>> +///
>> +/// Returns [`None`] on overflow.
>> +///
>> +/// # Examples
>> +///
>> +/// ```
>> +/// use kernel::ptr::{const_align_up, Alignment};
>
> IIUC we use the one-import-per-line style (minus the unneeded `//`) in
> examples as well (I suppose this can be fixed when applying).
>

Actually no, it's the opposite! Rust for Linux code overwhelmingly
(I counted ~200 cases) prefers the "put it all in one line" style,
in examples.

In fact, I did both grep and AI-powered searches, and failed to find
even a single example of the one-import-per-line style in doc comment
examples.

> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>

Thanks for the review!

thanks,
--
John Hubbard