The module has a normal sequence from MODULE_STATE_COMING to MODULE_STATE_LIVE and to MODULE_STATE_GOING, and eventually MODULE_STATE_UNFORMED. The original order of cases is confusing and misleading. Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx> --- lib/kunit/test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/kunit/test.c b/lib/kunit/test.c index 421f13981412..29a5f5ea8112 100644 --- a/lib/kunit/test.c +++ b/lib/kunit/test.c @@ -783,14 +783,14 @@ static int kunit_module_notify(struct notifier_block *nb, unsigned long val, struct module *mod = data; switch (val) { + case MODULE_STATE_COMING: + kunit_module_init(mod); + break; case MODULE_STATE_LIVE: break; case MODULE_STATE_GOING: kunit_module_exit(mod); break; - case MODULE_STATE_COMING: - kunit_module_init(mod); - break; case MODULE_STATE_UNFORMED: break; } -- 2.34.1