[PATCH 1/3] gpu: nova-core: bitfield: simplify condition
From: Alexandre Courbot
Date: Wed Oct 22 2025 - 06:51:11 EST
This condition was uselessly convoluted.
Reported-by: Edwin Peer <epeer@xxxxxxxxxx>
Link: https://lore.kernel.org/rust-for-linux/F3853912-2C1C-4F9B-89B0-3168689F35B3@xxxxxxxxxx/
Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
---
drivers/gpu/nova-core/bitfield.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/nova-core/bitfield.rs b/drivers/gpu/nova-core/bitfield.rs
index 25579b4c328f..136de7289162 100644
--- a/drivers/gpu/nova-core/bitfield.rs
+++ b/drivers/gpu/nova-core/bitfield.rs
@@ -203,7 +203,7 @@ impl $name {
) => {
bitfield!(
@leaf_accessor $vis $name $storage, $hi:$lo $field
- { |f| <$into_type>::from(if f != 0 { true } else { false }) }
+ { |f| <$into_type>::from(f != 0) }
bool $into_type => $into_type $(, $comment)?;
);
};
--
2.51.0