linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Only print clockevent settings once
@ 2010-02-07 22:28 Anton Blanchard
  2010-02-08  4:53 ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Blanchard @ 2010-02-07 22:28 UTC (permalink / raw)
  To: benh; +Cc: linuxppc-dev


The clockevent multiplier and shift is useful information, but we
only need to print it once.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: powerpc.git/arch/powerpc/kernel/time.c
===================================================================
--- powerpc.git.orig/arch/powerpc/kernel/time.c	2010-02-05 14:57:48.839716602 +1100
+++ powerpc.git/arch/powerpc/kernel/time.c	2010-02-05 14:57:53.057212067 +1100
@@ -930,13 +930,17 @@ static void __init setup_clockevent_mult
 
 static void register_decrementer_clockevent(int cpu)
 {
+	static int printed = 0;
 	struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
 
 	*dec = decrementer_clockevent;
 	dec->cpumask = cpumask_of(cpu);
 
-	printk(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
-	       dec->name, dec->mult, dec->shift, cpu);
+	if (!printed) {
+		printed = 1;
+		printk(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
+		       dec->name, dec->mult, dec->shift, cpu);
+	}
 
 	clockevents_register_device(dec);
 }

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

* Re: [PATCH] powerpc: Only print clockevent settings once
  2010-02-07 22:28 [PATCH] powerpc: Only print clockevent settings once Anton Blanchard
@ 2010-02-08  4:53 ` Wolfram Sang
  2010-02-08  5:26   ` Anton Blanchard
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2010-02-08  4:53 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]

On Mon, Feb 08, 2010 at 09:28:01AM +1100, Anton Blanchard wrote:
> 
> The clockevent multiplier and shift is useful information, but we
> only need to print it once.
> 
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> 
> Index: powerpc.git/arch/powerpc/kernel/time.c
> ===================================================================
> --- powerpc.git.orig/arch/powerpc/kernel/time.c	2010-02-05 14:57:48.839716602 +1100
> +++ powerpc.git/arch/powerpc/kernel/time.c	2010-02-05 14:57:53.057212067 +1100
> @@ -930,13 +930,17 @@ static void __init setup_clockevent_mult
>  
>  static void register_decrementer_clockevent(int cpu)
>  {
> +	static int printed = 0;
>  	struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
>  
>  	*dec = decrementer_clockevent;
>  	dec->cpumask = cpumask_of(cpu);
>  
> -	printk(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
> -	       dec->name, dec->mult, dec->shift, cpu);
> +	if (!printed) {
> +		printed = 1;
> +		printk(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
> +		       dec->name, dec->mult, dec->shift, cpu);
> +	}

What about printk_once from kernel.h?

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

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

* Re: [PATCH] powerpc: Only print clockevent settings once
  2010-02-08  4:53 ` Wolfram Sang
@ 2010-02-08  5:26   ` Anton Blanchard
  0 siblings, 0 replies; 3+ messages in thread
From: Anton Blanchard @ 2010-02-08  5:26 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linuxppc-dev


Hi Wolfram,

> What about printk_once from kernel.h?

Thanks for the suggestion!

Anton
--

The clockevent multiplier and shift is useful information, but we
only need to print it once.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: powerpc.git/arch/powerpc/kernel/time.c
===================================================================
--- powerpc.git.orig/arch/powerpc/kernel/time.c	2010-02-08 11:45:12.933073040 +1100
+++ powerpc.git/arch/powerpc/kernel/time.c	2010-02-08 16:21:08.505571532 +1100
@@ -935,8 +935,8 @@ static void register_decrementer_clockev
 	*dec = decrementer_clockevent;
 	dec->cpumask = cpumask_of(cpu);
 
-	printk(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
-	       dec->name, dec->mult, dec->shift, cpu);
+	printk_once(KERN_DEBUG "clockevent: %s mult[%x] shift[%d] cpu[%d]\n",
+		    dec->name, dec->mult, dec->shift, cpu);
 
 	clockevents_register_device(dec);
 }

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

end of thread, other threads:[~2010-02-08  5:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-07 22:28 [PATCH] powerpc: Only print clockevent settings once Anton Blanchard
2010-02-08  4:53 ` Wolfram Sang
2010-02-08  5:26   ` Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).