Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: nova-core: bitfield: remove BitOr implementation

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/
Reviewed-by: Joel Fernandes <joelagnelf@nvidia.com>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Message-ID: <20251022-nova-bitfield-v1-3-73bc0988667b@nvidia.com>

+1 -9
+1 -9
drivers/gpu/nova-core/bitfield.rs
··· 94 94 // All rules below are helpers. 95 95 96 96 // Defines the wrapper `$name` type, as well as its relevant implementations (`Debug`, 97 - // `Default`, `BitOr`, and conversion to the value type) and field accessor methods. 97 + // `Default`, and conversion to the value type) and field accessor methods. 98 98 (@core $vis:vis $name:ident $storage:ty $(, $comment:literal)? { $($fields:tt)* }) => { 99 99 $( 100 100 #[doc=$comment] ··· 102 102 #[repr(transparent)] 103 103 #[derive(Clone, Copy)] 104 104 $vis struct $name($storage); 105 - 106 - impl ::core::ops::BitOr for $name { 107 - type Output = Self; 108 - 109 - fn bitor(self, rhs: Self) -> Self::Output { 110 - Self(self.0 | rhs.0) 111 - } 112 - } 113 105 114 106 impl ::core::convert::From<$name> for $storage { 115 107 fn from(val: $name) -> $storage {