diff mbox series

[1/4] modprobe: Rename rmmod_do_deps_list

Message ID 20220329090540.38255-2-lucas.demarchi@intel.com (mailing list archive)
State New
Headers show
Series modprobe -r fixes and refactors | expand

Commit Message

Lucas De Marchi March 29, 2022, 9:05 a.m. UTC
It's used not only for dependencies, but also for pre and post softdep.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 tools/modprobe.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Luis Chamberlain March 29, 2022, 7:37 p.m. UTC | #1
On Tue, Mar 29, 2022 at 02:05:35AM -0700, Lucas De Marchi wrote:
> It's used not only for dependencies, but also for pre and post softdep.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis
diff mbox series

Patch

diff --git a/tools/modprobe.c b/tools/modprobe.c
index 9387537..eed951f 100644
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -357,7 +357,8 @@  static int rmmod_do_remove_module(struct kmod_module *mod)
 #define RMMOD_FLAG_IGNORE_BUILTIN	0x2
 static int rmmod_do_module(struct kmod_module *mod, int flags);
 
-static int rmmod_do_deps_list(struct kmod_list *list, bool stop_on_errors)
+/* Remove modules in reverse order */
+static int rmmod_do_modlist(struct kmod_list *list, bool stop_on_errors)
 {
 	struct kmod_list *l;
 
@@ -413,12 +414,12 @@  static int rmmod_do_module(struct kmod_module *mod, int flags)
 		}
 	}
 
-	rmmod_do_deps_list(post, false);
+	rmmod_do_modlist(post, false);
 
 	if ((flags & RMMOD_FLAG_DO_DEPENDENCIES) && remove_dependencies) {
 		struct kmod_list *deps = kmod_module_get_dependencies(mod);
 
-		err = rmmod_do_deps_list(deps, true);
+		err = rmmod_do_modlist(deps, true);
 		if (err < 0)
 			goto error;
 	}
@@ -443,7 +444,7 @@  static int rmmod_do_module(struct kmod_module *mod, int flags)
 	if (err < 0)
 		goto error;
 
-	rmmod_do_deps_list(pre, false);
+	rmmod_do_modlist(pre, false);
 
 error:
 	kmod_module_unref_list(pre);