[lkml]   [2020]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH v1] printk: Declare log_wait as external variable
Static analyzer is not happy:

kernel/printk/printk.c:421:1: warning: symbol 'log_wait' was not declared. Should it be static?

This is due to usage of log_wait in the other module without announcing
its declaration to the world. I wasn't able to dug into deep history of
reasons why it is so, and thus decide to make less invasive change, i.e.
declaring log_wait as external variable to make static analyzer happy.

Note the above is done if and only if the CONFIG_PROC_FS is enabled,
otherwise we fallback to static variable.

Signed-off-by: Andy Shevchenko <>
kernel/printk/printk.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 633f41a11d75..43b5cb88c607 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -418,7 +418,14 @@ DEFINE_RAW_SPINLOCK(logbuf_lock);
} while (0)

+extern wait_queue_head_t log_wait; /* Used in fs/proc/kmsg.c */
+static DECLARE_WAIT_QUEUE_HEAD(log_wait);
+#endif /* CONFIG_PROC_FS */
/* the next printk record to read by syslog(READ) or /proc/kmsg */
static u64 syslog_seq;
static u32 syslog_idx;
 \ /
  Last update: 2020-02-03 14:17    [W:0.063 / U:3.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site