* EXPORT_SYMBOL generates "is deprecated" noise
@ 2005-08-07 18:07 Martin J. Bligh
2005-08-07 18:23 ` Adrian Bunk
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Martin J. Bligh @ 2005-08-07 18:07 UTC (permalink / raw)
To: linux-kernel
I'm getting lots of errors like this nowadays:
drivers/serial/8250.c:2651: warning: `register_serial' is deprecated
(declared at drivers/serial/8250.c:2607)
Which is just: "EXPORT_SYMBOL(register_serial);"
Sorry, but that's just compile-time noise, not anything useful.
Warning on real usages of it might be handy (we can go fix the users)
but not EXPORT_SYMBOL - we can't kill the export until the function
goes away. The more noise we have, the harder it is to see real errors
and warnings.
I took a quick poke around, but can't see what generates this stuff.
What is doing these checks, and can we please make an exception for
EXPORT_SYMBOL (and EXPORT_SYMBOL_GPL) somehow?
M.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 18:07 EXPORT_SYMBOL generates "is deprecated" noise Martin J. Bligh @ 2005-08-07 18:23 ` Adrian Bunk 2005-08-07 18:55 ` Martin J. Bligh 2005-08-07 18:26 ` Martin J. Bligh 2005-08-07 19:15 ` Russell King 2 siblings, 1 reply; 9+ messages in thread From: Adrian Bunk @ 2005-08-07 18:23 UTC (permalink / raw) To: Martin J. Bligh; +Cc: linux-kernel On Sun, Aug 07, 2005 at 11:07:59AM -0700, Martin J. Bligh wrote: > I'm getting lots of errors like this nowadays: > > drivers/serial/8250.c:2651: warning: `register_serial' is deprecated > (declared at drivers/serial/8250.c:2607) > > Which is just: "EXPORT_SYMBOL(register_serial);" > > Sorry, but that's just compile-time noise, not anything useful. > Warning on real usages of it might be handy (we can go fix the users) > but not EXPORT_SYMBOL - we can't kill the export until the function > goes away. The more noise we have, the harder it is to see real errors > and warnings. > > I took a quick poke around, but can't see what generates this stuff. > What is doing these checks, and can we please make an exception for > EXPORT_SYMBOL (and EXPORT_SYMBOL_GPL) somehow? This is generated by the __deprecated marker (#define'd to __attribute__((deprecated)) ) at the prototype in include/linux/serial.h. You could somehow #ifdef the warning away, but IMHO this would be more ugly than living with the warning until the last user is gone. > M. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 18:23 ` Adrian Bunk @ 2005-08-07 18:55 ` Martin J. Bligh 2005-08-07 19:06 ` Adrian Bunk 0 siblings, 1 reply; 9+ messages in thread From: Martin J. Bligh @ 2005-08-07 18:55 UTC (permalink / raw) To: Adrian Bunk; +Cc: linux-kernel --Adrian Bunk <bunk@stusta.de> wrote (on Sunday, August 07, 2005 20:23:12 +0200): > On Sun, Aug 07, 2005 at 11:07:59AM -0700, Martin J. Bligh wrote: >> I'm getting lots of errors like this nowadays: >> >> drivers/serial/8250.c:2651: warning: `register_serial' is deprecated >> (declared at drivers/serial/8250.c:2607) >> >> Which is just: "EXPORT_SYMBOL(register_serial);" >> >> Sorry, but that's just compile-time noise, not anything useful. >> Warning on real usages of it might be handy (we can go fix the users) >> but not EXPORT_SYMBOL - we can't kill the export until the function >> goes away. The more noise we have, the harder it is to see real errors >> and warnings. >> >> I took a quick poke around, but can't see what generates this stuff. >> What is doing these checks, and can we please make an exception for >> EXPORT_SYMBOL (and EXPORT_SYMBOL_GPL) somehow? > > This is generated by the __deprecated marker (#define'd to > __attribute__((deprecated)) ) at the prototype in > include/linux/serial.h. > > You could somehow #ifdef the warning away, but IMHO this would be more > ugly than living with the warning until the last user is gone. If it's going to spout crap when I'm not even using the deprecated function, it's worse than useless, I'm afraid. I tried some "smart" nested definitions to just wrap it inside EXPORT_SYMBOL, but the ordering of evaluation is all wrong. Bah ;-( M. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 18:55 ` Martin J. Bligh @ 2005-08-07 19:06 ` Adrian Bunk 2005-08-07 19:13 ` Martin J. Bligh 0 siblings, 1 reply; 9+ messages in thread From: Adrian Bunk @ 2005-08-07 19:06 UTC (permalink / raw) To: Martin J. Bligh; +Cc: linux-kernel On Sun, Aug 07, 2005 at 11:55:16AM -0700, Martin J. Bligh wrote: > > > --Adrian Bunk <bunk@stusta.de> wrote (on Sunday, August 07, 2005 20:23:12 +0200): > > > On Sun, Aug 07, 2005 at 11:07:59AM -0700, Martin J. Bligh wrote: > >> I'm getting lots of errors like this nowadays: > >> > >> drivers/serial/8250.c:2651: warning: `register_serial' is deprecated > >> (declared at drivers/serial/8250.c:2607) > >> > >> Which is just: "EXPORT_SYMBOL(register_serial);" > >> > >> Sorry, but that's just compile-time noise, not anything useful. > >> Warning on real usages of it might be handy (we can go fix the users) > >> but not EXPORT_SYMBOL - we can't kill the export until the function > >> goes away. The more noise we have, the harder it is to see real errors > >> and warnings. > >> > >> I took a quick poke around, but can't see what generates this stuff. > >> What is doing these checks, and can we please make an exception for > >> EXPORT_SYMBOL (and EXPORT_SYMBOL_GPL) somehow? > > > > This is generated by the __deprecated marker (#define'd to > > __attribute__((deprecated)) ) at the prototype in > > include/linux/serial.h. > > > > You could somehow #ifdef the warning away, but IMHO this would be more > > ugly than living with the warning until the last user is gone. > > If it's going to spout crap when I'm not even using the deprecated > function, it's worse than useless, I'm afraid. >... It's reminding us that we are still offering a deprecated function. ;-) > M. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 19:06 ` Adrian Bunk @ 2005-08-07 19:13 ` Martin J. Bligh 0 siblings, 0 replies; 9+ messages in thread From: Martin J. Bligh @ 2005-08-07 19:13 UTC (permalink / raw) To: Adrian Bunk; +Cc: linux-kernel >> If it's going to spout crap when I'm not even using the deprecated >> function, it's worse than useless, I'm afraid. >> ... > > It's reminding us that we are still offering a deprecated function. ;-) Might be useful as an option. But not to irritate every poor sod who does a kernel compile, ever. M. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 18:07 EXPORT_SYMBOL generates "is deprecated" noise Martin J. Bligh 2005-08-07 18:23 ` Adrian Bunk @ 2005-08-07 18:26 ` Martin J. Bligh 2005-08-08 13:46 ` Arnd Bergmann 2005-08-07 19:15 ` Russell King 2 siblings, 1 reply; 9+ messages in thread From: Martin J. Bligh @ 2005-08-07 18:26 UTC (permalink / raw) To: linux-kernel --"Martin J. Bligh" <mbligh@mbligh.org> wrote (on Sunday, August 07, 2005 11:07:59 -0700): > I'm getting lots of errors like this nowadays: > > drivers/serial/8250.c:2651: warning: `register_serial' is deprecated > (declared at drivers/serial/8250.c:2607) > > Which is just: "EXPORT_SYMBOL(register_serial);" > > Sorry, but that's just compile-time noise, not anything useful. > Warning on real usages of it might be handy (we can go fix the users) > but not EXPORT_SYMBOL - we can't kill the export until the function > goes away. The more noise we have, the harder it is to see real errors > and warnings. > > I took a quick poke around, but can't see what generates this stuff. > What is doing these checks, and can we please make an exception for > EXPORT_SYMBOL (and EXPORT_SYMBOL_GPL) somehow? Oh, I'm being an idiot and looking at the wrong tree. It's __deprecated, but I still can't think of a clean way to locally undefine that for just EXPORT_SYMBOL. M. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 18:26 ` Martin J. Bligh @ 2005-08-08 13:46 ` Arnd Bergmann 0 siblings, 0 replies; 9+ messages in thread From: Arnd Bergmann @ 2005-08-08 13:46 UTC (permalink / raw) To: Martin J. Bligh; +Cc: linux-kernel On Sünndag 07 August 2005 20:26, Martin J. Bligh wrote: > Oh, I'm being an idiot and looking at the wrong tree. It's __deprecated, > but I still can't think of a clean way to locally undefine that for > just EXPORT_SYMBOL. We could in theory create a new EXPORT_SYMBOL variant that does not reference the symbol directly. This does a little less compile-time checks but helps reduce the noise. The big advantage of this would be that we could once again build kernels with -Werror on developer machines. Signed-off-by: Arnd Bergmann <arnd@arndb.de> diff --git a/include/linux/module.h b/include/linux/module.h --- a/include/linux/module.h +++ b/include/linux/module.h @@ -182,21 +182,26 @@ void *__symbol_get_gpl(const char *symbo #endif /* For every exported symbol, place a struct in the __ksymtab section */ -#define __EXPORT_SYMBOL(sym, sec) \ - __CRC_SYMBOL(sym, sec) \ - static const char __kstrtab_##sym[] \ +#define __EXPORT_SYMBOL(name, sym, sec) \ + __CRC_SYMBOL(name, sec) \ + static const char __kstrtab_##name[] \ __attribute__((section("__ksymtab_strings"))) \ - = MODULE_SYMBOL_PREFIX #sym; \ - static const struct kernel_symbol __ksymtab_##sym \ + = MODULE_SYMBOL_PREFIX #name; \ + static const struct kernel_symbol __ksymtab_##name \ __attribute_used__ \ __attribute__((section("__ksymtab" sec), unused)) \ - = { (unsigned long)&sym, __kstrtab_##sym } + = { (unsigned long)&sym, __kstrtab_##name } #define EXPORT_SYMBOL(sym) \ - __EXPORT_SYMBOL(sym, "") + __EXPORT_SYMBOL(sym, sym, "") #define EXPORT_SYMBOL_GPL(sym) \ - __EXPORT_SYMBOL(sym, "_gpl") + __EXPORT_SYMBOL(sym, sym, "_gpl") + +#define EXPORT_DEPRECATED_SYMBOL(sym) \ + extern void __deprecated_ ## sym \ + __attribute__((alias(#sym))); \ + __EXPORT_SYMBOL(sym, __deprecated_ ## sym, "_gpl") #endif ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 18:07 EXPORT_SYMBOL generates "is deprecated" noise Martin J. Bligh 2005-08-07 18:23 ` Adrian Bunk 2005-08-07 18:26 ` Martin J. Bligh @ 2005-08-07 19:15 ` Russell King 2005-08-08 6:28 ` Denis Vlasenko 2 siblings, 1 reply; 9+ messages in thread From: Russell King @ 2005-08-07 19:15 UTC (permalink / raw) To: Martin J. Bligh; +Cc: linux-kernel On Sun, Aug 07, 2005 at 11:07:59AM -0700, Martin J. Bligh wrote: > I'm getting lots of errors like this nowadays: > > drivers/serial/8250.c:2651: warning: `register_serial' is deprecated > (declared at drivers/serial/8250.c:2607) > > Which is just: "EXPORT_SYMBOL(register_serial);" > > Sorry, but that's just compile-time noise, not anything useful. > Warning on real usages of it might be handy (we can go fix the users) > but not EXPORT_SYMBOL - we can't kill the export until the function > goes away. The more noise we have, the harder it is to see real errors > and warnings. I don't know why I bother with __deprecated - I haven't seen much evidence of the users of these functions being cleaned up, so I think we might as well just delete the functions and _force_ people to fix their code. That unfortunately seems to be the only way to get things done in this day and age, which is rather sad if that's what it takes to kick people into action. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 Serial core ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: EXPORT_SYMBOL generates "is deprecated" noise 2005-08-07 19:15 ` Russell King @ 2005-08-08 6:28 ` Denis Vlasenko 0 siblings, 0 replies; 9+ messages in thread From: Denis Vlasenko @ 2005-08-08 6:28 UTC (permalink / raw) To: Russell King, Martin J. Bligh; +Cc: linux-kernel On Sunday 07 August 2005 22:15, Russell King wrote: > On Sun, Aug 07, 2005 at 11:07:59AM -0700, Martin J. Bligh wrote: > > I'm getting lots of errors like this nowadays: > > > > drivers/serial/8250.c:2651: warning: `register_serial' is deprecated > > (declared at drivers/serial/8250.c:2607) > > > > Which is just: "EXPORT_SYMBOL(register_serial);" > > > > Sorry, but that's just compile-time noise, not anything useful. > > Warning on real usages of it might be handy (we can go fix the users) > > but not EXPORT_SYMBOL - we can't kill the export until the function > > goes away. The more noise we have, the harder it is to see real errors > > and warnings. > > I don't know why I bother with __deprecated - I haven't seen much > evidence of the users of these functions being cleaned up, so I > think we might as well just delete the functions and _force_ people > to fix their code. That unfortunately seems to be the only way to > get things done in this day and age, which is rather sad if that's > what it takes to kick people into action. Was it ever different? -- vda ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-08-08 13:52 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-08-07 18:07 EXPORT_SYMBOL generates "is deprecated" noise Martin J. Bligh 2005-08-07 18:23 ` Adrian Bunk 2005-08-07 18:55 ` Martin J. Bligh 2005-08-07 19:06 ` Adrian Bunk 2005-08-07 19:13 ` Martin J. Bligh 2005-08-07 18:26 ` Martin J. Bligh 2005-08-08 13:46 ` Arnd Bergmann 2005-08-07 19:15 ` Russell King 2005-08-08 6:28 ` Denis Vlasenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox