lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aCh06ESdHK-vDYXy@pollux>
Date: Sat, 17 May 2025 13:37:12 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Lyude Paul <lyude@...hat.com>
Cc: dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	rust-for-linux@...r.kernel.org, David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>,
	Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
	Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>,
	Miguel Ojeda <ojeda@...nel.org>,
	Alex Gaynor <alex.gaynor@...il.com>,
	Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
	Björn Roy Baron <bjorn3_gh@...tonmail.com>,
	Benno Lossin <benno.lossin@...ton.me>,
	Andreas Hindborg <a.hindborg@...nel.org>,
	Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
	Daniel Almeida <daniel.almeida@...labora.com>,
	Asahi Lina <lina@...hilina.net>,
	Alyssa Rosenzweig <alyssa@...enzweig.io>
Subject: Re: [PATCH v2 3/4] rust: drm: gem: Add ObjectFile type alias

On Fri, May 16, 2025 at 01:09:18PM -0400, Lyude Paul wrote:
> Just to reduce the clutter with the File<…> types in gem.rs.
> 
> Signed-off-by: Lyude Paul <lyude@...hat.com>
> ---
>  rust/kernel/drm/gem/mod.rs | 26 ++++++++++++++------------
>  1 file changed, 14 insertions(+), 12 deletions(-)
> 
> diff --git a/rust/kernel/drm/gem/mod.rs b/rust/kernel/drm/gem/mod.rs
> index c17b36948bae3..2b81298d29765 100644
> --- a/rust/kernel/drm/gem/mod.rs
> +++ b/rust/kernel/drm/gem/mod.rs
> @@ -17,6 +17,13 @@
>  /// A type alias for the Object type in use by a [`drm::Driver`].
>  pub type DriverObject<T> = <<T as BaseDriverObject>::Driver as drm::Driver>::Object;
>  
> +/// A type alias for retrieving a [`Driver`]s [`DriverFile`] implementation from its
> +/// [`DriverObject`] implementation.
> +///
> +/// [`Driver`]: drm::Driver
> +/// [`DriverFile`]: drm::file::DriverFile
> +pub type ObjectFile<T> = drm::File<<<T as BaseDriverObject>::Driver as drm::Driver>::File>;

Shouldn't we call this just DriverFile? The fact that you derive the Driver type
from the Object type isn't relevant for the File type, i.e. it's not specific to
the Object, but to the Driver.

Also, why does this need to be pub? Shouldn't it be crate private instead? Or
does it make sense to use this in drivers? If so, please use it in nova-drm for
reference.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ