From: Alan Maguire <alan.maguire@oracle.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Alan Maguire <alan.maguire@oracle.com>,
brendanhiggins@google.com, linux-kselftest@vger.kernel.org,
skhan@linuxfoundation.org, linux-kernel@vger.kernel.org,
kunit-dev@googlegroups.com, keescook@chromium.org,
yzaikin@google.com, akpm@linux-foundation.org,
yamada.masahiro@socionext.com, catalin.marinas@arm.com,
joe.lawrence@redhat.com, penguin-kernel@i-love.sakura.ne.jp,
urezki@gmail.com, andriy.shevchenko@linux.intel.com,
corbet@lwn.net, tytso@mit.edu, adilger.kernel@dilger.ca,
mcgrof@kernel.org, linux-ext4@vger.kernel.org,
linux-doc@vger.kernel.org, Knut Omang <knut.omang@oracle.com>
Subject: Re: [PATCH v4 linux-kselftest-test 5/6] kunit: allow kunit to be loaded as a module
Date: Wed, 20 Nov 2019 13:46:00 +0000 (GMT) [thread overview]
Message-ID: <alpine.LRH.2.20.1911201144520.19458@dhcp-10-175-162-125.vpn.oracle.com> (raw)
In-Reply-To: <20191119211315.4EFC6223E4@mail.kernel.org>
On Tue, 19 Nov 2019, Stephen Boyd wrote:
> Quoting Alan Maguire (2019-11-15 02:16:11)
> > diff --git a/lib/kunit/test.c b/lib/kunit/test.c
> > index 87b5cf1..41ef71a 100644
> > --- a/lib/kunit/test.c
> > +++ b/lib/kunit/test.c
> > @@ -486,3 +486,16 @@ void kunit_cleanup(struct kunit *test)
> > }
> > }
> > EXPORT_SYMBOL_GPL(kunit_cleanup);
> > +
> > +static int kunit_init(void)
>
> Missing __init?
>
Oops, will fix.
> > +{
> > + return 0;
> > +}
> > +late_initcall(kunit_init);
>
> It looks pretty weird that this doesn't do anything in the module init
> or exit path. How does it work? And why does it need to be late init if
> nothing is called from here?
>
I used a late_initcall() here because if there is initialization code in
the future (say setting up debugfs, sysctl tables etc), it will get run
irrespective of whether kunit is built as a module or not. For the module
case, we need init/exit to ensure the module can be unloaded
successfully.
> > +
> > +static void __exit kunit_exit(void)
> > +{
> > +}
> > +module_exit(kunit_exit);
> > +
> > +MODULE_LICENSE("GPL");
>
> I guess should be "GPL v2"?
>
Good catch, will fix here and elsewhere, thanks!
BTW in replying to your review of patch 1 I made a mistake; we do in fact
need to add the "#include <linux/kernel.h>" in assert.h as we are removing
the "#include <kunit/string-stream.h>". The latter indirectly includes
linux/kernel.h which allows us to find definition for "struct va_format"
used in the struct kunit_assert definition. Apologies about this.
I'll have a go at generating v5 using -C as requested. Thanks again for
the careful review!
Alan
next prev parent reply other threads:[~2019-11-20 13:49 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 10:16 [PATCH v4 linux-kselftest-test 0/6] kunit: support building core/tests as modules Alan Maguire
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 1/6] kunit: move string-stream.h to lib/kunit Alan Maguire
2019-11-17 1:33 ` Stephen Boyd
2019-11-19 18:36 ` Brendan Higgins
2019-11-19 18:39 ` Brendan Higgins
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 2/6] kunit: hide unexported try-catch interface in try-catch-impl.h Alan Maguire
2019-11-17 1:36 ` Stephen Boyd
2019-11-18 17:30 ` Alan Maguire
2019-11-19 18:48 ` Brendan Higgins
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module Alan Maguire
2019-11-19 19:16 ` Brendan Higgins
2019-11-20 13:56 ` Alan Maguire
2019-11-19 21:05 ` Stephen Boyd
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 4/6] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Alan Maguire
2019-11-18 22:09 ` Luis Chamberlain
2019-11-19 1:24 ` Brendan Higgins
2019-11-19 21:06 ` Stephen Boyd
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 5/6] kunit: allow kunit to be loaded as a module Alan Maguire
2019-11-19 21:13 ` Stephen Boyd
2019-11-20 13:46 ` Alan Maguire [this message]
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 6/6] kunit: update documentation to describe module-based build Alan Maguire
2019-11-19 21:15 ` Stephen Boyd
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=alpine.LRH.2.20.1911201144520.19458@dhcp-10-175-162-125.vpn.oracle.com \
--to=alan.maguire@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brendanhiggins@google.com \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=joe.lawrence@redhat.com \
--cc=keescook@chromium.org \
--cc=knut.omang@oracle.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=sboyd@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tytso@mit.edu \
--cc=urezki@gmail.com \
--cc=yamada.masahiro@socionext.com \
--cc=yzaikin@google.com \
/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;
as well as URLs for NNTP newsgroup(s).