Skip to contentSkip to conversation

moving to is_power_of_2

PATCH In review Vignesh Babu BM 1 participant 1 message Feb 16, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/5 moving to is_power_of_2

Removing instances of (n&(n-1)) for power of 2
check with is_power_of_2 from linux/log.h.

---
 drivers/block/rd.c |    1 +
 fs/nfs/internal.h  |    1 +
 fs/ufs/super.c     |    3 +--
 3 files changed, 3 insertions(+), 2 deletions(-)
drivers/block/rd.c +1 -0
index f73c4a8..e830250 100644
@@ -56,6 +56,7 @@
 #include <linux/backing-dev.h>
 #include <linux/blkpg.h>
 #include <linux/writeback.h>
+#include <linux/log2.h>
 
 #include <asm/uaccess.h>
 
fs/nfs/internal.h +1 -0
index 5a1afbb..87b3314 100644
@@ -4,6 +4,7 @@
 
 #include <linux/mount.h>
 #include <linux/log2.h>
+
 struct nfs_string;
 struct nfs_mount_data;
 struct nfs4_mount_data;
fs/ufs/super.c +1 -2
index 0706e4c..275a34b 100644
@@ -866,8 +866,7 @@ magic_found:
 			uspi->s_fsize);
 		goto failed;
 	}
-	//if (uspi->s_bsize & (uspi->s_bsize - 1)) {
-	if (!isp_power_of_2(uspi->s_bsize)) {
+	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;
Signature · 12 lines
1.4.4.2


-- 
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors