lkml.org 
[lkml]   [2014]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH V2 mmots] fs/hfsplus/wrapper.c: replace shift loop by fls
Replace while blocksize;shift by fls -1

Suggested-By: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
v2: rebased on top of mmots
compiles without including bitops

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 284c90f..8e8cf50d 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 = fls(blocksize) - 1;
blocksize = min_t(u32, sbi->alloc_blksz, PAGE_SIZE);

/*
--
1.8.4.5


\
 
 \ /
  Last update: 2014-05-16 23:21    [W:0.085 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site