summaryrefslogtreecommitdiff
path: root/include/linux/printk.h
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2021-08-30 16:36:10 +0200
committerPetr Mladek <pmladek@suse.com>2021-08-30 16:36:10 +0200
commitc985aafb60e972c0a6b8d0bd65e03af5890b748a (patch)
treefb75c6e5330663eeaff707dee672762e607e2f0b /include/linux/printk.h
parent715d3edb79c6c2b68dedf348b0aa96e61f360292 (diff)
parent26d1982fd17c2cac77f9cf764255362ccb28fe49 (diff)
downloadlwn-c985aafb60e972c0a6b8d0bd65e03af5890b748a.tar.gz
lwn-c985aafb60e972c0a6b8d0bd65e03af5890b748a.zip
Merge branch 'rework/printk_safe-removal' into for-linus
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r--include/linux/printk.h41
1 files changed, 19 insertions, 22 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h
index da7a1de2257a..259af4f97f50 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -141,18 +141,6 @@ static inline __printf(1, 2) __cold
void early_printk(const char *s, ...) { }
#endif
-#ifdef CONFIG_PRINTK_NMI
-extern void printk_nmi_enter(void);
-extern void printk_nmi_exit(void);
-extern void printk_nmi_direct_enter(void);
-extern void printk_nmi_direct_exit(void);
-#else
-static inline void printk_nmi_enter(void) { }
-static inline void printk_nmi_exit(void) { }
-static inline void printk_nmi_direct_enter(void) { }
-static inline void printk_nmi_direct_exit(void) { }
-#endif /* PRINTK_NMI */
-
struct dev_printk_info;
#ifdef CONFIG_PRINTK
@@ -172,6 +160,16 @@ int _printk(const char *fmt, ...);
*/
__printf(1, 2) __cold int _printk_deferred(const char *fmt, ...);
+extern void __printk_safe_enter(void);
+extern void __printk_safe_exit(void);
+/*
+ * The printk_deferred_enter/exit macros are available only as a hack for
+ * some code paths that need to defer all printk console printing. Interrupts
+ * must be disabled for the deferred duration.
+ */
+#define printk_deferred_enter __printk_safe_enter
+#define printk_deferred_exit __printk_safe_exit
+
/*
* Please don't use printk_ratelimit(), because it shares ratelimiting state
* with all other unrelated printk_ratelimit() callsites. Instead use
@@ -200,8 +198,6 @@ void dump_stack_print_info(const char *log_lvl);
void show_regs_print_info(const char *log_lvl);
extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold;
extern asmlinkage void dump_stack(void) __cold;
-extern void printk_safe_flush(void);
-extern void printk_safe_flush_on_panic(void);
#else
static inline __printf(1, 0)
int vprintk(const char *s, va_list args)
@@ -218,6 +214,15 @@ int _printk_deferred(const char *s, ...)
{
return 0;
}
+
+static inline void printk_deferred_enter(void)
+{
+}
+
+static inline void printk_deferred_exit(void)
+{
+}
+
static inline int printk_ratelimit(void)
{
return 0;
@@ -269,14 +274,6 @@ static inline void dump_stack_lvl(const char *log_lvl)
static inline void dump_stack(void)
{
}
-
-static inline void printk_safe_flush(void)
-{
-}
-
-static inline void printk_safe_flush_on_panic(void)
-{
-}
#endif
#ifdef CONFIG_SMP