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
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"):

...

Arnd, do you have any objections?

Cheers,
Nathan

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