OSDN Git Service

deprecate the '__deprecated' attribute warnings entirely and for good
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Aug 2018 19:19:56 +0000 (12:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Aug 2018 19:19:56 +0000 (12:19 -0700)
We haven't had lots of deprecation warnings lately, but the rdma use of
it made them flare up again.

They are not useful.  They annoy everybody, and nobody ever does
anything about them, because it's always "somebody elses problem".  And
when people start thinking that warnings are normal, they stop looking
at them, and the real warnings that mean something go unnoticed.

If you want to get rid of a function, just get rid of it.  Convert every
user to the new world order.

And if you can't do that, then don't annoy everybody else with your
marking that says "I couldn't be bothered to fix this, so I'll just spam
everybody elses build logs with warnings about my laziness".

Make a kernelnewbies wiki page about things that could be cleaned up,
write a blog post about it, or talk to people on the mailing lists.  But
don't add warnings to the kernel build about cleanup that you think
should happen but you aren't doing yourself.

Don't.  Just don't.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/compiler-gcc.h
include/linux/compiler_types.h
lib/Kconfig.debug

index 573f5a7..3e70b7d 100644 (file)
 #define __always_inline        inline __attribute__((always_inline))
 #define  noinline      __attribute__((noinline))
 
 #define __always_inline        inline __attribute__((always_inline))
 #define  noinline      __attribute__((noinline))
 
-#define __deprecated   __attribute__((deprecated))
 #define __packed       __attribute__((packed))
 #define __weak         __attribute__((weak))
 #define __alias(symbol)        __attribute__((alias(#symbol)))
 #define __packed       __attribute__((packed))
 #define __weak         __attribute__((weak))
 #define __alias(symbol)        __attribute__((alias(#symbol)))
index a8ba6b0..fbf3379 100644 (file)
@@ -111,21 +111,10 @@ struct ftrace_likely_data {
 #endif /* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
 #endif /* __ASSEMBLY__ */
 
 #ifdef __KERNEL__
-/*
- * Allow us to mark functions as 'deprecated' and have gcc emit a nice
- * warning for each use, in hopes of speeding the functions removal.
- * Usage is:
- *             int __deprecated foo(void)
- */
-#ifndef __deprecated
-# define __deprecated          /* unimplemented */
-#endif
 
 
-#ifdef MODULE
-#define __deprecated_for_modules __deprecated
-#else
+/* Don't. Just don't. */
+#define __deprecated
 #define __deprecated_for_modules
 #define __deprecated_for_modules
-#endif
 
 #ifndef __must_check
 #define __must_check
 
 #ifndef __must_check
 #define __must_check
@@ -135,12 +124,6 @@ struct ftrace_likely_data {
 #undef __must_check
 #define __must_check
 #endif
 #undef __must_check
 #define __must_check
 #endif
-#ifndef CONFIG_ENABLE_WARN_DEPRECATED
-#undef __deprecated
-#undef __deprecated_for_modules
-#define __deprecated
-#define __deprecated_for_modules
-#endif
 
 #ifndef __malloc
 #define __malloc
 
 #ifndef __malloc
 #define __malloc
index c6e7390..ab1b599 100644 (file)
@@ -211,14 +211,6 @@ config GDB_SCRIPTS
          instance. See Documentation/dev-tools/gdb-kernel-debugging.rst
          for further details.
 
          instance. See Documentation/dev-tools/gdb-kernel-debugging.rst
          for further details.
 
-config ENABLE_WARN_DEPRECATED
-       bool "Enable __deprecated logic"
-       default y
-       help
-         Enable the __deprecated logic in the kernel build.
-         Disable this to suppress the "warning: 'foo' is deprecated
-         (declared at kernel/power/somefile.c:1234)" messages.
-
 config ENABLE_MUST_CHECK
        bool "Enable __must_check logic"
        default y
 config ENABLE_MUST_CHECK
        bool "Enable __must_check logic"
        default y