]> git.karo-electronics.de Git - karo-tx-linux.git/commit
lib: vsprintf: optimize put_dec_trunc8()
authorGeorge Spelvin <linux@horizon.com>
Wed, 26 Sep 2012 01:34:17 +0000 (11:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:27:36 +0000 (17:27 +1000)
commitfe3e1d8cca8bb3162e0324491feeedc7fa5c97e9
tree7df5ecd2185ce9e211f82cf2e7dbf4cfa83880ce
parent32035363fc7bd01e8c8ee9737ff44e646c45a0c9
lib: vsprintf: optimize put_dec_trunc8()

If you're going to have a conditional branch after each 32x32->64-bit
multiply, might as well shrink the code and make it a loop.

This also avoids using the long multiply for small integers.

(This leaves the comments in a confusing state, but that's a separate
patch to make review easier.)

Signed-off-by: George Spelvin <linux@horizon.com>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/vsprintf.c