Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de488443 authored by Jeff Garzik's avatar Jeff Garzik Committed by Linus Torvalds
Browse files

Permit silencing of __deprecated warnings.



The __deprecated marker is quite useful in highlighting the remnants of
old APIs that want removing.

However, it is quite normal for one or more years to pass, before the
(usually ancient, bitrotten) code in question is either updated or
deleted.

Thus, like __must_check, add a Kconfig option that permits the silencing
of this compiler warning.

This change mimics the ifdef-ery and Kconfig defaults of MUST_CHECK as
closely as possible.

Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c67c36e4
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -101,6 +101,12 @@ extern void __chk_io_ptr(const volatile void __iomem *);
#undef __must_check
#undef __must_check
#define __must_check
#define __must_check
#endif
#endif
#ifndef CONFIG_ENABLE_WARN_DEPRECATED
#undef __deprecated
#undef __deprecated_for_modules
#define __deprecated
#define __deprecated_for_modules
#endif


/*
/*
 * Allow us to avoid 'defined but not used' warnings on functions and data,
 * Allow us to avoid 'defined but not used' warnings on functions and data,
+8 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,14 @@ config PRINTK_TIME
	  operations.  This is useful for identifying long delays
	  operations.  This is useful for identifying long delays
	  in kernel startup.
	  in kernel startup.


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
config ENABLE_MUST_CHECK
	bool "Enable __must_check logic"
	bool "Enable __must_check logic"
	default y
	default y