summaryrefslogtreecommitdiffstats
path: root/fs/hfsplus
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-06 23:36:29 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-07 01:08:10 +0200
commit297cc27207446e9f054492fff5b561cebc589328 (patch)
treeac7f0c90f3b428e270a03bc9eafe16361578ae21 /fs/hfsplus
parenthfsplus: fix "unused node is not erased" error (diff)
downloadlinux-297cc27207446e9f054492fff5b561cebc589328.tar.xz
linux-297cc27207446e9f054492fff5b561cebc589328.zip
fs/hfsplus/wrapper.c: replace shift loop by ilog2
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>
Diffstat (limited to 'fs/hfsplus')
-rw-r--r--fs/hfsplus/wrapper.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index 284c90f943a1..cc6235671437 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);
/*