All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]is_power_of_2-nfs/internal.h
@ 2007-06-14  8:20 ` vignesh babu
  0 siblings, 0 replies; 11+ messages in thread
From: vignesh babu @ 2007-06-14  8:08 UTC (permalink / raw)
  To: neilb; +Cc: Kernel Janitors List, nfs


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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-06-20 14:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-14  8:08 [PATCH]is_power_of_2-nfs/internal.h vignesh babu
2007-06-14  8:20 ` [KJ] [PATCH]is_power_of_2-nfs/internal.h vignesh babu
2007-06-14 15:45 ` [KJ] Re: [NFS] [PATCH]is_power_of_2-nfs/internal.h Trond Myklebust
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
2007-06-14 15:59   ` Yoann Padioleau

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.