public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Danilo Krummrich" <dakr@kernel.org>
To: "Cole Leavitt" <cole@unwrap.rs>
Cc: "Alice Ryhl" <aliceryhl@google.com>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	<rust-for-linux@vger.kernel.org>, <driver-core@lists.linux.dev>
Subject: Re: [PATCH] rust: irq: add missing 'static bound to IRQ callback functions
Date: Tue, 17 Feb 2026 23:56:17 +0100	[thread overview]
Message-ID: <DGHLWAFPCCUD.CK5E70Q832CY@kernel.org> (raw)
In-Reply-To: <20260217222425.8755-1-cole@unwrap.rs>

On Tue Feb 17, 2026 at 11:24 PM CET, Cole Leavitt wrote:
> The Registration<T> and ThreadedRegistration<T> structs require
> T: Handler + 'static and T: ThreadedHandler + 'static respectively.
> However, the callback functions that are used with these registrations
> were missing the corresponding 'static bound:
>
>   - handle_irq_callback<T: Handler>
>   - handle_threaded_irq_callback<T: ThreadedHandler>
>   - thread_fn_callback<T: ThreadedHandler>
>
> This bound inconsistency was previously accepted by rustc, but recent
> compiler versions (1.93+) enforce E0310 more strictly when casting
> raw pointers to references in generic contexts. The callbacks cast a
> *mut c_void to a reference of the registration type, which requires
> T to be valid for 'static when the registration struct requires it.
>
> Add the missing 'static bound to all three callback functions to match
> their registration struct requirements and fix compilation with recent
> rustc versions.
>
> Fixes: 135d40523244 ("rust: irq: add threaded handler support")
> Signed-off-by: Cole Leavitt <cole@unwrap.rs>

Thanks for the patch! "Unfortunately", there is already an equivalent fix for
this on the list.

Link: https://lore.kernel.org/all/20260214092740.3201946-1-lossin@kernel.org/

      parent reply	other threads:[~2026-02-17 22:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 22:24 [PATCH] rust: irq: add missing 'static bound to IRQ callback functions Cole Leavitt
2026-02-17 22:31 ` Daniel Almeida
2026-02-17 22:56 ` Danilo Krummrich [this message]

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=DGHLWAFPCCUD.CK5E70Q832CY@kernel.org \
    --to=dakr@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=cole@unwrap.rs \
    --cc=daniel.almeida@collabora.com \
    --cc=driver-core@lists.linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    /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