From: vignesh babu <vignesh.babu@wipro.com>
To: daniel.pirkl@email.cz, dushistov@mail.ru
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Kernel Janitors List <kernel-janitors@lists.osdl.org>
Subject: [KJ] [PATCH]is_power_of_2-ufs/super.c
Date: Thu, 14 Jun 2007 08:21:18 +0000 [thread overview]
Message-ID: <1181808559.2474.9.camel@merlin.linuxcoe.com> (raw)
Replacing (n & (n-1)) in the context of power of 2 checks
with is_power_of_2
Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
---
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 22ff6ed..2b30116 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -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"
@@ -854,7 +855,7 @@ magic_found:
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;
@@ -869,7 +870,7 @@ magic_found:
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;
--
Vignesh Babu BM
_____________________________________________________________
"Why is it that every time I'm with you, makes me believe in magic?"
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
WARNING: multiple messages have this Message-ID (diff)
From: vignesh babu <vignesh.babu@wipro.com>
To: daniel.pirkl@email.cz, dushistov@mail.ru
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Kernel Janitors List <kernel-janitors@lists.osdl.org>
Subject: [PATCH]is_power_of_2-ufs/super.c
Date: Thu, 14 Jun 2007 13:39:18 +0530 [thread overview]
Message-ID: <1181808559.2474.9.camel@merlin.linuxcoe.com> (raw)
Replacing (n & (n-1)) in the context of power of 2 checks
with is_power_of_2
Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
---
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 22ff6ed..2b30116 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -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"
@@ -854,7 +855,7 @@ magic_found:
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;
@@ -869,7 +870,7 @@ magic_found:
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;
--
Vignesh Babu BM
_____________________________________________________________
"Why is it that every time I'm with you, makes me believe in magic?"
next reply other threads:[~2007-06-14 8:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-14 8:09 vignesh babu [this message]
2007-06-14 8:21 ` [KJ] [PATCH]is_power_of_2-ufs/super.c vignesh babu
2007-06-14 17:50 ` [KJ] [PATCH]is_power_of_2-ufs/super.c Evgeniy Dushistov
2007-06-14 17:50 ` [PATCH]is_power_of_2-ufs/super.c Evgeniy Dushistov
2007-06-25 12:13 ` [KJ] [PATCH]is_power_of_2-ufs/super.c Johannes Weiner
2007-06-25 12:13 ` [PATCH]is_power_of_2-ufs/super.c Johannes Weiner
2007-06-25 12:21 ` [PATCH]is_power_of_2-ufs/super.c vignesh babu
2007-06-25 12:33 ` [KJ] [PATCH]is_power_of_2-ufs/super.c vignesh babu
2007-06-25 12:27 ` Robert P. J. Day
2007-06-25 12:27 ` [PATCH]is_power_of_2-ufs/super.c Robert P. J. Day
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1181808559.2474.9.camel@merlin.linuxcoe.com \
--to=vignesh.babu@wipro.com \
--cc=daniel.pirkl@email.cz \
--cc=dushistov@mail.ru \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.