Skip to contentSkip to conversation

lib/chipset: Properly skip on non-Intel

PATCH In review Daniel Vetter 2 participants 2 messages Oct 11, 2016 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/chipset: Properly skip on non-Intel

Random drive-by I noticed while hacking on piglit.

---
 lib/intel_chipset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/intel_chipset.c +1 -2
index 777dfa73da80..ab35fa70c167 100644
@@ -100,8 +100,7 @@ intel_get_pci_device(void)
 		pci_dev = pci_device_next(iter);
 		pci_iterator_destroy(iter);
 	}
-	if (pci_dev == NULL)
-		errx(1, "Couldn't find graphics card");
+	igt_require_f(pci_dev, "Couldn't find Intel graphics card\n");
 
 	error = pci_device_probe(pci_dev);
 	igt_fail_on_f(error != 0,
Signature · 6 lines
2.9.3

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Daniel Vetter

Random drive-by I noticed while hacking on piglit.

---
 lib/intel_chipset.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
lib/intel_chipset.c +0 -0
index 777dfa73da80..ab35fa70c167 100644

lib/intel_chipset.c intel_get_pci_device(void) · line 106

Quoted 9 lines
lib/intel_chipset.c +1 -2
@@ -100,8 +100,7 @@ intel_get_pci_device(void)
 		pci_dev = pci_device_next(iter);
 		pci_iterator_destroy(iter);
 	}
-	if (pci_dev == NULL)
-		errx(1, "Couldn't find graphics card");
+	igt_require_f(pci_dev, "Couldn't find Intel graphics card\n");
 
 	error = pci_device_probe(pci_dev);
 	igt_fail_on_f(error != 0,

There's a check for vendor_id equaling 0x8086 some lines below, and I debated on IRC for changing it to igt_require as well. Then again it's quite impossible to reach, so might as well leave it as a noisy failure. I'll change it to igt_fail_on_f later.

--
Petri Latvala
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx