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: <aeb45ff9-73a7-427b-8cca-cc9646b65b9b@kernel.org>
Date: Tue, 1 Jul 2025 19:14:37 +0200
From: Danilo Krummrich <dakr@...nel.org>
To: Michal Wilczynski <m.wilczynski@...sung.com>
Cc: Uwe Kleine-König <ukleinek@...nel.org>,
 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>,
 Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
 Trevor Gross <tmgross@...ch.edu>, Guo Ren <guoren@...nel.org>,
 Fu Wei <wefu@...hat.com>, Rob Herring <robh@...nel.org>,
 Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
 <conor+dt@...nel.org>, Paul Walmsley <paul.walmsley@...ive.com>,
 Palmer Dabbelt <palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
 Alexandre Ghiti <alex@...ti.fr>, Marek Szyprowski
 <m.szyprowski@...sung.com>, Benno Lossin <lossin@...nel.org>,
 Michael Turquette <mturquette@...libre.com>, Stephen Boyd
 <sboyd@...nel.org>, Drew Fustini <fustini@...nel.org>,
 linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org,
 rust-for-linux@...r.kernel.org, linux-riscv@...ts.infradead.org,
 devicetree@...r.kernel.org, linux-clk@...r.kernel.org
Subject: Re: [PATCH v6 3/8] rust: pwm: Add core 'Device' and 'Chip' object
 wrappers

On 7/1/25 6:01 PM, Michal Wilczynski wrote:
> +    /// Returns a reference to the parent device of this PWM chip's device.
> +    pub fn parent_device(&self) -> Option<&device::Device> {
> +        self.device().parent()
> +    }

I know what you use this for, i.e. to provide a &Device<Bound> reference in your
class device callbacks -- that's great!

But please don't expose this to the public. I think what you want instead is a
private unsafe method that returns you the &Device<Bound> directly, since you
also know that you set a valid parent device, hence no need to mess with the
Option as well.

And again, sorry for not catching it right away.

- Danilo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ