fs/hfsplus/wrapper.c: replace shift loop by ilog2
authorFabian Frederick <fabf@skynet.be>
Fri, 6 Jun 2014 21:36:29 +0000 (14:36 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2014 23:08:10 +0000 (16:08 -0700)
Replace while blocksize;shift by ilog2

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/hfsplus/wrapper.c

index 284c90f943a18725cae569198d8b56b47fd9d718..cc623567143769b95d60a45a46b2f17e889773d0 100644 (file)
@@ -231,9 +231,7 @@ reread:
        if (blocksize < HFSPLUS_SECTOR_SIZE || ((blocksize - 1) & blocksize))
                goto out_free_backup_vhdr;
        sbi->alloc_blksz = blocksize;
-       sbi->alloc_blksz_shift = 0;
-       while ((blocksize >>= 1) != 0)
-               sbi->alloc_blksz_shift++;
+       sbi->alloc_blksz_shift = ilog2(blocksize);
        blocksize = min_t(u32, sbi->alloc_blksz, PAGE_SIZE);
 
        /*