From 901c2bb97e6c7acf4f7ca9f310bc958e6492ddcf Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 2 Dec 2016 21:55:18 +0000 Subject: lib/igt_kmod: Update the prefix match string length Not only do you need to change the prefix string, but you also need to update its length. Signed-off-by: Chris Wilson --- lib/igt_kmod.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c index 3dccac09..a861a5f2 100644 --- a/lib/igt_kmod.c +++ b/lib/igt_kmod.c @@ -343,6 +343,8 @@ static void kmsg_dump(int fd) void igt_kselftests(const char *module_name, const char *module_options) { + const char *param_prefix = "igt__"; + const int param_len = strlen(param_prefix); char options[1024]; struct kmod_ctx *ctx = kmod_ctx(); struct kmod_module *kmod; @@ -373,14 +375,14 @@ void igt_kselftests(const char *module_name, const char *module_options) continue; val = kmod_module_info_get_value(d); - if (!val || strncmp(val, "igt__", 9)) + if (!val || strncmp(val, param_prefix, param_len)) continue; subtest = strdup(val); colon = strchr(subtest, ':'); *colon = '\0'; - igt_subtest_f("%s", subtest + 9) { + igt_subtest_f("%s", subtest + param_len) { lseek(kmsg, 0, SEEK_END); snprintf(options, sizeof(options), "%s=1 %s", -- cgit v1.2.3