@@ -141,18 +141,6 @@ static inline __printf(1, 2) __cold
141141void early_printk (const char * s , ...) { }
142142#endif
143143
144- #ifdef CONFIG_PRINTK_NMI
145- extern void printk_nmi_enter (void );
146- extern void printk_nmi_exit (void );
147- extern void printk_nmi_direct_enter (void );
148- extern void printk_nmi_direct_exit (void );
149- #else
150- static inline void printk_nmi_enter (void ) { }
151- static inline void printk_nmi_exit (void ) { }
152- static inline void printk_nmi_direct_enter (void ) { }
153- static inline void printk_nmi_direct_exit (void ) { }
154- #endif /* PRINTK_NMI */
155-
156144struct dev_printk_info ;
157145
158146#ifdef CONFIG_PRINTK
@@ -172,6 +160,16 @@ int _printk(const char *fmt, ...);
172160 */
173161__printf (1 , 2 ) __cold int _printk_deferred (const char * fmt , ...);
174162
163+ extern void __printk_safe_enter (void );
164+ extern void __printk_safe_exit (void );
165+ /*
166+ * The printk_deferred_enter/exit macros are available only as a hack for
167+ * some code paths that need to defer all printk console printing. Interrupts
168+ * must be disabled for the deferred duration.
169+ */
170+ #define printk_deferred_enter __printk_safe_enter
171+ #define printk_deferred_exit __printk_safe_exit
172+
175173/*
176174 * Please don't use printk_ratelimit(), because it shares ratelimiting state
177175 * with all other unrelated printk_ratelimit() callsites. Instead use
@@ -200,8 +198,6 @@ void dump_stack_print_info(const char *log_lvl);
200198void show_regs_print_info (const char * log_lvl );
201199extern asmlinkage void dump_stack_lvl (const char * log_lvl ) __cold ;
202200extern asmlinkage void dump_stack (void ) __cold ;
203- extern void printk_safe_flush (void );
204- extern void printk_safe_flush_on_panic (void );
205201#else
206202static inline __printf (1 , 0 )
207203int vprintk (const char * s , va_list args )
@@ -218,6 +214,15 @@ int _printk_deferred(const char *s, ...)
218214{
219215 return 0 ;
220216}
217+
218+ static inline void printk_deferred_enter (void )
219+ {
220+ }
221+
222+ static inline void printk_deferred_exit (void )
223+ {
224+ }
225+
221226static inline int printk_ratelimit (void )
222227{
223228 return 0 ;
@@ -269,14 +274,6 @@ static inline void dump_stack_lvl(const char *log_lvl)
269274static inline void dump_stack (void )
270275{
271276}
272-
273- static inline void printk_safe_flush (void )
274- {
275- }
276-
277- static inline void printk_safe_flush_on_panic (void )
278- {
279- }
280277#endif
281278
282279#ifdef CONFIG_SMP
0 commit comments