From: Alexandre Courbot Date: Wed, 7 May 2025 13:52:29 +0000 (+0900) Subject: gpu: nova-core: derive useful traits for Chipset X-Git-Tag: v6.16-rc1~144^2~3^2~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=297b2cd6ba2b708d987c30360f846cfbe79ad563;p=linux.git gpu: nova-core: derive useful traits for Chipset We will commonly need to compare chipset versions, so derive the ordering traits to make that possible. Also derive Copy and Clone since passing Chipset by value will be more efficient than by reference. Signed-off-by: Alexandre Courbot Link: https://lore.kernel.org/r/20250507-nova-frts-v3-2-fcb02749754d@nvidia.com Signed-off-by: Danilo Krummrich --- diff --git a/drivers/gpu/nova-core/gpu.rs b/drivers/gpu/nova-core/gpu.rs index 17c9660da450..4de67a2dc163 100644 --- a/drivers/gpu/nova-core/gpu.rs +++ b/drivers/gpu/nova-core/gpu.rs @@ -13,7 +13,7 @@ macro_rules! define_chipset { ({ $($variant:ident = $value:expr),* $(,)* }) => { /// Enum representation of the GPU chipset. - #[derive(fmt::Debug)] + #[derive(fmt::Debug, Copy, Clone, PartialOrd, Ord, PartialEq, Eq)] pub(crate) enum Chipset { $($variant = $value),*, }