From: Yu Watanabe Date: Sat, 25 Oct 2025 02:12:16 +0000 (+0900) Subject: module-util: drop 'sym_' prefix from cleanup functions X-Git-Tag: v259-rc1~246^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0520b1ee74a8021b8cc584ec390435dede148a9;p=thirdparty%2Fsystemd.git module-util: drop 'sym_' prefix from cleanup functions --- diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c index e63e4d228d5..e8230d4adf8 100644 --- a/src/core/kmod-setup.c +++ b/src/core/kmod-setup.c @@ -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; diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c index ea1b717bb31..e65da475c31 100644 --- a/src/modules-load/modules-load.c +++ b/src/modules-load/modules-load.c @@ -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); diff --git a/src/shared/module-util.c b/src/shared/module-util.c index dcdc122ffbb..25367c4da67 100644 --- a/src/shared/module-util.c +++ b/src/shared/module-util.c @@ -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); diff --git a/src/shared/module-util.h b/src/shared/module-util.h index 55c81612c3a..f5eaf35c909 100644 --- a/src/shared/module-util.h +++ b/src/shared/module-util.h @@ -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; \ diff --git a/src/test/test-netlink-manual.c b/src/test/test-netlink-manual.c index 02ef02be978..7934aa879d7 100644 --- a/src/test/test-netlink-manual.c +++ b/src/test/test-netlink-manual.c @@ -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);