]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commitdiff
gpu: nova-core: derive useful traits for Chipset
authorAlexandre Courbot <acourbot@nvidia.com>
Wed, 7 May 2025 13:52:29 +0000 (22:52 +0900)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 13 May 2025 12:15:42 +0000 (14:15 +0200)
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 <acourbot@nvidia.com>
Link: https://lore.kernel.org/r/20250507-nova-frts-v3-2-fcb02749754d@nvidia.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
drivers/gpu/nova-core/gpu.rs

index 17c9660da45034762edaa78e372d8821144cdeb7..4de67a2dc16302c00530026156d7264cbc7e5b32 100644 (file)
@@ -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),*,
         }