mkfs_ext2: code shrink
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 17 Oct 2009 21:27:29 +0000 (23:27 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 17 Oct 2009 21:27:29 +0000 (23:27 +0200)
function                                             old     new   delta
div_roundup                                            -      15     +15
mkfs_ext2_main                                      1980    1933     -47

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/mkfs_ext2.c

index 41f37c2874838a72cdb1969f628d559f624c956f..83e81054ba1e3b096e03bf6cf636cbdcdefaf720 100644 (file)
@@ -59,16 +59,16 @@ struct ext2_dir {
        char     name3[12];
 };
 
-static inline int int_log2(int arg)
+static unsigned int_log2(unsigned arg)
 {
-       int r = 0;
+       unsigned r = 0;
        while ((arg >>= 1) != 0)
                r++;
        return r;
 }
 
 // taken from mkfs_minix.c. libbb candidate?
-static ALWAYS_INLINE unsigned div_roundup(uint32_t size, uint32_t n)
+static unsigned div_roundup(uint32_t size, uint32_t n)
 {
        return (size + n-1) / n;
 }