module-util: drop 'sym_' prefix from cleanup functions
This commit is contained in:
@@ -148,7 +148,7 @@ int kmod_setup(void) {
|
||||
if (have_effective_cap(CAP_SYS_MODULE) <= 0)
|
||||
return 0;
|
||||
|
||||
_cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
_cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
FOREACH_ELEMENT(kmod, kmod_table) {
|
||||
if (kmod->path && access(kmod->path, F_OK) >= 0)
|
||||
continue;
|
||||
|
||||
@@ -135,7 +135,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
static int run(int argc, char *argv[]) {
|
||||
_cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
_cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
int r, k;
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
|
||||
@@ -68,7 +68,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
|
||||
}
|
||||
|
||||
int module_load_and_warn(struct kmod_ctx *ctx, const char *module, bool verbose) {
|
||||
_cleanup_(sym_kmod_module_unref_listp) struct kmod_list *modlist = NULL;
|
||||
_cleanup_(kmod_module_unref_listp) struct kmod_list *modlist = NULL;
|
||||
_cleanup_strv_free_ char **denylist = NULL;
|
||||
bool denylist_parsed = false;
|
||||
struct kmod_list *itr;
|
||||
@@ -93,7 +93,7 @@ int module_load_and_warn(struct kmod_ctx *ctx, const char *module, bool verbose)
|
||||
"Failed to find module '%s'", module);
|
||||
|
||||
sym_kmod_list_foreach(itr, modlist) {
|
||||
_cleanup_(sym_kmod_module_unrefp) struct kmod_module *mod = NULL;
|
||||
_cleanup_(kmod_module_unrefp) struct kmod_module *mod = NULL;
|
||||
int state, err;
|
||||
|
||||
mod = sym_kmod_module_get_module(itr);
|
||||
@@ -172,7 +172,7 @@ _printf_(6,0) static void systemd_kmod_log(
|
||||
}
|
||||
|
||||
int module_setup_context(struct kmod_ctx **ret) {
|
||||
_cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
_cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
int r;
|
||||
|
||||
assert(ret);
|
||||
|
||||
@@ -25,9 +25,9 @@ extern DLSYM_PROTOTYPE(kmod_validate_resources);
|
||||
|
||||
int dlopen_libkmod(void);
|
||||
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct kmod_ctx*, sym_kmod_unref);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(struct kmod_module*, sym_kmod_module_unref);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(struct kmod_list*, sym_kmod_module_unref_list, NULL);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct kmod_ctx*, sym_kmod_unref, kmod_unrefp, NULL);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct kmod_module*, sym_kmod_module_unref, kmod_module_unrefp, NULL);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct kmod_list*, sym_kmod_module_unref_list, kmod_module_unref_listp, NULL);
|
||||
|
||||
#define sym_kmod_list_foreach(list_entry, first_entry) \
|
||||
for (list_entry = first_entry; \
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include "tests.h"
|
||||
|
||||
static int load_module(const char *mod_name) {
|
||||
_cleanup_(sym_kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
_cleanup_(sym_kmod_module_unref_listp) struct kmod_list *list = NULL;
|
||||
_cleanup_(kmod_unrefp) struct kmod_ctx *ctx = NULL;
|
||||
_cleanup_(kmod_module_unref_listp) struct kmod_list *list = NULL;
|
||||
struct kmod_list *l;
|
||||
int r;
|
||||
|
||||
@@ -28,7 +28,7 @@ static int load_module(const char *mod_name) {
|
||||
return r;
|
||||
|
||||
sym_kmod_list_foreach(l, list) {
|
||||
_cleanup_(sym_kmod_module_unrefp) struct kmod_module *mod = NULL;
|
||||
_cleanup_(kmod_module_unrefp) struct kmod_module *mod = NULL;
|
||||
|
||||
mod = sym_kmod_module_get_module(l);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user