mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
[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: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
2a91f3e54f
commit
40dc565122
1 changed files with 42 additions and 36 deletions
|
@ -173,7 +173,7 @@ static int __init log_buf_len_setup(char *str)
|
||||||
|
|
||||||
new_log_buf = alloc_bootmem(size);
|
new_log_buf = alloc_bootmem(size);
|
||||||
if (!new_log_buf) {
|
if (!new_log_buf) {
|
||||||
printk("log_buf_len: allocation failed\n");
|
printk(KERN_WARNING "log_buf_len: allocation failed\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,10 +193,9 @@ static int __init log_buf_len_setup(char *str)
|
||||||
log_end -= offset;
|
log_end -= offset;
|
||||||
spin_unlock_irqrestore(&logbuf_lock, flags);
|
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:
|
out:
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +243,8 @@ int do_syslog(int type, char __user * buf, int len)
|
||||||
error = -EFAULT;
|
error = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
error = wait_event_interruptible(log_wait, (log_start - log_end));
|
error = wait_event_interruptible(log_wait,
|
||||||
|
(log_start - log_end));
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -404,21 +404,19 @@ static void call_console_drivers(unsigned long start, unsigned long end)
|
||||||
cur_index = start;
|
cur_index = start;
|
||||||
start_print = start;
|
start_print = start;
|
||||||
while (cur_index != end) {
|
while (cur_index != end) {
|
||||||
if ( msg_level < 0 &&
|
if (msg_level < 0 && ((end - cur_index) > 2) &&
|
||||||
((end - cur_index) > 2) &&
|
|
||||||
LOG_BUF(cur_index + 0) == '<' &&
|
LOG_BUF(cur_index + 0) == '<' &&
|
||||||
LOG_BUF(cur_index + 1) >= '0' &&
|
LOG_BUF(cur_index + 1) >= '0' &&
|
||||||
LOG_BUF(cur_index + 1) <= '7' &&
|
LOG_BUF(cur_index + 1) <= '7' &&
|
||||||
LOG_BUF(cur_index + 2) == '>')
|
LOG_BUF(cur_index + 2) == '>') {
|
||||||
{
|
|
||||||
msg_level = LOG_BUF(cur_index + 1) - '0';
|
msg_level = LOG_BUF(cur_index + 1) - '0';
|
||||||
cur_index += 3;
|
cur_index += 3;
|
||||||
start_print = cur_index;
|
start_print = cur_index;
|
||||||
}
|
}
|
||||||
while (cur_index != end) {
|
while (cur_index != end) {
|
||||||
char c = LOG_BUF(cur_index);
|
char c = LOG_BUF(cur_index);
|
||||||
cur_index++;
|
|
||||||
|
|
||||||
|
cur_index++;
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
if (msg_level < 0) {
|
if (msg_level < 0) {
|
||||||
/*
|
/*
|
||||||
|
@ -644,8 +642,14 @@ asmlinkage long sys_syslog(int type, char __user * buf, int len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int do_syslog(int type, char __user * buf, int len) { return 0; }
|
int do_syslog(int type, char __user *buf, int len)
|
||||||
static void call_console_drivers(unsigned long start, unsigned long end) {}
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void call_console_drivers(unsigned long start, unsigned long end)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -878,7 +882,8 @@ void register_console(struct console * console)
|
||||||
* See if this console matches one we selected on
|
* See if this console matches one we selected on
|
||||||
* the command line.
|
* 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)
|
if (strcmp(console_cmdline[i].name, console->name) != 0)
|
||||||
continue;
|
continue;
|
||||||
if (console->index >= 0 &&
|
if (console->index >= 0 &&
|
||||||
|
@ -1007,6 +1012,7 @@ int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst)
|
||||||
toks = ratelimit_burst * ratelimit_jiffies;
|
toks = ratelimit_burst * ratelimit_jiffies;
|
||||||
if (toks >= ratelimit_jiffies) {
|
if (toks >= ratelimit_jiffies) {
|
||||||
int lost = missed;
|
int lost = missed;
|
||||||
|
|
||||||
missed = 0;
|
missed = 0;
|
||||||
toks -= ratelimit_jiffies;
|
toks -= ratelimit_jiffies;
|
||||||
spin_unlock_irqrestore(&ratelimit_lock, flags);
|
spin_unlock_irqrestore(&ratelimit_lock, flags);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue