From 2041272f5f8cb73d5468f479cb3455fbb9d2e244 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Thu, 25 Jan 2024 16:27:18 +0800 Subject: [PATCH] GPU (Linux): simpify code --- src/detection/gpu/gpu_linux.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 340893090..1775295f7 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -209,16 +209,8 @@ static void pciHandleDevice(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* { pci->ffpci_fill_info(device, PCI_FILL_CLASS); - char class[1024]; - pci->ffpci_lookup_name(pci->access, class, sizeof(class) - 1, PCI_LOOKUP_CLASS, device->device_class); - - if( - //https://pci-ids.ucw.cz/read/PD/03 - strcasecmp("VGA compatible controller", class) != 0 && - strcasecmp("XGA compatible controller", class) != 0 && - strcasecmp("3D controller", class) != 0 && - strcasecmp("Display controller", class) != 0 - ) return; + if (device->device_class >> 8 != PCI_BASE_CLASS_DISPLAY) + return; pci->ffpci_fill_info(device, PCI_FILL_IDENT);