Linux NFS development
 help / color / mirror / Atom feed
From: vignesh babu <vignesh.babu@wipro.com>
To: neilb@suse.de
Cc: Kernel Janitors List <kernel-janitors@lists.osdl.org>,
	nfs@lists.sourceforge.net
Subject: [PATCH]is_power_of_2-nfs/internal.h
Date: Thu, 14 Jun 2007 13:38:54 +0530	[thread overview]
Message-ID: <1181808534.2474.7.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/nfs/internal.h b/fs/nfs/internal.h
index ad2b40d..5dca432 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -3,6 +3,7 @@
  */
 
 #include <linux/mount.h>
+#include <linux/log2.h>
 
 struct nfs_string;
 struct nfs_mount_data;
@@ -167,7 +168,7 @@ static inline
 unsigned long nfs_block_bits(unsigned long bsize, unsigned char *nrbitsp)
 {
 	/* make sure blocksize is a power of two */
-	if ((bsize & (bsize - 1)) || nrbitsp) {
+	if (is_power_of_2(bsize) || nrbitsp) {
 		unsigned char	nrbits;
 
 		for (nrbits = 31; nrbits && !(bsize & (1 << nrbits)); nrbits--)

-- 
Vignesh Babu BM 
_____________________________________________________________ 
"Why is it that every time I'm with you, makes me believe in magic?"


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

             reply	other threads:[~2007-06-14  8:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14  8:08 vignesh babu [this message]
2007-06-14 15:45 ` [PATCH]is_power_of_2-nfs/internal.h Trond Myklebust
2007-06-15  6:50   ` NFS and Samba Winbindd Laurenz, Dirk
2007-06-15  9:44     ` Chris Osicki
2007-06-15  9:58       ` Laurenz, Dirk
2007-06-20  5:31         ` Laurenz, Dirk
2007-06-20 14:18           ` Trond Myklebust
2007-06-14 15:59 ` [KJ] [PATCH]is_power_of_2-nfs/internal.h Yoann Padioleau

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=1181808534.2474.7.camel@merlin.linuxcoe.com \
    --to=vignesh.babu@wipro.com \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=neilb@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox