All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jinjie Ruan <ruanjinjie@huawei.com>
To: <linux-kselftest@vger.kernel.org>, <kunit-dev@googlegroups.com>,
	<brendan.higgins@linux.dev>, <davidgow@google.com>,
	<skhan@linuxfoundation.org>, <rmoar@google.com>,
	<marpagan@redhat.com>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH RESEND 1/3] kunit: Make the cases sequence more reasonable for kunit_module_notify()
Date: Thu, 28 Sep 2023 17:14:44 +0800	[thread overview]
Message-ID: <20230928091446.1209703-2-ruanjinjie@huawei.com> (raw)
In-Reply-To: <20230928091446.1209703-1-ruanjinjie@huawei.com>

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@huawei.com>
---
 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


  reply	other threads:[~2023-09-28  9:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28  9:14 [PATCH RESEND 0/3] kunit: Init and run test suites in the right state Jinjie Ruan
2023-09-28  9:14 ` Jinjie Ruan [this message]
2023-09-28  9:14 ` [PATCH RESEND 2/3] kunit: Return error from kunit_module_init() Jinjie Ruan
2023-09-28  9:14 ` [PATCH RESEND 3/3] kunit: Init and run test suites in the right state Jinjie Ruan
2023-09-28 16:42   ` Marco Pagani
2023-10-07  6:48     ` Ruan Jinjie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230928091446.1209703-2-ruanjinjie@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=brendan.higgins@linux.dev \
    --cc=davidgow@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=marpagan@redhat.com \
    --cc=rmoar@google.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.