summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-12-02 21:55:18 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-12-02 21:56:23 +0000
commit901c2bb97e6c7acf4f7ca9f310bc958e6492ddcf (patch)
tree842521bf60bd9934d4456df46ea21d1b811b3693 /lib
parent31a34fb8692cac647fdc9a3d04f297d1b3c9bf98 (diff)
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib')
-rw-r--r--lib/igt_kmod.c6
1 files changed, 4 insertions, 2 deletions
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",