Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Joe Fradley <joefradley@google.com>
To: Jonathan Corbet <corbet@lwn.net>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	David Gow <davidgow@google.com>
Cc: Joe Fradley <joefradley@google.com>,
	kernel-team@android.com, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	kunit-dev@googlegroups.com
Subject: [PATCH 2/2] kunit: no longer call module_info(test, "Y") for kunit modules
Date: Wed, 17 Aug 2022 09:48:50 -0700	[thread overview]
Message-ID: <20220817164851.3574140-3-joefradley@google.com> (raw)
In-Reply-To: <20220817164851.3574140-1-joefradley@google.com>

Because KUnit test execution is not a guarantee with the kunit.enable
parameter we want to be careful to only taint the kernel only if an
actual test runs. Calling module_info(test, "Y") for every KUnit module
automatically causes the kernel to be tainted upon module load. Therefore,
we're removing this call and relying on the KUnit framework to taint the
kernel or not.

Signed-off-by: Joe Fradley <joefradley@google.com>
---
 include/kunit/test.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/kunit/test.h b/include/kunit/test.h
index c958855681cc..f23d3954aa17 100644
--- a/include/kunit/test.h
+++ b/include/kunit/test.h
@@ -251,7 +251,6 @@ static inline int kunit_run_all_tests(void)
 #endif /* IS_BUILTIN(CONFIG_KUNIT) */
 
 #define __kunit_test_suites(unique_array, ...)				       \
-	MODULE_INFO(test, "Y");						       \
 	static struct kunit_suite *unique_array[]			       \
 	__aligned(sizeof(struct kunit_suite *))				       \
 	__used __section(".kunit_test_suites") = { __VA_ARGS__ }
-- 
2.37.1.595.g718a3a8f04-goog


  parent reply	other threads:[~2022-08-17 16:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 16:48 [PATCH 0/2] kunit: add boot time parameter to enable KUnit Joe Fradley
2022-08-17 16:48 ` [PATCH 1/2] kunit: add kunit.enable to enable/disable KUnit test Joe Fradley
2022-08-19  8:16   ` David Gow
2022-08-22 20:37     ` Joe Fradley
2022-08-17 16:48 ` Joe Fradley [this message]
2022-08-19  8:34   ` [PATCH 2/2] kunit: no longer call module_info(test, "Y") for kunit modules David Gow
2022-08-22 20:47     ` Joe Fradley
2022-08-22 20:57   ` Brendan Higgins

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=20220817164851.3574140-3-joefradley@google.com \
    --to=joefradley@google.com \
    --cc=brendan.higgins@linux.dev \
    --cc=corbet@lwn.net \
    --cc=davidgow@google.com \
    --cc=kernel-team@android.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox