lkml.org 
[lkml]   [2021]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] kcsan: fix debugfs initcall return type
From
Date
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>

> ---
> kernel/kcsan/debugfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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);
>

\
 
 \ /
  Last update: 2021-05-14 20:30    [W:2.014 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site