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: <Z8dRKDHI7loVA78O@kernel.org>
Date: Tue, 4 Mar 2025 21:14:48 +0200
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Danilo Krummrich <dakr@...nel.org>
Cc: airlied@...il.com, simona@...ll.ch, corbet@....net,
	maarten.lankhorst@...ux.intel.com, mripard@...nel.org,
	tzimmermann@...e.de, ajanulgu@...hat.com, lyude@...hat.com,
	pstanner@...hat.com, zhiw@...dia.com, cjia@...dia.com,
	jhubbard@...dia.com, bskeggs@...dia.com, acurrid@...dia.com,
	ojeda@...nel.org, alex.gaynor@...il.com, boqun.feng@...il.com,
	gary@...yguo.net, bjorn3_gh@...tonmail.com, benno.lossin@...ton.me,
	a.hindborg@...nel.org, aliceryhl@...gle.com, tmgross@...ch.edu,
	gregkh@...uxfoundation.org, mcgrof@...nel.org,
	russ.weight@...ux.dev, dri-devel@...ts.freedesktop.org,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
	nouveau@...ts.freedesktop.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v5 1/5] rust: module: add type `LocalModule`

On Tue, Mar 04, 2025 at 06:34:48PM +0100, Danilo Krummrich wrote:
> The `LocalModule` type is the type of the module created by `module!`,
> `module_pci_driver!`, `module_platform_driver!`, etc.
> 
> Since the exact type of the module is sometimes generated on the fly by
> the listed macros, provide an alias.
> 
> This is first used by the `module_firmware!` macro introduced in a
> subsequent patch.

So generally speaking for any patches, they are not patches once they
land to the Git and theoretically you cannot presume any order.

So cut out hairs the last sentence should be just:

"The first use for this will be module_firmware!"


> 
> Suggested-by: Alice Ryhl <aliceryhl@...gle.com>
> Signed-off-by: Danilo Krummrich <dakr@...nel.org>
> ---

You can speak about subsequent patches here but not in the commit
message.

>  rust/macros/module.rs | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/rust/macros/module.rs b/rust/macros/module.rs
> index cdf94f4982df..6ba9210677c5 100644
> --- a/rust/macros/module.rs
> +++ b/rust/macros/module.rs
> @@ -228,6 +228,8 @@ pub(crate) fn module(ts: TokenStream) -> TokenStream {
>                  kernel::ThisModule::from_ptr(core::ptr::null_mut())
>              }};
>  
> +            type LocalModule = {type_};
> +

nit:

I'd document this as:

// The `LocalModule` type is the type of the module created by `module!`,
// `module_pci_driver!`, `module_platform_driver!`, etc.

;-)


>              impl kernel::ModuleMetadata for {type_} {{
>                  const NAME: &'static kernel::str::CStr = kernel::c_str!(\"{name}\");
>              }}
> -- 
> 2.48.1
> 
> 

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ