From: Alexandre Courbot <acourbot@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>,
Alice Ryhl <aliceryhl@google.com>, Edwin Peer <epeer@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>,
Alistair Popple <apopple@nvidia.com>,
Joel Fernandes <joelagnelf@nvidia.com>,
Timur Tabi <ttabi@nvidia.com>,
nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 3/3] gpu: nova-core: bitfield: remove BitOr implementation
Date: Wed, 22 Oct 2025 19:50:58 +0900 [thread overview]
Message-ID: <20251022-nova-bitfield-v1-3-73bc0988667b@nvidia.com> (raw)
In-Reply-To: <20251022-nova-bitfield-v1-0-73bc0988667b@nvidia.com>
Using this operand can produce invalid values. It also doesn't bring
any benefit as one can use the builder pattern to assemble a new value.
Reported-by: Edwin Peer <epeer@nvidia.com>
Link: https://lore.kernel.org/rust-for-linux/F3853912-2C1C-4F9B-89B0-3168689F35B3@nvidia.com/
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpu/nova-core/bitfield.rs | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/gpu/nova-core/bitfield.rs b/drivers/gpu/nova-core/bitfield.rs
index f113439c6501..16e143658c51 100644
--- a/drivers/gpu/nova-core/bitfield.rs
+++ b/drivers/gpu/nova-core/bitfield.rs
@@ -94,7 +94,7 @@ macro_rules! bitfield {
// All rules below are helpers.
// Defines the wrapper `$name` type, as well as its relevant implementations (`Debug`,
- // `Default`, `BitOr`, and conversion to the value type) and field accessor methods.
+ // `Default`, and conversion to the value type) and field accessor methods.
(@core $vis:vis $name:ident $storage:ty $(, $comment:literal)? { $($fields:tt)* }) => {
$(
#[doc=$comment]
@@ -103,14 +103,6 @@ macro_rules! bitfield {
#[derive(Clone, Copy)]
$vis struct $name($storage);
- impl ::core::ops::BitOr for $name {
- type Output = Self;
-
- fn bitor(self, rhs: Self) -> Self::Output {
- Self(self.0 | rhs.0)
- }
- }
-
impl ::core::convert::From<$name> for $storage {
fn from(val: $name) -> $storage {
val.0
--
2.51.0
next prev parent reply other threads:[~2025-10-22 10:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 10:50 [PATCH 0/3] gpu: nova-core: various bitfield fixes Alexandre Courbot
2025-10-22 10:50 ` [PATCH 1/3] gpu: nova-core: bitfield: simplify condition Alexandre Courbot
2025-10-22 16:12 ` Joel Fernandes
2025-10-22 10:50 ` [PATCH 2/3] gpu: nova-core: bitfield: simplify expression Alexandre Courbot
2025-10-22 16:12 ` Joel Fernandes
2025-10-22 10:50 ` Alexandre Courbot [this message]
2025-10-22 16:11 ` [PATCH 3/3] gpu: nova-core: bitfield: remove BitOr implementation Joel Fernandes
2025-10-22 16:19 ` [PATCH 0/3] gpu: nova-core: various bitfield fixes Danilo Krummrich
2025-10-27 0:55 ` Alexandre Courbot
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=20251022-nova-bitfield-v1-3-73bc0988667b@nvidia.com \
--to=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=epeer@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=ttabi@nvidia.com \
/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
all inboxes | Powered by JetHome®