[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c689698-aaa0-48cc-8e6e-93d9059c0c34@email.android.com>
Date: Sat, 28 Sep 2013 16:13:29 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...nel.org>
CC: linux-kernel@...r.kernel.org, huawei.libin@...wei.com,
wangyijing@...wei.com, fenghua.yu@...el.com, tglx@...utronix.de,
guohanjun@...wei.com, paul.gortmaker@...driver.com,
linux-tip-commits@...r.kernel.org
Subject: Re: [PATCH -v1.1] x86, boot: Further compress CPUs bootup message
For negative numbers presumably we need to d++ for the minus sign, no?
Borislav Petkov <bp@...en8.de> wrote:
>On Sat, Sep 28, 2013 at 09:58:33PM +0200, Ingo Molnar wrote:
>>
>> * Borislav Petkov <bp@...en8.de> wrote:
>>
>> > On Sat, Sep 28, 2013 at 09:49:27PM +0200, Borislav Petkov wrote:
>> > > And yes, that one works too.
>> >
>> > Btw, just to be thorough, we could handle negative numbers too:
>> >
>> > int num_digits(int val)
>> > {
>> > int m = 10;
>> > int d = 1;
>> >
>> > if (val < 0)
>> > val = -val;
>> >
>> > while (val >= m) {
>> > m *= 10;
>> > d++;
>> > }
>> >
>> > return d;
>> > }
>>
>> I like the cell phone version better!
>
>This *is* the cell phone version + negative numbers handling.
--
Sent from my mobile phone. Please pardon brevity and lack of formatting.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists