From: Alexandre Courbot Date: Wed, 22 Oct 2025 10:50:56 +0000 (+0900) Subject: gpu: nova-core: bitfield: simplify condition X-Git-Tag: v6.19-rc1~157^2~8^2~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa08ec789f81425c3722fd2c6df825e06c810b43;p=thirdparty%2Fkernel%2Flinux.git gpu: nova-core: bitfield: simplify condition This condition was uselessly convoluted. Reported-by: Edwin Peer Link: https://lore.kernel.org/rust-for-linux/F3853912-2C1C-4F9B-89B0-3168689F35B3@nvidia.com/ Reviewed-by: Joel Fernandes Reviewed-by: Danilo Krummrich Signed-off-by: Alexandre Courbot Message-ID: <20251022-nova-bitfield-v1-1-73bc0988667b@nvidia.com> --- diff --git a/drivers/gpu/nova-core/bitfield.rs b/drivers/gpu/nova-core/bitfield.rs index 25579b4c328fe..136de72891629 100644 --- a/drivers/gpu/nova-core/bitfield.rs +++ b/drivers/gpu/nova-core/bitfield.rs @@ -203,7 +203,7 @@ macro_rules! bitfield { ) => { 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)?; ); };