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

Configure Feed

Select the types of activity you want to include in your feed.

gpu: nova-core: bitfield: fix broken Default implementation

The current implementation does not actually set the default values for
the fields in the bitfield.

Fixes: 3fa145bef533 ("gpu: nova-core: register: generate correct `Default` implementation")
Signed-off-by: Eliot Courtney <ecourtney@nvidia.com>
Link: https://patch.msgid.link/20260401-fix-bitfield-v2-1-2fa68c98114a@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Eliot Courtney and committed by
Danilo Krummrich
de0aca13 0e0ffbcd

+2 -3
+2 -3
drivers/gpu/nova-core/bitfield.rs
··· 314 314 /// Returns a value for the bitfield where all fields are set to their default value. 315 315 impl ::core::default::Default for $name { 316 316 fn default() -> Self { 317 - #[allow(unused_mut)] 318 - let mut value = Self(Default::default()); 317 + let value = Self(Default::default()); 319 318 320 319 ::kernel::macros::paste!( 321 320 $( 322 - value.[<set_ $field>](Default::default()); 321 + let value = value.[<set_ $field>](Default::default()); 323 322 )* 324 323 ); 325 324