From: Randy Dunlap <randy.dunlap@oracle.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: devzero@web.de, linux-kernel@vger.kernel.org, alan@lxorguk.ukuu.org.uk
Subject: Re: Should MODULE_DESCRIPTION be mandatory ?
Date: Wed, 15 Apr 2009 14:26:47 -0700 [thread overview]
Message-ID: <49E65117.7020309@oracle.com> (raw)
In-Reply-To: <20090415212138.GB27597@uranus.ravnborg.org>
Sam Ravnborg wrote:
> On Wed, Apr 15, 2009 at 02:15:50PM -0700, Randy Dunlap wrote:
>> Sam Ravnborg wrote:
>>> On Wed, Apr 15, 2009 at 01:11:46PM +0200, devzero@web.de wrote:
>>>> Hi,
>>>>
>>>> some time ago i spotted that around 20% of the Linux modules lacking a MODULE_DESCRIPTION field. ( http://bugzilla.kernel.org/show_bug.cgi?id=10770 )
>>>>
>>>> I think it`s not a practicable approach to get this fixed by some single person digging trough all the modules.
>>>> If itŽs fixed for a kernel release, one year later there would be another bunch of new modules lacking the description field again.
>>>>
>>>> What about a build-time or run-time warning for missing MODULE_DESCRIPTION ? (as it exists for MODULE_LICENSE in modpost.c)
>>>
>>> You mean something like the following untested patch?
>>> If it works what is the output for an allmodconfig build?
>>>
>>> Sam
>>>
>>> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
>>> index 8cc7061..5317d6f 100644
>>> --- a/scripts/mod/modpost.c
>>> +++ b/scripts/mod/modpost.c
>>> @@ -1553,6 +1553,7 @@ static void read_symbols(char *modname)
>>> const char *symname;
>>> char *version;
>>> char *license;
>>> + char *description;
>>> struct module *mod;
>>> struct elf_info info = { };
>>> Elf_Sym *sym;
>>> @@ -1584,6 +1585,11 @@ static void read_symbols(char *modname)
>>> license = get_next_modinfo(info.modinfo, info.modinfo_len,
>>> "license", license);
>>> }
>>> + description = get_modinfo(info.modinfo, info.modinfo_len, "description");
>>> + if (info.modinfo && !description && !is_vmlinux(modname))
>>> + warn("modpost: missing MODULE_DESCRIPTION() in %s\n"
>>> + "see include/linux/module.h for "
>>> + "more information\n", modname);
>>>
>>> for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
>>> symname = info.strtab + sym->st_name;
>>> --
>> on x86_64 allmodconfig (2.6.30-rc2), here are the "missing"s that are reported:
>>
>> WARNING: modpost: missing MODULE_DESCRIPTION() in Documentation/filesystems/configfs/configfs_example_explicit.o
>> WARNING: modpost: missing MODULE_DESCRIPTION() in Documentation/filesystems/configfs/configfs_example_macros.o
>> WARNING: modpost: missing MODULE_DESCRIPTION() in arch/x86/ia32/ia32_aout.o
> ...
> We need to bring that list down before we apply the patch.
> Is it worth it?
I see 424 modules without MODULE_DESCRIPTION (in the list above) and
3127 .c files that contain "MODULE_DESCRIPTION".
To me it's a Nice to have but not Required. (i.e., not worth it IMO)
--
~Randy
next prev parent reply other threads:[~2009-04-15 21:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-15 11:11 Should MODULE_DESCRIPTION be mandatory ? devzero
2009-04-15 19:42 ` Sam Ravnborg
2009-04-15 21:15 ` Randy Dunlap
2009-04-15 21:21 ` Sam Ravnborg
2009-04-15 21:26 ` Randy Dunlap [this message]
2009-04-16 12:27 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2009-04-15 21:59 devzero
2009-04-16 11:25 ` Sam Ravnborg
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=49E65117.7020309@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=devzero@web.de \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
/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