On Mon, Nov 09, 2026 at 05:32:49PM +0900, Eliot Courtney wrote:
> Use `SizeConstants` for Alignment that are implemented now.
> 
> Reviewed-by: Alexandre Courbot <[email protected]>
> Reviewed-by: Alice Ryhl <[email protected]>
> Signed-off-by: Eliot Courtney <[email protected]>

Reviewed-by: Yury Norov <[email protected]>

> ---
>  rust/kernel/io.rs | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/rust/kernel/io.rs b/rust/kernel/io.rs
> index a877df11a03e..31c6975376bf 100644
> --- a/rust/kernel/io.rs
> +++ b/rust/kernel/io.rs
> @@ -21,7 +21,8 @@
>      ptr::{
>          Alignment,
>          KnownSize, //
> -    }, //
> +    },
> +    sizes::SizeConstants, //
>  };
>  
>  #[cfg(CONFIG_HAS_IOMEM)]
> @@ -154,7 +155,7 @@ pub fn ptr_try_from_raw_parts_mut(base: *mut u8, size: 
> usize) -> Result<*mut Sel
>  impl<const SIZE: usize> KnownSize for Region<SIZE> {
>      const MIN_SIZE: usize = SIZE;
>      // Alignment of 4 is the most common; different base types can be added 
> once required.
> -    const MIN_ALIGN: Alignment = Alignment::new::<4>();
> +    const MIN_ALIGN: Alignment = Alignment::SZ_4;
>  
>      #[inline(always)]
>      fn size(p: *const Self) -> usize {
> 
> -- 
> 2.56.0
> 

Reply via email to