From 1e5826be0c41826c69f88af1b6f981150d2a8699 Mon Sep 17 00:00:00 2001 From: Fabian Frederick Date: Thu, 22 May 2014 10:43:59 +1000 Subject: [PATCH] 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 --- fs/hfsplus/wrapper.c | 4 +--- 1 file changed, 1 insertion(+), 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); /* -- 2.39.5