Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 40dc5651 authored by Jesper Juhl's avatar Jesper Juhl Committed by Linus Torvalds
Browse files

[PATCH] cleanup for kernel/printk.c



- Removes some trailing whitespace

- Breaks long lines and make other small changes to conform to CodingStyle

- Add explicit printk loglevels in two places.

Signed-off-by: default avatarJesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 2a91f3e5
Loading
Loading
Loading
Loading
+42 −36
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ static int __init log_buf_len_setup(char *str)

		new_log_buf = alloc_bootmem(size);
		if (!new_log_buf) {
			printk("log_buf_len: allocation failed\n");
			printk(KERN_WARNING "log_buf_len: allocation failed\n");
			goto out;
		}

@@ -193,10 +193,9 @@ static int __init log_buf_len_setup(char *str)
		log_end -= offset;
		spin_unlock_irqrestore(&logbuf_lock, flags);

		printk("log_buf_len: %d\n", log_buf_len);
		printk(KERN_NOTICE "log_buf_len: %d\n", log_buf_len);
	}
out:

	return 1;
}

@@ -244,7 +243,8 @@ int do_syslog(int type, char __user * buf, int len)
			error = -EFAULT;
			goto out;
		}
		error = wait_event_interruptible(log_wait, (log_start - log_end));
		error = wait_event_interruptible(log_wait,
							(log_start - log_end));
		if (error)
			goto out;
		i = 0;
@@ -404,21 +404,19 @@ static void call_console_drivers(unsigned long start, unsigned long end)
	cur_index = start;
	start_print = start;
	while (cur_index != end) {
		if (	msg_level < 0 &&
			((end - cur_index) > 2) &&
		if (msg_level < 0 && ((end - cur_index) > 2) &&
				LOG_BUF(cur_index + 0) == '<' &&
				LOG_BUF(cur_index + 1) >= '0' &&
				LOG_BUF(cur_index + 1) <= '7' &&
			LOG_BUF(cur_index + 2) == '>')
		{
				LOG_BUF(cur_index + 2) == '>') {
			msg_level = LOG_BUF(cur_index + 1) - '0';
			cur_index += 3;
			start_print = cur_index;
		}
		while (cur_index != end) {
			char c = LOG_BUF(cur_index);
			cur_index++;

			cur_index++;
			if (c == '\n') {
				if (msg_level < 0) {
					/*
@@ -644,8 +642,14 @@ asmlinkage long sys_syslog(int type, char __user * buf, int len)
	return 0;
}

int do_syslog(int type, char __user * buf, int len) { return 0; }
static void call_console_drivers(unsigned long start, unsigned long end) {}
int do_syslog(int type, char __user *buf, int len)
{
	return 0;
}

static void call_console_drivers(unsigned long start, unsigned long end)
{
}

#endif

@@ -878,7 +882,8 @@ void register_console(struct console * console)
	 *	See if this console matches one we selected on
	 *	the command line.
	 */
	for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) {
	for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0];
			i++) {
		if (strcmp(console_cmdline[i].name, console->name) != 0)
			continue;
		if (console->index >= 0 &&
@@ -1007,6 +1012,7 @@ int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst)
		toks = ratelimit_burst * ratelimit_jiffies;
	if (toks >= ratelimit_jiffies) {
		int lost = missed;

		missed = 0;
		toks -= ratelimit_jiffies;
		spin_unlock_irqrestore(&ratelimit_lock, flags);