if (cmd == NULL)
goto done_next;
- if (!strcmp(cmd, "alias")) {
+ if (streq(cmd, "alias")) {
char *alias = strtok_r(NULL, "\t ", &saveptr);
char *modname = strtok_r(NULL, "\t ", &saveptr);
kmod_config_add_alias(config,
underscores(ctx, alias),
underscores(ctx, modname));
- } else if (!strcmp(cmd, "blacklist")) {
+ } else if (streq(cmd, "blacklist")) {
char *modname = strtok_r(NULL, "\t ", &saveptr);
if (modname == NULL)
kmod_config_add_blacklist(config,
underscores(ctx, modname));
- } else if (!strcmp(cmd, "include") || !strcmp(cmd, "options")
- || !strcmp(cmd, "install")
- || !strcmp(cmd, "remove")
- || !strcmp(cmd, "softdep")
- || !strcmp(cmd, "config")) {
+ } else if (streq(cmd, "include") || streq(cmd, "options")
+ || streq(cmd, "install")
+ || streq(cmd, "remove")
+ || streq(cmd, "softdep")
+ || streq(cmd, "config")) {
INFO(ctx, "%s: command %s not implemented yet\n",
filename, cmd);
} else {
if (fn[0] == '.')
return 1;
- if (len < 6 || (strcmp(&fn[len - 5], ".conf") != 0
- && strcmp(&fn[len - 6], ".alias"))) {
+ if (len < 6 || (!streq(&fn[len - 5], ".conf")
+ && !streq(&fn[len - 6], ".alias"))) {
INFO(ctx, "All config files need .conf: %s/%s, "
"it will be ignored in a future release\n",
path, fn);
long value;
lineno++;
- if (tok == NULL || strcmp(tok, mod->name) != 0)
+ if (tok == NULL || !streq(tok, mod->name))
continue;
tok = strtok_r(NULL, " \t", &saveptr);
return err;
}
- if (strcmp(buf, "live\n") == 0)
+ if (streq(buf, "live\n"))
return KMOD_MODULE_LIVE;
- else if (strcmp(buf, "coming\n") == 0)
+ else if (streq(buf, "coming\n"))
return KMOD_MODULE_COMING;
- else if (strcmp(buf, "going\n") == 0)
+ else if (streq(buf, "going\n"))
return KMOD_MODULE_GOING;
ERR(mod->ctx, "unknown %s: '%s'\n", path, buf);