From: Fabian Frederick Date: Fri, 6 Jun 2014 21:36:29 +0000 (-0700) Subject: fs/hfsplus/wrapper.c: replace shift loop by ilog2 X-Git-Tag: v4.9.8~6305^2~4^2~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=297cc27207446e9f054492fff5b561cebc589328;p=platform%2Fkernel%2Flinux-rpi3.git fs/hfsplus/wrapper.c: replace shift loop by ilog2 Replace while blocksize;shift by ilog2 Signed-off-by: Fabian Frederick Cc: Vyacheslav Dubeyko Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c index 284c90f..cc62356 100644 --- a/fs/hfsplus/wrapper.c +++ b/fs/hfsplus/wrapper.c @@ -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); /*