From be9d7b6db1e672f3555caed2f14bd1e4fe63c79a Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 2 Apr 2025 14:11:28 +0200 Subject: [PATCH] [no-relnote] Fix QF1002: could use tagged switch on info.SubType lint errors Signed-off-by: Evan Lezar --- internal/platform-support/dgpu/nvsandboxutils.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/platform-support/dgpu/nvsandboxutils.go b/internal/platform-support/dgpu/nvsandboxutils.go index 7022deab..ebeea7c8 100644 --- a/internal/platform-support/dgpu/nvsandboxutils.go +++ b/internal/platform-support/dgpu/nvsandboxutils.go @@ -71,13 +71,13 @@ func (d *nvsandboxutilsDGPU) Devices() ([]discover.Device, error) { var devices []discover.Device for _, info := range gpuFileInfos { - switch { - case info.SubType == nvsandboxutils.NV_DEV_DRI_CARD, info.SubType == nvsandboxutils.NV_DEV_DRI_RENDERD: + switch info.SubType { + case nvsandboxutils.NV_DEV_DRI_CARD, nvsandboxutils.NV_DEV_DRI_RENDERD: if d.isMig { continue } fallthrough - case info.SubType == nvsandboxutils.NV_DEV_NVIDIA, info.SubType == nvsandboxutils.NV_DEV_NVIDIA_CAPS_NVIDIA_CAP: + case nvsandboxutils.NV_DEV_NVIDIA, nvsandboxutils.NV_DEV_NVIDIA_CAPS_NVIDIA_CAP: containerPath := info.Path if d.devRoot != "/" { containerPath = strings.TrimPrefix(containerPath, d.devRoot) @@ -89,7 +89,7 @@ func (d *nvsandboxutilsDGPU) Devices() ([]discover.Device, error) { Path: containerPath, } devices = append(devices, device) - case info.SubType == nvsandboxutils.NV_DEV_DRI_CARD_SYMLINK, info.SubType == nvsandboxutils.NV_DEV_DRI_RENDERD_SYMLINK: + case nvsandboxutils.NV_DEV_DRI_CARD_SYMLINK, nvsandboxutils.NV_DEV_DRI_RENDERD_SYMLINK: if d.isMig { continue }