Skip to content

Commit

Permalink
is_power_of_2: ufs/super.c
Browse files Browse the repository at this point in the history
Replace (n & (n-1)) with is_power_of_2

Signed-off-by: vignesh babu <[email protected]>
Acked-by: Evgeniy Dushistov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
vignesh babu authored and Linus Torvalds committed Jul 16, 2007
1 parent e7c310c commit 9e8c427
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/ufs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#include <linux/smp_lock.h>
#include <linux/buffer_head.h>
#include <linux/vfs.h>
#include <linux/log2.h>

#include "swab.h"
#include "util.h"
Expand Down Expand Up @@ -854,7 +855,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
uspi->s_fmask = fs32_to_cpu(sb, usb1->fs_fmask);
uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift);

if (uspi->s_fsize & (uspi->s_fsize - 1)) {
if (!is_power_of_2(uspi->s_fsize)) {
printk(KERN_ERR "ufs_read_super: fragment size %u is not a power of 2\n",
uspi->s_fsize);
goto failed;
Expand All @@ -869,7 +870,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
uspi->s_fsize);
goto failed;
}
if (uspi->s_bsize & (uspi->s_bsize - 1)) {
if (!is_power_of_2(uspi->s_bsize)) {
printk(KERN_ERR "ufs_read_super: block size %u is not a power of 2\n",
uspi->s_bsize);
goto failed;
Expand Down

0 comments on commit 9e8c427

Please sign in to comment.