From: "Paul E. McKenney" <paulmck@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Arnd Bergmann <arnd@kernel.org>, Marco Elver <elver@google.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>, Dmitry Vyukov <dvyukov@google.com>,
kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com
Subject: Re: [PATCH] kcsan: fix debugfs initcall return type
Date: Fri, 14 May 2021 13:18:08 -0700 [thread overview]
Message-ID: <20210514201808.GO975577@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <534d9b03-6fb2-627a-399d-36e7127e19ff@kernel.org>
On Fri, May 14, 2021 at 01:11:05PM -0700, Nathan Chancellor wrote:
> Hi Paul,
>
> On 5/14/2021 12:36 PM, Paul E. McKenney wrote:
> > On Fri, May 14, 2021 at 11:29:18AM -0700, Nathan Chancellor wrote:
> > > On 5/14/2021 7:00 AM, Arnd Bergmann wrote:
> > > > From: Arnd Bergmann <arnd@arndb.de>
> > > >
> > > > clang points out that an initcall funciton should return an 'int':
> > > >
> > > > kernel/kcsan/debugfs.c:274:15: error: returning 'void' from a function with incompatible result type 'int'
> > > > late_initcall(kcsan_debugfs_init);
> > > > ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
> > > > include/linux/init.h:292:46: note: expanded from macro 'late_initcall'
> > > > #define late_initcall(fn) __define_initcall(fn, 7)
> > > >
> > > > Fixes: e36299efe7d7 ("kcsan, debugfs: Move debugfs file creation out of early init")
> > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > >
> > > For the record, this requires CONFIG_LTO_CLANG to be visible.
> > >
> > > Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> >
> > Queued with the three Reviewed-by tags, thank you all!
> >
> > Nathan, I lost the thread on exactly what it is that requires that
> > CONFIG_LTO_CLANG be visible. A naive reader might conclude that the
> > compiler diagnostic does not appear unless CONFIG_LTO_CLANG=y, but
> > that would be surprising (and yes, I have been surprised many times).
> > If you are suggesting that the commit log be upgraded, could you please
> > supply suggested wording?
>
> You can see my response to Marco here:
>
> https://lore.kernel.org/r/ad7fa126-f371-5a24-1d80-27fe8f655b05@kernel.org/
>
> Maybe some improved wording might look like
>
> clang with CONFIG_LTO_CLANG points out that an initcall function should
> return an 'int' due to the changes made to the initcall macros in commit
> 3578ad11f3fb ("init: lto: fix PREL32 relocations"):
OK, so the naive reading was correct, thank you!
> ...
>
> Arnd, do you have any objections?
In the meantime, here is what I have. Please let me know of any needed
updates.
Thanx, Paul
------------------------------------------------------------------------
commit fe1f4e1b099797d06bd8c66681eed4024c3cad67
Author: Arnd Bergmann <arnd@arndb.de>
Date: Fri May 14 16:00:08 2021 +0200
kcsan: Fix debugfs initcall return type
clang with CONFIG_LTO_CLANG points out that an initcall function should
return an 'int' due to the changes made to the initcall macros in commit
3578ad11f3fb ("init: lto: fix PREL32 relocations"):
kernel/kcsan/debugfs.c:274:15: error: returning 'void' from a function with incompatible result type 'int'
late_initcall(kcsan_debugfs_init);
~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
include/linux/init.h:292:46: note: expanded from macro 'late_initcall'
#define late_initcall(fn) __define_initcall(fn, 7)
Fixes: e36299efe7d7 ("kcsan, debugfs: Move debugfs file creation out of early init")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Marco Elver <elver@google.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
diff --git a/kernel/kcsan/debugfs.c b/kernel/kcsan/debugfs.c
index c1dd02f3be8b..e65de172ccf7 100644
--- a/kernel/kcsan/debugfs.c
+++ b/kernel/kcsan/debugfs.c
@@ -266,9 +266,10 @@ static const struct file_operations debugfs_ops =
.release = single_release
};
-static void __init kcsan_debugfs_init(void)
+static int __init kcsan_debugfs_init(void)
{
debugfs_create_file("kcsan", 0644, NULL, NULL, &debugfs_ops);
+ return 0;
}
late_initcall(kcsan_debugfs_init);
next prev parent reply other threads:[~2021-05-14 20:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-14 14:00 Arnd Bergmann
2021-05-14 14:10 ` Greg Kroah-Hartman
2021-05-14 14:45 ` Marco Elver
2021-05-14 15:28 ` Arnd Bergmann
2021-05-14 18:40 ` Nathan Chancellor
2021-05-14 18:29 ` Nathan Chancellor
2021-05-14 19:36 ` Paul E. McKenney
2021-05-14 20:11 ` Nathan Chancellor
2021-05-14 20:18 ` Paul E. McKenney [this message]
2021-05-14 21:16 ` Arnd Bergmann
2021-05-14 23:01 ` Marco Elver
2021-05-15 0:55 ` Paul E. McKenney
2021-05-18 23:20 ` Paul E. McKenney
2021-05-19 8:09 ` Marco Elver
2021-05-15 14:19 ` Miguel Ojeda
2021-05-17 18:24 ` Paul E. McKenney
2021-05-16 5:17 ` Nathan Chancellor
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=20210514201808.GO975577@paulmck-ThinkPad-P17-Gen-1 \
--to=paulmck@kernel.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kasan-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@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
all inboxes | Powered by JetHome®