The write_* functions have different return statement handling. Unify
them by removing "else" if the if-block itself returns and also unify
the error handling by checking for the error case, leaving the success
return statement at the end of the function.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/285
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
"\t\tMajor: %u\n"
"\t\tMinor: %u\n",
modname, devname, (type == 'c') ? "character" : "block", maj, min);
- if (ret >= 0)
- return EXIT_SUCCESS;
- else
+ if (ret < 0)
return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
}
static const struct static_nodes_format static_nodes_format_human = {
int ret;
ret = fprintf(out, "%s %s %c%u:%u\n", modname, devname, type, maj, min);
- if (ret >= 0)
- return EXIT_SUCCESS;
- else
+ if (ret < 0)
return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
}
static const struct static_nodes_format static_nodes_format_devname = {