CONFIG_EMBEDDED and !CONFIG_PRINTK: remove WARN_ON and print_symbol strings
PATCH 1/1 CONFIG_EMBEDDED and !CONFIG_PRINTK: remove WARN_ON and print_symbol strings
Reduces text a bit.
Signed-off-by Joe Perches <[email protected]>
--- include/asm-generic/bug.h | 11 +++++++++++ include/linux/kallsyms.h | 4 ++++ kernel/panic.c | 6 ++++++ 3 files changed, 21 insertions(+), 0 deletions(-)
include/asm-generic/bug.h +11 -0
@@ -61,12 +61,23 @@ struct bug_entry {*/ #ifndef __WARN_TAINT#ifndef __ASSEMBLY__ + +#ifdef CONFIG_PRINTK extern void warn_slowpath_fmt (const char *file,const int line,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));extern void warn_slowpath_fmt_taint (const char *file,const int line,unsigned taint,const char *fmt, ...) __attribute__((format (printf,4 ,5 )));extern void warn_slowpath_null (const char *file,const int line); +#else +static inline void __attribute__((format (printf,3 ,4 ))) +warn_slowpath_fmt (const char *file,const int line,const char *fmt, ...) {} +static inline void __attribute__((format (printf,4 ,5 ))) +warn_slowpath_fmt_taint (const char *file,const int line, +unsigned taint,const char *fmt, ...) {} +static inline void warn_slowpath_null (const char *file,const int line) {} +#endif +#define WANT_WARN_ON_SLOWPATH #endif #define __WARN () warn_slowpath_null(__FILE__, __LINE__)
include/linux/kallsyms.h +4 -0
@@ -100,12 +100,16 @@ static inline void __check_printsym_format(const char *fmt, ...) { } +#ifdef CONFIG_PRINTK static inline void print_symbol (const char *fmt,unsigned long addr) {__check_printsym_format (fmt,"" );__print_symbol (fmt, (unsigned long )__builtin_extract_return_addr ((void *)addr)); } +#else +static inline void print_symbol (const char *fmt,unsigned long addr) {} +#endif static inline void print_ip_sym (unsigned long ip) {
kernel/panic.c +6 -0
@@ -357,6 +357,9 @@ void oops_exit(void) } #ifdef WANT_WARN_ON_SLOWPATH + +#ifdef CONFIG_PRINTK + struct slowpath_args { const char *fmt; va_list args;
@@ -413,6 +416,9 @@ void warn_slowpath_null(const char *file, int line) TAINT_WARN, NULL); }EXPORT_SYMBOL (warn_slowpath_null); + +#endif +#endif #ifdef CONFIG_CC_STACKPROTECTOR
Quoted 1 line · Joe Perches
Reduces text a bit.
Looks good to me.
Acked-by Matt Mackall <[email protected]>
Quoted 87 lines
Signed-off-by Joe Perches <[email protected]>--- include/asm-generic/bug.h | 11 +++++++++++ include/linux/kallsyms.h | 4 ++++ kernel/panic.c | 6 ++++++ 3 files changed, 21 insertions(+), 0 deletions(-)include/asm-generic/bug.h +11
-0@@ -61,12 +61,23 @@ struct bug_entry {*/ #ifndef __WARN_TAINT#ifndef __ASSEMBLY__ + +#ifdef CONFIG_PRINTK extern void warn_slowpath_fmt (const char *file,const int line,const char *fmt, ...) __attribute__((format (printf,3 ,4 )));extern void warn_slowpath_fmt_taint (const char *file,const int line,unsigned taint,const char *fmt, ...) __attribute__((format (printf,4 ,5 )));extern void warn_slowpath_null (const char *file,const int line); +#else +static inline void __attribute__((format (printf,3 ,4 ))) +warn_slowpath_fmt (const char *file,const int line,const char *fmt, ...) {} +static inline void __attribute__((format (printf,4 ,5 ))) +warn_slowpath_fmt_taint (const char *file,const int line, +unsigned taint,const char *fmt, ...) {} +static inline void warn_slowpath_null (const char *file,const int line) {} +#endif +#define WANT_WARN_ON_SLOWPATH #endif #define __WARN () warn_slowpath_null(__FILE__, __LINE__)include/linux/kallsyms.h +4
-0@@ -100,12 +100,16 @@ static inline void __check_printsym_format(const char *fmt, ...) { } +#ifdef CONFIG_PRINTK static inline void print_symbol (const char *fmt,unsigned long addr) {__check_printsym_format (fmt,"" );__print_symbol (fmt, (unsigned long )__builtin_extract_return_addr ((void *)addr)); } +#else +static inline void print_symbol (const char *fmt,unsigned long addr) {} +#endif static inline void print_ip_sym (unsigned long ip) {kernel/panic.c +6
-1@@ -357,6 +357,9 @@ void oops_exit(void) } #ifdef WANT_WARN_ON_SLOWPATH + +#ifdef CONFIG_PRINTK + struct slowpath_args { const char *fmt; va_list args;@@ -413,6 +416,9 @@ void warn_slowpath_null(const char *file, int line) TAINT_WARN, NULL); }EXPORT_SYMBOL (warn_slowpath_null); + +#endif +#endif #ifdef CONFIG_CC_STACKPROTECTOR --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 1 line
Mathematics is the supreme nostalgia of our time.