[PATCH RESEND 1/3] kunit: Make the cases sequence more reasonable for kunit_module_notify()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux