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: <D88DIE85YT01.11H51NPNE3HP6@proton.me>
Date: Wed, 05 Mar 2025 13:40:19 +0000
From: Benno Lossin <benno.lossin@...ton.me>
To: Andreas Hindborg <a.hindborg@...nel.org>
Cc: 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>, Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>, Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>, Waiman Long <longman@...hat.com>, linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org, linux-block@...r.kernel.org
Subject: Re: [PATCH 15/22] rust: make pin-init its own crate

On Wed Mar 5, 2025 at 1:12 PM CET, Andreas Hindborg wrote:
> "Benno Lossin" <benno.lossin@...ton.me> writes:
>
>> Rename relative paths inside of the crate to still refer to the same
>> items, also rename paths inside of the kernel crate and adjust the build
>> system to build the crate.
>>
>> Signed-off-by: Benno Lossin <benno.lossin@...ton.me>
>> ---
>
> [...]
>
>> diff --git a/rust/macros/lib.rs b/rust/macros/lib.rs
>> index 7ff82c82ce0c..8e116e266524 100644
>> --- a/rust/macros/lib.rs
>> +++ b/rust/macros/lib.rs
>> @@ -2,23 +2,20 @@
>>
>>  //! Crate for all kernel procedural macros.
>>
>> +#![feature(lint_reasons)]
>
> Commit message should probably say something about this.

Done.

>> +
>>  // When fixdep scans this, it will find this string `CONFIG_RUSTC_VERSION_TEXT`
>>  // and thus add a dependency on `include/config/RUSTC_VERSION_TEXT`, which is
>>  // touched by Kconfig when the version string from the compiler changes.
>>
>>  #[macro_use]
>> +#[expect(unused_macros)]
>>  mod quote;
>>  mod concat_idents;
>>  mod helpers;
>>  mod module;
>>  mod paste;
>> -#[path = "../pin-init/internal/src/pin_data.rs"]
>> -mod pin_data;
>> -#[path = "../pin-init/internal/src/pinned_drop.rs"]
>> -mod pinned_drop;
>>  mod vtable;
>> -#[path = "../pin-init/internal/src/zeroable.rs"]
>> -mod zeroable;
>>
>>  use proc_macro::TokenStream;
>>
>> @@ -374,5 +371,3 @@ pub fn paste(input: TokenStream) -> TokenStream {
>>      paste::expand(&mut tokens);
>>      tokens.into_iter().collect()
>>  }
>> -
>> -include!("../pin-init/internal/src/lib.rs");
>> diff --git a/rust/macros/module.rs b/rust/macros/module.rs
>> index cdf94f4982df..bdd94c79b0d4 100644
>> --- a/rust/macros/module.rs
>> +++ b/rust/macros/module.rs
>> @@ -236,7 +236,7 @@ impl kernel::ModuleMetadata for {type_} {{
>>              mod __module_init {{
>>                  mod __module_init {{
>>                      use super::super::{type_};
>> -                    use kernel::init::PinInit;
>> +                    use pin_init::PinInit;
>>
>>                      /// The \"Rust loadable module\" mark.
>>                      //
>> diff --git a/rust/macros/quote.rs b/rust/macros/quote.rs
>> index 33a199e4f176..11d241b85ac3 100644
>> --- a/rust/macros/quote.rs
>> +++ b/rust/macros/quote.rs
>> @@ -2,6 +2,7 @@
>>
>>  use proc_macro::{TokenStream, TokenTree};
>>
>> +#[allow(dead_code)]
>
> #[expect(dead_code)] ?

`expect` can't be used here, since `quote.rs` is imported in
`pin-init/internal/src/lib.rs` and used in that crate. But it is unused
in the `macros` crate, hence we need to allow it.

---
Cheers,
Benno


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ