From: "Gary Guo" <gary@garyguo.net>
To: "Markus Probst" <markus.probst@posteo.de>,
"Lee Jones" <lee@kernel.org>, "Pavel Machek" <pavel@kernel.org>,
"Griffin Kroah-Hartman" <griffin@kroah.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@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>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>
Cc: <linux-leds@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <rust-for-linux@vger.kernel.org>,
<driver-core@lists.linux.dev>
Subject: Re: [PATCH v2 3/4] rust: io: Implement Copy for RegisterArrayLoc
Date: Fri, 04 Dec 2026 13:38:37 +0000 [thread overview]
Message-ID: <DNBZNA8SMG01.238PO153HCTZ6@garyguo.net> (raw)
In-Reply-To: <20261204-synology_disk_leds-v2-3-12815785ff8b@posteo.de>
On Fri Dec 4, 2026 at 12:21 PM GMT, Markus Probst wrote:
> This allows storing `RegisterArrayLoc` and using it multiple times.
>
> Derive is not possible, as it would introduce the unnecessary `T: Copy`
> bound.
>
> Signed-off-by: Markus Probst <markus.probst@posteo.de>
It's already in linux-next but I think it's via drm-rust-next tree.
Best,
Gary
> ---
> rust/kernel/io/register.rs | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/rust/kernel/io/register.rs b/rust/kernel/io/register.rs
> index c4f7be770dcb..6381c52bd397 100644
> --- a/rust/kernel/io/register.rs
> +++ b/rust/kernel/io/register.rs
> @@ -209,6 +209,14 @@ fn offset(self) -> usize {
> }
> }
>
> +impl<T: RegisterArray> Copy for RegisterArrayLoc<T> {}
> +
> +impl<T: RegisterArray> Clone for RegisterArrayLoc<T> {
> + fn clone(&self) -> Self {
> + *self
> + }
> +}
> +
> /// Trait providing location builders for [`RegisterArray`]s.
> pub trait Array {
> /// Returns the location of the register at position `idx`, with build-time validation.
next prev parent reply other threads:[~2026-12-04 13:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 12:21 [PATCH v2 0/4] leds: Add driver for disk leds in synology devices Markus Probst
2026-12-04 12:21 ` [PATCH v2 1/4] dt-bindings: leds: Add synology disk led controller Markus Probst
2026-12-04 12:35 ` sashiko-bot
2026-12-04 12:21 ` [PATCH v2 2/4] rust: io: Add `RegisterArrayLoc::index` Markus Probst
2026-12-04 12:30 ` sashiko-bot
2026-12-04 12:21 ` [PATCH v2 3/4] rust: io: Implement Copy for RegisterArrayLoc Markus Probst
2026-12-04 12:33 ` sashiko-bot
2026-12-04 13:38 ` Gary Guo [this message]
2026-12-04 13:42 ` Markus Probst
2026-12-04 12:22 ` [PATCH v2 4/4] leds: Add driver for disk leds in synology devices Markus Probst
2026-12-04 13:32 ` sashiko-bot
2026-12-04 16:54 ` Markus Probst
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=DNBZNA8SMG01.238PO153HCTZ6@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=conor+dt@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=driver-core@lists.linux.dev \
--cc=griffin@kroah.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=markus.probst@posteo.de \
--cc=ojeda@kernel.org \
--cc=pavel@kernel.org \
--cc=robh@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
/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