]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
printk: rename and move 2 #defines to printk_log.h
authorJoe Perches <joe@perches.com>
Tue, 23 Oct 2012 02:50:22 +0000 (13:50 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 24 Oct 2012 03:20:16 +0000 (14:20 +1100)
Rename the LOG_LINE_MAX and PREFIX_MAX #defines with PRINTK_ prefixes.
Move the defines to printk_log.h
Remove duplicate define too.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Kay Sievers <kay@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/printk/printk.c
kernel/printk/printk_log.h

index bdfa61ee93e1a166c1bdfd8e6281c2da7ff896b6..e7cb51ff36e6a133f3fcb0c240e282060f9b9959 100644 (file)
@@ -139,9 +139,6 @@ static u64 console_seq;
 static u32 console_idx;
 static enum printk_log_flags console_prev;
 
-#define PREFIX_MAX             32
-#define LOG_LINE_MAX           1024 - PREFIX_MAX
-
 /* cpu currently holding printk_logbuf_lock */
 static volatile unsigned int logbuf_cpu = UINT_MAX;
 
@@ -164,7 +161,7 @@ static ssize_t devkmsg_writev(struct kiocb *iocb, const struct iovec *iv,
        size_t len = iov_length(iv, count);
        ssize_t ret = len;
 
-       if (len > LOG_LINE_MAX)
+       if (len > PRINTK_LOG_LINE_MAX)
                return -EINVAL;
        buf = kmalloc(len+1, GFP_KERNEL);
        if (buf == NULL)
@@ -727,7 +724,7 @@ static int syslog_print(char __user *buf, int size)
        struct printk_log *msg;
        int len = 0;
 
-       text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL);
+       text = kmalloc(PRINTK_LOG_LINE_MAX + PRINTK_PREFIX_MAX, GFP_KERNEL);
        if (!text)
                return -ENOMEM;
 
@@ -751,7 +748,7 @@ static int syslog_print(char __user *buf, int size)
                skip = syslog_partial;
                msg = printk_log_from_idx(syslog_idx);
                n = msg_print_text(msg, syslog_prev, true, text,
-                                  LOG_LINE_MAX + PREFIX_MAX);
+                                  PRINTK_LOG_LINE_MAX + PRINTK_PREFIX_MAX);
                if (n - syslog_partial <= size) {
                        /* message fits into buffer, move forward */
                        syslog_idx = printk_log_next(syslog_idx);
@@ -790,7 +787,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear)
        char *text;
        int len = 0;
 
-       text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL);
+       text = kmalloc(PRINTK_LOG_LINE_MAX + PRINTK_PREFIX_MAX, GFP_KERNEL);
        if (!text)
                return -ENOMEM;
 
@@ -846,7 +843,7 @@ static int syslog_print_all(char __user *buf, int size, bool clear)
                        int textlen;
 
                        textlen = msg_print_text(msg, prev, true, text,
-                                                LOG_LINE_MAX + PREFIX_MAX);
+                                                PRINTK_LOG_LINE_MAX + PRINTK_PREFIX_MAX);
                        if (textlen < 0) {
                                len = textlen;
                                break;
@@ -1166,7 +1163,7 @@ static inline void printk_delay(void)
  * reached the console in case of a kernel crash.
  */
 static struct cont {
-       char buf[LOG_LINE_MAX];
+       char buf[PRINTK_LOG_LINE_MAX];
        size_t len;                     /* length == 0 means unused buffer */
        size_t cons;                    /* bytes written to console */
        struct task_struct *owner;      /* task of first print*/
@@ -1268,7 +1265,7 @@ asmlinkage int vprintk_emit(int facility, int level,
                            const char *fmt, va_list args)
 {
        static int recursion_bug;
-       static char textbuf[LOG_LINE_MAX];
+       static char textbuf[PRINTK_LOG_LINE_MAX];
        char *text = textbuf;
        size_t text_len;
        enum printk_log_flags lflags = 0;
@@ -1471,9 +1468,8 @@ EXPORT_SYMBOL(printk);
 
 #else /* CONFIG_PRINTK */
 
-#define LOG_LINE_MAX           0
-#define PREFIX_MAX             0
-#define LOG_LINE_MAX 0
+#define PRINTK_LOG_LINE_MAX    0
+#define PRINTK_PREFIX_MAX              0
 static u64 syslog_seq;
 static u32 syslog_idx;
 static u64 console_seq;
@@ -1801,7 +1797,7 @@ out:
  */
 void console_unlock(void)
 {
-       static char text[LOG_LINE_MAX + PREFIX_MAX];
+       static char text[PRINTK_LOG_LINE_MAX + PRINTK_PREFIX_MAX];
        static u64 seen_seq;
        unsigned long flags;
        bool wake_klogd = false;
index e846f1d8fd8f6861abe95b3e3dbae5141f70bb3a..a7125d547c0391734fa3f40d75e1aecae45b1dc8 100644 (file)
@@ -92,6 +92,9 @@ struct printk_log {
 #endif
 #define __PRINTK_LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)
 
+#define PRINTK_PREFIX_MAX      32
+#define PRINTK_LOG_LINE_MAX    (1024 - PRINTK_PREFIX_MAX)
+
 extern raw_spinlock_t printk_logbuf_lock;
 extern wait_queue_head_t printk_log_wait;
 extern u64 printk_log_first_seq;