[PATCH][mmtom] clean up printk_once of get_cpu_vendor

From: Minchan Kim
Date: Tue May 26 2009 - 19:32:10 EST


On Tue, 26 May 2009 13:41:34 -0700
Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Tue, 26 May 2009 15:59:43 +0900
> Minchan Kim <minchan.kim@xxxxxxxxx> wrote:
>
> > On Tue, 26 May 2009 15:52:32 +0900 (JST)
> > KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> wrote:
> >
> > > > == CUT HERE ==
> > > >
> > > > There are some places to be able to use printk_once instead of hard coding.
> > > >
> > > > It will help code readability and maintenance.
> > > > This patch doesn't change function's behavior.
> > > >
> > > > Signed-off-by: Minchan Kim <minchan.kim@xxxxxxxxx>
> > > > CC: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>
> > > > CC: David S. Miller <davem@xxxxxxxxxxxxx>
> > > > CC: Ingo Molnar <mingo@xxxxxxx>
> > > > ---
> > > > arch/x86/kernel/cpu/common.c | 8 ++------
> > > > drivers/net/3c515.c | 7 ++-----
> > > > drivers/pcmcia/pcmcia_ioctl.c | 9 +++------
> > > > 3 files changed, 7 insertions(+), 17 deletions(-)
> > >
> > > Please separete to three patches ;)
> >
> > After I listen about things I missed, I will repost it at all once with each patch.
>
> Yes, that would be better. But for a trivial little patch like this I
> expect we can just merge it and move on. But please do split up these
> multi-subsystem patches in future.

Thanks. Andrew.
I confiremd what you merged.

I modifed get_cpu_vendor's printk-once by Pavel Machek's adivse.
Please, merge with this based on my previous version.

== CUT HERE ==

[PATCH] clean up printk_once of get_cpu_vendor

It remove unnecessary variable and change two static variable
with one.

Signed-off-by: Minchan Kim <minchan.kim@xxxxxxxxx>
CC: Ingo Molnar <mingo@xxxxxxx>
CC: Pavel Machek <pavel@xxxxxx>

---
arch/x86/kernel/cpu/common.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index dc0f694..c6feb68 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -479,7 +479,6 @@ out:
static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
{
char *v = c->x86_vendor_id;
- static int printed;
int i;

for (i = 0; i < X86_VENDOR_NUM; i++) {
@@ -497,8 +496,8 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
}

printk_once(KERN_ERR
- "CPU: vendor_id '%s' unknown, using generic init.\n", v);
- printk_once(KERN_ERR "CPU: Your system may be unstable.\n");
+ "CPU: vendor_id '%s' unknown, using generic init.\n" \
+ "CPU: Your system may be unstable.\n", v);

c->x86_vendor = X86_VENDOR_UNKNOWN;
this_cpu = &default_cpu;
--
1.5.4.3








--
Kinds Regards
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/