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: <622213c0-1793-4b1f-ba9a-aa99f73047f6@foxido.dev>
Date: Fri, 9 Jan 2026 14:12:10 +0300
From: Gladyshev Ilya <foxido@...ido.dev>
To: Kari Argillander <kari.argillander@...il.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
 Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
 Gary Guo <gary@...yguo.net>, Benno Lossin <lossin@...nel.org>,
 Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
 Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>,
 Tamir Duberstein <tamird@...il.com>, Armin Wolf <W_Armin@....de>,
 platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
 rust-for-linux@...r.kernel.org, linux-acpi@...r.kernel.org, foxido@...ido.dev
Subject: Re: [PATCH 3/3] rust: add WMI abstractions

On 1/8/26 22:48, Kari Argillander wrote:
> On Wed, 7 Jan 2026 at 22:56, Gladyshev Ilya <foxido@...ido.dev> wrote:
[snip]
>> +    /// WMI device notify.
>> +    ///
>> +    /// Called when new WMI event received from bounded device.
>> +    fn notify(self: Pin<&Self>, _dev: &Device<device::Core>, _event: Option<&AcpiObject>) {
> 
> This should be device::Bound
> 
> Also probably _ marks are not needed. I think compiler does give
> unused build warnings.
> 
> I do not know reason but usually other drivers use this over self. And
> device first so this
> would be:
> 
>      fn notify(dev: &Device<device::Bound>, this: Pin<&Self>, event:
> Option<&AcpiObject>) {
> 
> Same also in unbind. But like I said I'm not completely sure about this.

I thought the reason for using this instead of self was because of the 
limited set of possible self types in previous versions of Rust...

IMO using Rust's self is more readable

>> +        build_error!(VTABLE_DEFAULT_ERROR);
>> +    }
>> +
>> +    /// WMI driver remove.
>> +    fn unbind(self: Pin<&Self>, _dev: &Device<device::Core>) {
>> +        build_error!(VTABLE_DEFAULT_ERROR);
>> +    }
> 
> unbind should not be mandatory so here just do
It's not mandatory, that why there is default implementation. See 
https://rust.docs.kernel.org/macros/attr.vtable.html


For other comments: Ack, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ