Re: [PATCH -v1.1] x86, boot: Further compress CPUs bootup message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [PATCH -v1.1] x86, boot: Further compress CPUs bootup message
- From: Ingo Molnar <mingo@xxxxxxxxxx>
- Date: Sat, 28 Sep 2013 21:25:45 +0200
- Cc: hpa@xxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, huawei.libin@xxxxxxxxxx, wangyijing@xxxxxxxxxx, fenghua.yu@xxxxxxxxx, tglx@xxxxxxxxxxxxx, guohanjun@xxxxxxxxxx, paul.gortmaker@xxxxxxxxxxxxx, linux-tip-commits@xxxxxxxxxxxxxxx
- In-reply-to: <20130928191500.GG5956@pd.tnic>
- User-agent: Mutt/1.5.21 (2010-09-15)
* Borislav Petkov <bp@xxxxxxxxx> wrote:
> @@ -2,6 +2,10 @@ int num_digits(int val)
> {
> int digits = 0;
>
> + /* Handle special case */
> + if (!val)
> + return 1;
> +
> while (val) {
> val /= 10;
> digits++;
Hm. I suspect this could then be written as:
int num_digits(int val)
{
int digits = 0;
do {
val /= 10;
digits++;
} while (val);
return digits;
}
No ugly special case! :-)
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]