[igt-dev] [PATCH i-g-t 1/2] Increase the string size for a module name

Rodrigo Siqueira rodrigosiqueiramelo at gmail.com
Sat Jul 7 23:24:39 UTC 2018


Some modules name are larger than 5 characters, this can be a problem to
add support for other modules. This patch, increase the maximum size in
order to enable other modules to use IGT.

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo at gmail.com>
---
 lib/drmtest.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index fae6f86f..eee733eb 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -60,6 +60,8 @@
 #include "ioctl_wrappers.h"
 #include "igt_dummyload.h"
 
+#define NAME_LEN 32
+
 /**
  * SECTION:drmtest
  * @short_description: Base library for drm tests and tools
@@ -82,7 +84,7 @@ static int __get_drm_device_name(int fd, char *name)
 	drm_version_t version;
 
 	memset(&version, 0, sizeof(version));
-	version.name_len = 4;
+	version.name_len = NAME_LEN;
 	version.name = name;
 
 	if (!drmIoctl(fd, DRM_IOCTL_VERSION, &version)){
@@ -94,7 +96,7 @@ static int __get_drm_device_name(int fd, char *name)
 
 static bool __is_device(int fd, const char *expect)
 {
-	char name[5] = "";
+	char name[NAME_LEN] = "";
 
 	if (__get_drm_device_name(fd, name))
 		return false;
-- 
2.18.0



More information about the igt-dev mailing list