mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
is_power_of_2 in fs/hfs
Replace (n & (n-1)) in the context of power of 2 checks with is_power_of_2 Signed-off-by: vignesh babu <[email protected]> Cc: Roman Zippel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
e7d709c096
commit
e1b5c1d3da
2 changed files with 4 additions and 2 deletions
|
|
@ -9,6 +9,7 @@
|
|||
*/
|
||||
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/log2.h>
|
||||
|
||||
#include "btree.h"
|
||||
|
||||
|
|
@ -76,7 +77,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
|
|||
tree->depth = be16_to_cpu(head->depth);
|
||||
|
||||
size = tree->node_size;
|
||||
if (!size || size & (size - 1))
|
||||
if (!is_power_of_2(size))
|
||||
goto fail_page;
|
||||
if (!tree->node_count)
|
||||
goto fail_page;
|
||||
|
|
|
|||
Loading…
Reference in a new issue