X86 platform drivers
 help / color / mirror / Atom feed
From: Gladyshev Ilya <foxido@foxido.dev>
To: Danilo Krummrich <dakr@kernel.org>
Cc: "foxido @ foxido . dev-cc= Rafael J. Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>, "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Tamir Duberstein" <tamird@gmail.com>,
	"Armin Wolf" <W_Armin@gmx.de>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-acpi@vger.kernel.org
Subject: Re: [RFC PATCH 1/3] rust: implement wrapper for acpi_object
Date: Tue, 23 Dec 2025 00:47:17 +0300	[thread overview]
Message-ID: <4266e3d2-141e-44bd-a4c1-b140674542e3@foxido.dev> (raw)
In-Reply-To: <DF4PPPGQBPNA.13TJNSRSRUW0A@kernel.org>

On 12/22/25 14:35, Danilo Krummrich wrote:
>> +acpi_object_subtype!(AcpiInteger
>> +    <- (ACPI_TYPE_INTEGER, integer, bindings::acpi_object__bindgen_ty_1));
>> +acpi_object_subtype!(AcpiString
>> +    <- (ACPI_TYPE_STRING, string, bindings::acpi_object__bindgen_ty_2));
>> +acpi_object_subtype!(AcpiBuffer
>> +    <- (ACPI_TYPE_BUFFER, buffer, bindings::acpi_object__bindgen_ty_3));
>> +acpi_object_subtype!(AcpiPackage
>> +    <- (ACPI_TYPE_PACKAGE, package, bindings::acpi_object__bindgen_ty_4));
>> +acpi_object_subtype!(AcpiReference
>> +    <- (ACPI_TYPE_LOCAL_REFERENCE, reference, bindings::acpi_object__bindgen_ty_5));
>> +acpi_object_subtype!(AcpiProcessor
>> +    <- (ACPI_TYPE_PROCESSOR, processor, bindings::acpi_object__bindgen_ty_6));
>> +acpi_object_subtype!(AcpiPowerResource
>> +    <- (ACPI_TYPE_POWER, power_resource, bindings::acpi_object__bindgen_ty_7));
>> +
>> +impl AcpiBuffer {
>> +    /// Get Buffer's content
>> +    pub fn payload(&self) -> &[u8] {
>> +        // SAFETY: (pointer, length) indeed represents byte slice
>> +        unsafe { ::core::slice::from_raw_parts(self.0.pointer, self.0.length as usize) }
>> +    }
>> +}
> 
> What about the values of the other types? How are they accessed?

I couldn't really decide between implementing all types or only the one 
needed... Probably, I should provide simple implementations for all the 
others, I will fix that.

> Also, I think it would be better to use a Deref impl rather than a method.

Wouldn't it be confusing to overload Deref on a non "pointer-like" type 
just for an implicit cast?

Overall, thank you for your patience and review. I will fix the other 
comments from both of your emails.

  reply	other threads:[~2025-12-22 21:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-21 18:22 [RFC PATCH 0/3] rust: WMI abstractions Gladyshev Ilya
2025-12-21 18:22 ` [RFC PATCH 1/3] rust: implement wrapper for acpi_object Gladyshev Ilya
2025-12-22 11:35   ` Danilo Krummrich
2025-12-22 21:47     ` Gladyshev Ilya [this message]
2025-12-22 22:44       ` Danilo Krummrich
2025-12-23 15:02         ` Gladyshev Ilya
2025-12-22 19:32   ` Rafael J. Wysocki
2025-12-23 16:36     ` Gladyshev Ilya
2025-12-21 18:22 ` [RFC PATCH 2/3] rust: introduce WMI abstractions Gladyshev Ilya
2025-12-22 11:50   ` Danilo Krummrich
2025-12-25 18:06   ` Armin Wolf
2025-12-25 20:37     ` Gladyshev Ilya
2025-12-28 21:02       ` Armin Wolf
2025-12-21 18:22 ` [RFC PATCH 3/3] rust: sample driver for WMI demonstrations Gladyshev Ilya
2025-12-22 11:52 ` [RFC PATCH 0/3] rust: WMI abstractions Danilo Krummrich
2025-12-22 21:30   ` Gladyshev Ilya
2025-12-25 17:56     ` Armin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4266e3d2-141e-44bd-a4c1-b140674542e3@foxido.dev \
    --to=foxido@foxido.dev \
    --cc=W_Armin@gmx.de \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@gmail.com \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox