[PATCH v22 5/5] rust: Add `OwnableIntoShared` and `OwnableTryFromShared`

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Nov 17 14:23:02 UTC 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] rust: separate use blocks instead of single vertical import
  block
--

commit eb9ded53e4184ea08932194e99ba6dc1bce8d3eb
Author: Oliver Mangold <oliver.mangold at pm.me>

rust: Add `OwnableIntoShared` and `OwnableTryFromShared`

This commit introduces the OwnableIntoShared and OwnableTryFromShared
traits to support converting between Owned<T> and ARef<T>.

> diff --git a/rust/kernel/owned.rs b/rust/kernel/owned.rs
> index bfc52bc7f6451..5b71d264477ef 100644
> --- a/rust/kernel/owned.rs
> +++ b/rust/kernel/owned.rs
> @@ -14,6 +14,10 @@
>      pin::Pin,
>      ptr::NonNull, //
>  };
> +use kernel::{
> +    sync::aref::ARef,
> +    types::RefCounted, //
> +};
>  
>  use kernel::types::ForeignOwnable;

[ ... ]

> diff --git a/rust/kernel/sync/aref.rs b/rust/kernel/sync/aref.rs
> index 6bc58aae38ed9..8a029d124fa31 100644
> --- a/rust/kernel/sync/aref.rs
> +++ b/rust/kernel/sync/aref.rs
> @@ -23,6 +23,10 @@
>      ops::Deref,
>      ptr::NonNull, //
>  };
> +use kernel::types::{
> +    OwnableIntoShared,
> +    Owned, //
> +};
>  
>  use crate::{
>      prelude::*,

[Severity: Low]
This isn't a bug, but both files add a separate use block instead of
merging the new imports into the existing kernel/crate vertical import
blocks (grouping ForeignOwnable with RefCounted in owned.rs, and
OwnableIntoShared and Owned under crate::types in aref.rs).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-unique-ref-v22-0-12029383206d@kernel.org?part=5



More information about the Linux-security-module-archive mailing list