lkml.org 
[lkml]   [2018]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kernel/module: silence a gcc warning
On Thu, Apr 19, 2018 at 7:15 PM, Mathieu Malaterre <malat@debian.org> wrote:
> Hi Jessica,
>
> On Mon, Apr 16, 2018 at 7:11 PM, Jessica Yu <jeyu@kernel.org> wrote:
>> +++ Mathieu Malaterre [11/04/18 21:05 +0200]:
>>>
>>> In commit 8c8ef42aee8f ("module: include other structures in module
>>> version
>>> check"), the function `struct_module` was renamed to `module_layout` but
>>> no
>>> prototype was added to `include/linux/module.h`. Remove warning triggered
>>> at W=1:
>>>
>>> kernel/module.c:4378:6: warning: no previous prototype for
>>> ‘module_layout’ [-Wmissing-prototypes]
>>>
>>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>>> ---
>>> include/linux/module.h | 8 ++++++++
>>> 1 file changed, 8 insertions(+)
>>>
>>> diff --git a/include/linux/module.h b/include/linux/module.h
>>> index d44df9b2c131..28046e8b7e9d 100644
>>> --- a/include/linux/module.h
>>> +++ b/include/linux/module.h
>>> @@ -786,6 +786,14 @@ extern int module_sysfs_initialized;
>>>
>>> #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:"
>>> #x)
>>>
>>> +#ifdef CONFIG_MODVERSIONS
>>> +void module_layout(struct module *mod,
>>> + struct modversion_info *ver,
>>> + struct kernel_param *kp,
>>> + struct kernel_symbol *ks,
>>> + struct tracepoint * const *tp);
>>> +#endif /* CONFIG_MODVERSIONS */
>>> +
>>
>>
>> Hi Mathieu,
>>
>> We're going to need a forward declaration in module.h for struct tracepoint
>> to address the kbuild warnings.
>
> Well that what I also thought at first. But since line 433 already does:
>
> struct tracepoint * const *tracepoints_ptrs;
>
> I suspect I should instead add sentinels: #ifdef CONFIG_TRACEPOINTS/#endif

No that's missing totally the point.

> Will try out shortly.

Please drop the patch, fix is uglier than leaving the warning.

>> Thanks,
>>
>> Jessica
>>
>>
>>> /* BELOW HERE ALL THESE ARE OBSOLETE AND WILL VANISH */
>>>
>>> #define __MODULE_STRING(x) __stringify(x)
>>> --
>>> 2.11.0
>>>
>>

\
 
 \ /
  Last update: 2018-04-23 20:42    [W:0.053 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site