Borislav Petkov a17bce4d1d x86/boot: Further compress CPUs bootup message
Turn it into (for example):

[    0.073380] x86: Booting SMP configuration:
[    0.074005] .... node   , CPUs:                            
[    0.603005] .... node   , CPUs:                    
[    1.200005] .... node   , CPUs:                  
[    1.796005] .... node   , CPUs:                  
[    2.393005] .... node   , CPUs:                  
[    2.996005] .... node   , CPUs:                  
[    3.600005] .... node   , CPUs:                  
[    4.202005] .... node   , CPUs:                  
[    4.811005] .... node   , CPUs:                  
[    5.421006] .... node   , CPUs:                  
[    6.032005] .... node  , CPUs:                  
[    6.648006] .... node  , CPUs:                  
[    7.262005] .... node  , CPUs:              
[    7.865005] .... node  , CPUs:          
[    8.466005] .... node  , CPUs:          
[    9.073006] .... node  , CPUs:          
[    9.679901] x86: Booted up 16 nodes, 128 CPUs

and drop useless elements.

Change num_digits() to hpa's division-avoiding, cell-phone-typed
version which he went at great lengths and pains to submit on a
Saturday evening.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: huawei.libin@huawei.com
Cc: wangyijing@huawei.com
Cc: fenghua.yu@intel.com
Cc: guohanjun@huawei.com
Cc: paul.gortmaker@windriver.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20130930095624.GB16383@pd.tnic
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-10-01 10:52:30 +02:00

22 lines
265 B
C

/*
* Count the digits of @val including a possible sign.
*
* (Typed on and submitted from hpa's mobile phone.)
*/
int num_digits(int val)
{
int m = 10;
int d = 1;
if (val < 0) {
d++;
val = -val;
}
while (val >= m) {
m *= 10;
d++;
}
return d;
}