Merge tag 'fbdev-v5.1' of git://github.com/bzolnier/linux
[sfrench/cifs-2.6.git] / kernel / printk / printk.c
index b4d26388bc6248e6693e03f15baa116055da0991..02ca827b8fac7f110535ba5d6aca8f1c87306def 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/delay.h>
 #include <linux/smp.h>
 #include <linux/security.h>
-#include <linux/bootmem.h>
 #include <linux/memblock.h>
 #include <linux/syscalls.h>
 #include <linux/crash_core.h>
@@ -66,6 +65,7 @@ int console_printk[4] = {
        CONSOLE_LOGLEVEL_MIN,           /* minimum_console_loglevel */
        CONSOLE_LOGLEVEL_DEFAULT,       /* default_console_loglevel */
 };
+EXPORT_SYMBOL_GPL(console_printk);
 
 atomic_t ignore_console_lock_warning __read_mostly = ATOMIC_INIT(0);
 EXPORT_SYMBOL(ignore_console_lock_warning);
@@ -345,7 +345,6 @@ static int console_msg_format = MSG_FORMAT_DEFAULT;
 
 enum log_flags {
        LOG_NEWLINE     = 2,    /* text ended with a newline */
-       LOG_PREFIX      = 4,    /* text started with a prefix */
        LOG_CONT        = 8,    /* text is a fragment of a continuation line */
 };
 
@@ -1145,14 +1144,7 @@ void __init setup_log_buf(int early)
        if (!new_log_buf_len)
                return;
 
-       if (early) {
-               new_log_buf =
-                       memblock_virt_alloc(new_log_buf_len, LOG_ALIGN);
-       } else {
-               new_log_buf = memblock_virt_alloc_nopanic(new_log_buf_len,
-                                                         LOG_ALIGN);
-       }
-
+       new_log_buf = memblock_alloc(new_log_buf_len, LOG_ALIGN);
        if (unlikely(!new_log_buf)) {
                pr_err("log_buf_len: %lu bytes not available\n",
                        new_log_buf_len);
@@ -1511,7 +1503,7 @@ int do_syslog(int type, char __user *buf, int len, int source)
                        return -EINVAL;
                if (!len)
                        return 0;
-               if (!access_ok(VERIFY_WRITE, buf, len))
+               if (!access_ok(buf, len))
                        return -EFAULT;
                error = wait_event_interruptible(log_wait,
                                                 syslog_seq != log_next_seq);
@@ -1529,7 +1521,7 @@ int do_syslog(int type, char __user *buf, int len, int source)
                        return -EINVAL;
                if (!len)
                        return 0;
-               if (!access_ok(VERIFY_WRITE, buf, len))
+               if (!access_ok(buf, len))
                        return -EFAULT;
                error = syslog_print_all(buf, len, clear);
                break;
@@ -1922,9 +1914,6 @@ int vprintk_store(int facility, int level,
                        case '0' ... '7':
                                if (level == LOGLEVEL_DEFAULT)
                                        level = kern_level - '0';
-                               /* fallthrough */
-                       case 'd':       /* KERN_DEFAULT */
-                               lflags |= LOG_PREFIX;
                                break;
                        case 'c':       /* KERN_CONT */
                                lflags |= LOG_CONT;
@@ -1939,7 +1928,7 @@ int vprintk_store(int facility, int level,
                level = default_message_loglevel;
 
        if (dict)
-               lflags |= LOG_PREFIX|LOG_NEWLINE;
+               lflags |= LOG_NEWLINE;
 
        return log_output(facility, level, lflags,
                          dict, dictlen, text, text_len);