Skip to contentSkip to conversation

tests: util: Fixup util_open() parameter order

PATCH In review Thierry Reding 2 participants 2 messages Jan 5, 2016 – Jan 26, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: util: Fixup util_open() parameter order

From: Thierry Reding <[email protected]>

util_open() takes a device parameter, followed by a module parameter. The existing tests used the drmOpen() function, which uses a different ordering of the parameters, and the old ordering was accidentally kept during the conversion.

---
Evidently I didn't properly test this. Things do work in most cases with the current code because of the auto-detection, but there will be cases where it fails.

 tests/modetest/modetest.c | 2 +-
 tests/proptest/proptest.c | 2 +-
 tests/vbltest/vbltest.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
tests/modetest/modetest.c +1 -1
index 22e3e81bd3cc..f665240a53c5 100644
@@ -1603,7 +1603,7 @@ int main(int argc, char **argv)
 	if (!args)
 		encoders = connectors = crtcs = planes = framebuffers = 1;
 
-	dev.fd = util_open(module, device);
+	dev.fd = util_open(device, module);
 	if (dev.fd < 0)
 		return -1;
 
tests/proptest/proptest.c +1 -1
index 24c634569f2f..4bd08665461c 100644
@@ -295,7 +295,7 @@ int main(int argc, char *argv[])
 
 	args = argc - optind;
 
-	fd = util_open(module, device);
+	fd = util_open(device, module);
 	if (fd < 0)
 		return 1;
 
tests/vbltest/vbltest.c +1 -1
index 183332122978..4475b49b7b9a 100644
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
 		}
 	}
 
-	fd = util_open(module, device);
+	fd = util_open(device, module);
 	if (fd < 0)
 		return 1;
 
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 7 lines · Thierry Reding

From: Thierry Reding <[email protected]>

util_open() takes a device parameter, followed by a module parameter. The existing tests used the drmOpen() function, which uses a different ordering of the parameters, and the old ordering was accidentally kept during the conversion.

Quoted 6 lines

---
Evidently I didn't properly test this. Things do work in most cases with the current code because of the auto-detection, but there will be cases where it fails.

Having the module name identical to the device name also helps ;-) But seriously - nicely spotted. I'll going through the list and I'll push this out shortly.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel