[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DA2YXRX9SZ2X.1IKN8JA0UXL1Z@kernel.org>
Date: Thu, 22 May 2025 22:23:38 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Remo Senekowitsch" <remo@...nzli.dev>, "Rob Herring" <robh@...nel.org>,
"Saravana Kannan" <saravanak@...gle.com>, "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>,
"Danilo Krummrich" <dakr@...nel.org>, "Greg Kroah-Hartman"
<gregkh@...uxfoundation.org>, "Rafael J. Wysocki" <rafael@...nel.org>,
"Dirk Behme" <dirk.behme@...bosch.com>
Cc: <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
<rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH v5 6/9] rust: device: Implement accessors for firmware
properties
On Tue May 20, 2025 at 10:00 PM CEST, Remo Senekowitsch wrote:
> Add methods to FwNode for reading several firmware property types like
> strings, integers and arrays.
>
> Most types are read with the generic `property_read` method. There are
> two exceptions:
>
> * `property_read_bool` cannot fail, so the fallible function signature
> of `property_read` would not make sense for reading booleans.
>
> * `property_read_array_vec` can fail because of a dynamic memory
> allocation. This error must be handled separately, leading to a
> different function signature than `property_read`.
>
> The traits `Property` and `PropertyInt` drive the generic behavior
> of `property_read`. `PropertyInt` is necessary to associate
> specific integer types with the C functions to read them. While
> there is a C function to read integers of generic sizes called
> `fwnode_property_read_int_array`, it was preferred not to make this
> public.
>
> Co-developed-by: Rob Herring (Arm) <robh@...nel.org>
> Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> Signed-off-by: Remo Senekowitsch <remo@...nzli.dev>
> ---
> rust/kernel/device/property.rs | 253 ++++++++++++++++++++++++++++++++-
> 1 file changed, 251 insertions(+), 2 deletions(-)
I already like this design much better than your previous version.
I probably won't have the time to review the other patches, but one
thing that I notice was the lack of lists in `SAFETY` comments. If there
are multiple justification in a single `SAFETY` comment, we us a bullet
markdown list. (same for requirements in a `# Safety` section)
---
Cheers,
Benno
Powered by blists - more mailing lists