Skip to content

Commit

Permalink
fs/hfsplus/wrapper.c: replace shift loop by ilog2
Browse files Browse the repository at this point in the history
Replace while blocksize;shift by ilog2

Signed-off-by: Fabian Frederick <[email protected]>
Cc: Vyacheslav Dubeyko <[email protected]>
Cc: Joe Perches <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Fabian Frederick authored and torvalds committed Jun 6, 2014
1 parent 2cd282a commit 297cc27
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fs/hfsplus/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,7 @@ int hfsplus_read_wrapper(struct super_block *sb)
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);

/*
Expand Down

0 comments on commit 297cc27

Please sign in to comment.