powerpc: Only print clockevent settings once
PATCH 1/1 powerpc: Only print clockevent settings once
The clockevent multiplier and shift is useful information, but we only need to print it once.
Signed-off-by Anton Blanchard <[email protected]>
---
arch/powerpc/kernel/time.c +6 -2
@@ -930,13 +930,17 @@ static void __init setup_clockevent_multstatic 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); }
Quoted 18 lines · Anton Blanchard
The clockevent multiplier and shift is useful information, but we only need to print it once.
Signed-off-by Anton Blanchard <[email protected]>---
Index:
powerpc.git/arch/powerpc/kernel/time.c
===================================================================arch/powerpc/kernel/time.c +1
-0@@ -930,13 +930,17 @@ static void __init setup_clockevent_multstatic void register_decrementer_clockevent (int cpu) { +static int printed =0 ;struct clock_event_device *dec = &per_cpu (decrementers, cpu).event;
arch/powerpc/kernel/time.c static void __init setup_clockevent_mult · line 943
Quoted 10 lines
arch/powerpc/kernel/time.c +5
-2*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?
Signature · 2 lines
Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Hi Wolfram,
Quoted 1 line
What about
printk_oncefromkernel.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 <[email protected]>
---
arch/powerpc/kernel/time.c +2 -2
@@ -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); }