public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Probst <markus.probst@posteo.de>
To: Danilo Krummrich <dakr@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	"Len Brown" <lenb@kernel.org>, "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "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>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Robert Moore" <robert.moore@intel.com>,
	linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
	rust-for-linux@vger.kernel.org, driver-core@lists.linux.dev,
	acpica-devel@lists.linux.dev
Subject: Re: [PATCH v3] rust: ACPI: fix missing match data for PRP0001
Date: Wed, 08 Apr 2026 21:42:20 +0000	[thread overview]
Message-ID: <e6985ffe6d35e27b85b540e410cf92592d597a69.camel@posteo.de> (raw)
In-Reply-To: <DHO1GI8ZAR1L.3DUWFSM1VT8BS@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2348 bytes --]

On Wed, 2026-04-08 at 21:59 +0200, Danilo Krummrich wrote:
> On Wed Apr 8, 2026 at 9:40 PM CEST, Markus Probst wrote:
> > On Wed, 2026-04-08 at 18:03 +0200, Danilo Krummrich wrote:
> > > On Tue Apr 7, 2026 at 11:41 PM CEST, Markus Probst wrote:
> > > > diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> > > > index aad1a95e6863..d0098f24346f 100644
> > > > --- a/include/acpi/acpi_bus.h
> > > > +++ b/include/acpi/acpi_bus.h
> > > > @@ -187,6 +187,10 @@ struct acpi_driver {
> > > >   * -----------
> > > >   */
> > > >  
> > > > +bool acpi_of_match_device(const struct acpi_device *adev,
> > > > +			  const struct of_device_id *of_match_table,
> > > > +			  const struct of_device_id **of_id);
> > > 
> > > This also has to be defined for !CONFIG_ACPI, otherwise we run into the
> > > following compatible error.
> > > 
> > > 	error[E0425]: cannot find function `acpi_of_match_device` in crate `bindings`
> > > 	      --> rust/kernel/driver.rs:295:24
> > > 	       |
> > > 	   295 |       unsafe { bindings::acpi_of_match_device(adev, of_match_table, of_id) }
> > > 	       |                          ^^^^^^^^^^^^^^^^^^^^
> > > 	       |
> > > 	      ::: /mnt/nvme/work/projects/linux/driver-core/driver-core-testing/rust/bindings/bindings_generated.rs:118713:5
> > > 
> > > There is an
> > > 
> > > 	#else	/* CONFIG_ACPI */
> > > 
> > > block at the end of acpi_bus.h for this.
> > I don't think the function exists in that case and bindgen can't
> > generate inline functions, so I will just add a `#[cfg(CONFIG_ACPI)]`
> > condition on top of the function.
> 
> Usually we provide a stub instead of conditionalize the callers; this case might
> be a bit special, but I'd still follow the usual pattern.
The usual C pattern would be

static inline bool acpi_of_match_device(const struct acpi_device *adev,
			const struct of_device_id *of_match_table,
			const struct of_device_id **of_id);

, which is ignored by bindgen (i. e. same error).


Defining

bool acpi_of_match_device(const struct acpi_device *adev,
			const struct of_device_id *of_match_table,
			const struct of_device_id **of_id);

while the symbol is missing doesn't make much sense, as we are
basically lying to bindgen.

Thanks
- Markus Probst

> 
> That said, I'm fine with both -- Rafaels call.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 870 bytes --]

  reply	other threads:[~2026-04-08 21:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 21:41 [PATCH v3] rust: ACPI: fix missing match data for PRP0001 Markus Probst
2026-04-08  9:58 ` Rafael J. Wysocki
2026-04-08 16:03 ` Danilo Krummrich
2026-04-08 19:40   ` Markus Probst
2026-04-08 19:59     ` Danilo Krummrich
2026-04-08 21:42       ` Markus Probst [this message]
2026-04-08 22:07         ` Danilo Krummrich
2026-04-10 14:57           ` Markus Probst
2026-04-10 15:53             ` Gary Guo

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=e6985ffe6d35e27b85b540e410cf92592d597a69.camel@posteo.de \
    --to=markus.probst@posteo.de \
    --cc=a.hindborg@kernel.org \
    --cc=acpica-devel@lists.linux.dev \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --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=rafael@kernel.org \
    --cc=robert.moore@intel.com \
    --cc=rust-for-linux@vger.kernel.org \
    --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