]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
module-util: drop 'sym_' prefix from cleanup functions
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Oct 2025 02:12:16 +0000 (11:12 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Oct 2025 02:12:16 +0000 (11:12 +0900)
src/core/kmod-setup.c
src/modules-load/modules-load.c
src/shared/module-util.c
src/shared/module-util.h
src/test/test-netlink-manual.c

index e63e4d228d5b768790b3ece1b1244ca88d68807b..e8230d4adf87aa4d5e10dae9dda70c31b0c2a7ab 100644 (file)
@@ -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;
index ea1b717bb31107abfa25361da55734277955f88b..e65da475c31bdf1950fa7db98fa46667237301e4 100644 (file)
@@ -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);
index dcdc122ffbbe8bc903b3d1722115956ec5e77c03..25367c4da67e31eb49895016d2299a9e61e6e6a1 100644 (file)
@@ -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);
index 55c81612c3a5fbc17a1c580cbd903010be630783..f5eaf35c90916ceda19cd5f2cb1d15740464925a 100644 (file)
@@ -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; \
index 02ef02be9780bcba6b631b93e680fa9de2535186..7934aa879d78e212895966f3cf78200f7e1220d1 100644 (file)
@@ -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);