Commit a9c56953 authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds

use printk_once() in several places

There are some places to be able to use printk_once instead of hard coding.
Signed-off-by: default avatarMinchan Kim <minchan.kim@gmail.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 009789f0
...@@ -487,7 +487,6 @@ out: ...@@ -487,7 +487,6 @@ out:
static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
{ {
char *v = c->x86_vendor_id; char *v = c->x86_vendor_id;
static int printed;
int i; int i;
for (i = 0; i < X86_VENDOR_NUM; i++) { for (i = 0; i < X86_VENDOR_NUM; i++) {
...@@ -504,13 +503,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) ...@@ -504,13 +503,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
} }
} }
if (!printed) { printk_once(KERN_ERR
printed++; "CPU: vendor_id '%s' unknown, using generic init.\n" \
printk(KERN_ERR "CPU: Your system may be unstable.\n", v);
"CPU: vendor_id '%s' unknown, using generic init.\n", v);
printk(KERN_ERR "CPU: Your system may be unstable.\n");
}
c->x86_vendor = X86_VENDOR_UNKNOWN; c->x86_vendor = X86_VENDOR_UNKNOWN;
this_cpu = &default_cpu; this_cpu = &default_cpu;
......
...@@ -915,12 +915,9 @@ static int ds_ioctl(struct inode * inode, struct file * file, ...@@ -915,12 +915,9 @@ static int ds_ioctl(struct inode * inode, struct file * file,
err = -EPERM; err = -EPERM;
goto free_out; goto free_out;
} else { } else {
static int printed = 0; printk_once(KERN_WARNING
if (!printed) { "2.6. kernels use pcmciamtd instead of memory_cs.c and do not require special\n");
printk(KERN_WARNING "2.6. kernels use pcmciamtd instead of memory_cs.c and do not require special\n"); printk_once(KERN_WARNING "MTD handling any more.\n");
printk(KERN_WARNING "MTD handling any more.\n");
printed++;
}
} }
err = -EINVAL; err = -EINVAL;
goto free_out; goto free_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment