All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][mmtom] clean up once printk routine
@ 2009-05-26  4:57 Minchan Kim
  2009-05-26  6:52   ` KOSAKI Motohiro
  2009-05-26  8:35   ` Pavel Machek
  0 siblings, 2 replies; 13+ messages in thread
From: Minchan Kim @ 2009-05-26  4:57 UTC (permalink / raw
  To: akpm
  Cc: Randy Dunlap, KOSAKI Motohiro, Christoph Lameter, linux-mm,
	Pavel Machek, Dave Hansen, David S. Miller, Dominik Brodowski,
	Ingo Molnar, lkml


On Tue, 26 May 2009 12:29:34 +0900
Paul Mundt <lethal@linux-sh.org> wrote:

> On Sun, May 24, 2009 at 07:42:02PM -0700, Randy Dunlap wrote:
> > KOSAKI Motohiro wrote:
> > >> +	if (!printed) {
> > >> +		printed = 1;
> > >> +		printk(KERN_WARNING "All of swap is in use. Some pages cannot be swapped out.");
> > >> +	}
> > > 
> > > Why don't you use WARN_ONCE()?
> > 
> > Someone earlier in this patch thread (maybe Pavel?) commented that
> > WARN_ONCE() would cause a stack dump and that would be too harsh,
> > especially for users.  I.e., just the message is needed here, not a
> > stack dump.
> > 
> Note that this is precisely what we have printk_once() for these days,
> which will do what this patch is doing already. Of course if the variable
> will be reset, then it is best left as is.

Yes. There are also some places to be able to use printk_once().
Are there any place I missed ?

== 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@gmail.com>
CC: Dominik Brodowski <linux@dominikbrodowski.net>
CC: David S. Miller <davem@davemloft.net>
CC: Ingo Molnar <mingo@elte.hu>
---
 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(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 82bec86..dc0f694 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -496,13 +496,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
 		}
 	}
 
-	if (!printed) {
-		printed++;
-		printk(KERN_ERR
+	printk_once(KERN_ERR
 		    "CPU: vendor_id '%s' unknown, using generic init.\n", v);
-
-		printk(KERN_ERR "CPU: Your system may be unstable.\n");
-	}
+	printk_once(KERN_ERR "CPU: Your system may be unstable.\n");
 
 	c->x86_vendor = X86_VENDOR_UNKNOWN;
 	this_cpu = &default_cpu;
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index 167bf23..0450605 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -430,15 +430,12 @@ int init_module(void)
 struct net_device *tc515_probe(int unit)
 {
 	struct net_device *dev = corkscrew_scan(unit);
-	static int printed;
 
 	if (!dev)
 		return ERR_PTR(-ENODEV);
 
-	if (corkscrew_debug > 0 && !printed) {
-		printed = 1;
-		printk(version);
-	}
+	if (corkscrew_debug > 0) 
+		printk_once(version);
 
 	return dev;
 }
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 1703b20..78af368 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -915,12 +915,9 @@ static int ds_ioctl(struct inode * inode, struct file * file,
 		err = -EPERM;
 		goto free_out;
 	} else {
-		static int printed = 0;
-		if (!printed) {
-			printk(KERN_WARNING "2.6. kernels use pcmciamtd instead of memory_cs.c and do not require special\n");
-			printk(KERN_WARNING "MTD handling any more.\n");
-			printed++;
-		}
+			printk_once(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");
 	}
 	err = -EINVAL;
 	goto free_out;
-- 
1.5.4.3



-- 
Kinds Regards
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
  2009-05-26  4:57 [PATCH][mmtom] clean up once printk routine Minchan Kim
@ 2009-05-26  6:52   ` KOSAKI Motohiro
  2009-05-26  8:35   ` Pavel Machek
  1 sibling, 0 replies; 13+ messages in thread
From: KOSAKI Motohiro @ 2009-05-26  6:52 UTC (permalink / raw
  To: Minchan Kim
  Cc: kosaki.motohiro, akpm, Randy Dunlap, Christoph Lameter, linux-mm,
	Pavel Machek, Dave Hansen, David S. Miller, Dominik Brodowski,
	Ingo Molnar, lkml

> == 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@gmail.com>
> CC: Dominik Brodowski <linux@dominikbrodowski.net>
> CC: David S. Miller <davem@davemloft.net>
> CC: Ingo Molnar <mingo@elte.hu>
> ---
>  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 ;)




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
@ 2009-05-26  6:52   ` KOSAKI Motohiro
  0 siblings, 0 replies; 13+ messages in thread
From: KOSAKI Motohiro @ 2009-05-26  6:52 UTC (permalink / raw
  To: Minchan Kim
  Cc: kosaki.motohiro, akpm, Randy Dunlap, Christoph Lameter, linux-mm,
	Pavel Machek, Dave Hansen, David S. Miller, Dominik Brodowski,
	Ingo Molnar, lkml

> == 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@gmail.com>
> CC: Dominik Brodowski <linux@dominikbrodowski.net>
> CC: David S. Miller <davem@davemloft.net>
> CC: Ingo Molnar <mingo@elte.hu>
> ---
>  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 ;)



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
  2009-05-26  6:52   ` KOSAKI Motohiro
@ 2009-05-26  6:59     ` Minchan Kim
  -1 siblings, 0 replies; 13+ messages in thread
From: Minchan Kim @ 2009-05-26  6:59 UTC (permalink / raw
  To: KOSAKI Motohiro
  Cc: Minchan Kim, akpm, Randy Dunlap, Christoph Lameter, linux-mm,
	Pavel Machek, Dave Hansen, David S. Miller, Dominik Brodowski,
	Ingo Molnar, lkml

On Tue, 26 May 2009 15:52:32 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> 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@gmail.com>
> > CC: Dominik Brodowski <linux@dominikbrodowski.net>
> > CC: David S. Miller <davem@davemloft.net>
> > CC: Ingo Molnar <mingo@elte.hu>
> > ---
> >  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.
Thanks for comment. Kosaki. :)


-- 
Kinds Regards
Minchan Kim

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
@ 2009-05-26  6:59     ` Minchan Kim
  0 siblings, 0 replies; 13+ messages in thread
From: Minchan Kim @ 2009-05-26  6:59 UTC (permalink / raw
  To: KOSAKI Motohiro
  Cc: Minchan Kim, akpm, Randy Dunlap, Christoph Lameter, linux-mm,
	Pavel Machek, Dave Hansen, David S. Miller, Dominik Brodowski,
	Ingo Molnar, lkml

On Tue, 26 May 2009 15:52:32 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> 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@gmail.com>
> > CC: Dominik Brodowski <linux@dominikbrodowski.net>
> > CC: David S. Miller <davem@davemloft.net>
> > CC: Ingo Molnar <mingo@elte.hu>
> > ---
> >  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.
Thanks for comment. Kosaki. :)


-- 
Kinds Regards
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
  2009-05-26  4:57 [PATCH][mmtom] clean up once printk routine Minchan Kim
@ 2009-05-26  8:35   ` Pavel Machek
  2009-05-26  8:35   ` Pavel Machek
  1 sibling, 0 replies; 13+ messages in thread
From: Pavel Machek @ 2009-05-26  8:35 UTC (permalink / raw
  To: Minchan Kim
  Cc: akpm, Randy Dunlap, KOSAKI Motohiro, Christoph Lameter, linux-mm,
	Dave Hansen, David S. Miller, Dominik Brodowski, Ingo Molnar,
	lkml

Hi!

> Yes. There are also some places to be able to use printk_once().
> Are there any place I missed ?
> 
> == 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@gmail.com>
> CC: Dominik Brodowski <linux@dominikbrodowski.net>
> CC: David S. Miller <davem@davemloft.net>
> CC: Ingo Molnar <mingo@elte.hu>
> ---
>  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(-)
> 
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 82bec86..dc0f694 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -496,13 +496,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
>  		}
>  	}
>  
> -	if (!printed) {
> -		printed++;
> -		printk(KERN_ERR
> +	printk_once(KERN_ERR
>  		    "CPU: vendor_id '%s' unknown, using generic init.\n", v);
> -
> -		printk(KERN_ERR "CPU: Your system may be unstable.\n");
> -	}
> +	printk_once(KERN_ERR "CPU: Your system may be unstable.\n");
>

You should delete the variable, right?

Plus, the code now uses two variables instead of one.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
@ 2009-05-26  8:35   ` Pavel Machek
  0 siblings, 0 replies; 13+ messages in thread
From: Pavel Machek @ 2009-05-26  8:35 UTC (permalink / raw
  To: Minchan Kim
  Cc: akpm, Randy Dunlap, KOSAKI Motohiro, Christoph Lameter, linux-mm,
	Dave Hansen, David S. Miller, Dominik Brodowski, Ingo Molnar,
	lkml

Hi!

> Yes. There are also some places to be able to use printk_once().
> Are there any place I missed ?
> 
> == 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@gmail.com>
> CC: Dominik Brodowski <linux@dominikbrodowski.net>
> CC: David S. Miller <davem@davemloft.net>
> CC: Ingo Molnar <mingo@elte.hu>
> ---
>  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(-)
> 
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index 82bec86..dc0f694 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -496,13 +496,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
>  		}
>  	}
>  
> -	if (!printed) {
> -		printed++;
> -		printk(KERN_ERR
> +	printk_once(KERN_ERR
>  		    "CPU: vendor_id '%s' unknown, using generic init.\n", v);
> -
> -		printk(KERN_ERR "CPU: Your system may be unstable.\n");
> -	}
> +	printk_once(KERN_ERR "CPU: Your system may be unstable.\n");
>

You should delete the variable, right?

Plus, the code now uses two variables instead of one.

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
  2009-05-26  8:35   ` Pavel Machek
@ 2009-05-26  9:40     ` Minchan Kim
  -1 siblings, 0 replies; 13+ messages in thread
From: Minchan Kim @ 2009-05-26  9:40 UTC (permalink / raw
  To: Pavel Machek
  Cc: Minchan Kim, akpm, Randy Dunlap, KOSAKI Motohiro,
	Christoph Lameter, linux-mm, Dave Hansen, David S. Miller,
	Dominik Brodowski, Ingo Molnar, lkml

Hi, Pavel.

On Tue, May 26, 2009 at 5:35 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> Yes. There are also some places to be able to use printk_once().
>> Are there any place I missed ?
>>
>> == 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@gmail.com>
>> CC: Dominik Brodowski <linux@dominikbrodowski.net>
>> CC: David S. Miller <davem@davemloft.net>
>> CC: Ingo Molnar <mingo@elte.hu>
>> ---
>>  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(-)
>>
>> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
>> index 82bec86..dc0f694 100644
>> --- a/arch/x86/kernel/cpu/common.c
>> +++ b/arch/x86/kernel/cpu/common.c
>> @@ -496,13 +496,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
>>               }
>>       }
>>
>> -     if (!printed) {
>> -             printed++;
>> -             printk(KERN_ERR
>> +     printk_once(KERN_ERR
>>                   "CPU: vendor_id '%s' unknown, using generic init.\n", v);
>> -
>> -             printk(KERN_ERR "CPU: Your system may be unstable.\n");
>> -     }
>> +     printk_once(KERN_ERR "CPU: Your system may be unstable.\n");
>>
>
> You should delete the variable, right?

Yes. you're right.

> Plus, the code now uses two variables instead of one.
>
>                                                                        Pavel

Thanks for pointing me out.
I will repost the patch with your advise.


> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>



-- 
Thanks,
Minchan Kim

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
@ 2009-05-26  9:40     ` Minchan Kim
  0 siblings, 0 replies; 13+ messages in thread
From: Minchan Kim @ 2009-05-26  9:40 UTC (permalink / raw
  To: Pavel Machek
  Cc: Minchan Kim, akpm, Randy Dunlap, KOSAKI Motohiro,
	Christoph Lameter, linux-mm, Dave Hansen, David S. Miller,
	Dominik Brodowski, Ingo Molnar, lkml

Hi, Pavel.

On Tue, May 26, 2009 at 5:35 PM, Pavel Machek <pavel@ucw.cz> wrote:
> Hi!
>
>> Yes. There are also some places to be able to use printk_once().
>> Are there any place I missed ?
>>
>> == 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@gmail.com>
>> CC: Dominik Brodowski <linux@dominikbrodowski.net>
>> CC: David S. Miller <davem@davemloft.net>
>> CC: Ingo Molnar <mingo@elte.hu>
>> ---
>>  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(-)
>>
>> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
>> index 82bec86..dc0f694 100644
>> --- a/arch/x86/kernel/cpu/common.c
>> +++ b/arch/x86/kernel/cpu/common.c
>> @@ -496,13 +496,9 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c)
>>               }
>>       }
>>
>> -     if (!printed) {
>> -             printed++;
>> -             printk(KERN_ERR
>> +     printk_once(KERN_ERR
>>                   "CPU: vendor_id '%s' unknown, using generic init.\n", v);
>> -
>> -             printk(KERN_ERR "CPU: Your system may be unstable.\n");
>> -     }
>> +     printk_once(KERN_ERR "CPU: Your system may be unstable.\n");
>>
>
> You should delete the variable, right?

Yes. you're right.

> Plus, the code now uses two variables instead of one.
>
>                                                                        Pavel

Thanks for pointing me out.
I will repost the patch with your advise.


> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>



-- 
Thanks,
Minchan Kim

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
  2009-05-26  6:59     ` Minchan Kim
@ 2009-05-26 20:41       ` Andrew Morton
  -1 siblings, 0 replies; 13+ messages in thread
From: Andrew Morton @ 2009-05-26 20:41 UTC (permalink / raw
  To: Minchan Kim
  Cc: kosaki.motohiro, minchan.kim, randy.dunlap, cl, linux-mm, pavel,
	dave, davem, linux, mingo, linux-kernel

On Tue, 26 May 2009 15:59:43 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:

> On Tue, 26 May 2009 15:52:32 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> 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@gmail.com>
> > > CC: Dominik Brodowski <linux@dominikbrodowski.net>
> > > CC: David S. Miller <davem@davemloft.net>
> > > CC: Ingo Molnar <mingo@elte.hu>
> > > ---
> > >  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.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH][mmtom] clean up once printk routine
@ 2009-05-26 20:41       ` Andrew Morton
  0 siblings, 0 replies; 13+ messages in thread
From: Andrew Morton @ 2009-05-26 20:41 UTC (permalink / raw
  To: Minchan Kim
  Cc: kosaki.motohiro, randy.dunlap, cl, linux-mm, pavel, dave, davem,
	linux, mingo, linux-kernel

On Tue, 26 May 2009 15:59:43 +0900
Minchan Kim <minchan.kim@gmail.com> wrote:

> On Tue, 26 May 2009 15:52:32 +0900 (JST)
> KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> 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@gmail.com>
> > > CC: Dominik Brodowski <linux@dominikbrodowski.net>
> > > CC: David S. Miller <davem@davemloft.net>
> > > CC: Ingo Molnar <mingo@elte.hu>
> > > ---
> > >  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.


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH][mmtom] clean up printk_once of get_cpu_vendor
  2009-05-26 20:41       ` Andrew Morton
@ 2009-05-26 23:31         ` Minchan Kim
  -1 siblings, 0 replies; 13+ messages in thread
From: Minchan Kim @ 2009-05-26 23:31 UTC (permalink / raw
  To: Andrew Morton
  Cc: Minchan Kim, kosaki.motohiro, randy.dunlap, cl, linux-mm, pavel,
	dave, davem, linux, mingo, linux-kernel

On Tue, 26 May 2009 13:41:34 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 26 May 2009 15:59:43 +0900
> Minchan Kim <minchan.kim@gmail.com> wrote:
> 
> > On Tue, 26 May 2009 15:52:32 +0900 (JST)
> > KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> 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@gmail.com>
> > > > CC: Dominik Brodowski <linux@dominikbrodowski.net>
> > > > CC: David S. Miller <davem@davemloft.net>
> > > > CC: Ingo Molnar <mingo@elte.hu>
> > > > ---
> > > >  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@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Pavel Machek <pavel@ucw.cz>

---
 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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH][mmtom] clean up printk_once of get_cpu_vendor
@ 2009-05-26 23:31         ` Minchan Kim
  0 siblings, 0 replies; 13+ messages in thread
From: Minchan Kim @ 2009-05-26 23:31 UTC (permalink / raw
  To: Andrew Morton
  Cc: Minchan Kim, kosaki.motohiro, randy.dunlap, cl, linux-mm, pavel,
	dave, davem, linux, mingo, linux-kernel

On Tue, 26 May 2009 13:41:34 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Tue, 26 May 2009 15:59:43 +0900
> Minchan Kim <minchan.kim@gmail.com> wrote:
> 
> > On Tue, 26 May 2009 15:52:32 +0900 (JST)
> > KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> 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@gmail.com>
> > > > CC: Dominik Brodowski <linux@dominikbrodowski.net>
> > > > CC: David S. Miller <davem@davemloft.net>
> > > > CC: Ingo Molnar <mingo@elte.hu>
> > > > ---
> > > >  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@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Pavel Machek <pavel@ucw.cz>

---
 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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2009-05-26 23:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-26  4:57 [PATCH][mmtom] clean up once printk routine Minchan Kim
2009-05-26  6:52 ` KOSAKI Motohiro
2009-05-26  6:52   ` KOSAKI Motohiro
2009-05-26  6:59   ` Minchan Kim
2009-05-26  6:59     ` Minchan Kim
2009-05-26 20:41     ` Andrew Morton
2009-05-26 20:41       ` Andrew Morton
2009-05-26 23:31       ` [PATCH][mmtom] clean up printk_once of get_cpu_vendor Minchan Kim
2009-05-26 23:31         ` Minchan Kim
2009-05-26  8:35 ` [PATCH][mmtom] clean up once printk routine Pavel Machek
2009-05-26  8:35   ` Pavel Machek
2009-05-26  9:40   ` Minchan Kim
2009-05-26  9:40     ` Minchan Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.