linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] sparse warning EXPORT_SYMBOL()'d symbol non-static
@ 2013-11-15  6:46 Wei Yongjun
  2013-11-24 19:49 ` Johannes Berg
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Yongjun @ 2013-11-15  6:46 UTC (permalink / raw)
  To: linux-sparse

After the following kernel commit, sparse warning lot of
EXPORT_SYMBOL()'d symbol non-static like this:

  CHECK   net/sctp/socket.c
net/sctp/socket.c:4292:1: warning:
 symbol '__ksymtab_sctp_do_peeloff' was not declared. Should it be static?


commit e0f244c63fc9d192dfd399cc2677bbdca61994b1
Author: Andi Kleen <ak@linux.intel.com>
Date:   Wed Oct 23 10:57:58 2013 +1030

    asmlinkage, module: Make ksymtab and kcrctab symbols and __this_module __visible
    
    Make the ksymtab symbols for EXPORT_SYMBOL visible.
    This prevents the LTO compiler from adding a .NUMBER prefix,
    which avoids various problems in later export processing.
    
    Cc: rusty@rustcorp.com.au
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

    Cc: rusty@rustcorp.com.au
    Signed-off-by: Andi Kleen <ak@linux.intel.com>
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/include/linux/export.h b/include/linux/export.h
index 412cd50..3f2793d 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -43,7 +43,7 @@ extern struct module __this_module;
 /* Mark the CRC weak since genksyms apparently decides not to
  * generate a checksums for some symbols */
 #define __CRC_SYMBOL(sym, sec)                                 \
-       extern void *__crc_##sym __attribute__((weak));         \
+       extern __visible void *__crc_##sym __attribute__((weak));               \
        static const unsigned long __kcrctab_##sym              \
        __used                                                  \
        __attribute__((section("___kcrctab" sec "+" #sym), unused))     \
@@ -59,7 +59,7 @@ extern struct module __this_module;
        static const char __kstrtab_##sym[]                     \
        __attribute__((section("__ksymtab_strings"), aligned(1))) \
        = VMLINUX_SYMBOL_STR(sym);                              \
-       static const struct kernel_symbol __ksymtab_##sym       \
+       __visible const struct kernel_symbol __ksymtab_##sym    \
        __used                                                  \
        __attribute__((section("___ksymtab" sec "+" #sym), unused))     \
        = { (unsigned long)&sym, __kstrtab_##sym }


Any idea?

Regards,
Yongjun Wei



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-11-24 22:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-15  6:46 [BUG] sparse warning EXPORT_SYMBOL()'d symbol non-static Wei Yongjun
2013-11-24 19:49 ` Johannes Berg
2013-11-24 20:28   ` Andi Kleen
2013-11-24 20:36     ` Johannes Berg
2013-11-24 20:45     ` Josh Triplett
2013-11-24 20:48       ` Johannes Berg
2013-11-24 20:52         ` Johannes Berg
2013-11-24 22:34           ` Josh Triplett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).