Procházet zdrojové kódy

sparc: Simplify code using is_power_of_2() routine.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Robert P. J. Day před 16 roky
rodič
revize
949e82744b
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      arch/sparc/mm/srmmu.c

+ 2 - 1
arch/sparc/mm/srmmu.c

@@ -19,6 +19,7 @@
 #include <linux/fs.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
 #include <linux/seq_file.h>
 #include <linux/kdebug.h>
 #include <linux/kdebug.h>
+#include <linux/log2.h>
 
 
 #include <asm/bitext.h>
 #include <asm/bitext.h>
 #include <asm/page.h>
 #include <asm/page.h>
@@ -349,7 +350,7 @@ static void srmmu_free_nocache(unsigned long vaddr, int size)
 		    vaddr, srmmu_nocache_end);
 		    vaddr, srmmu_nocache_end);
 		BUG();
 		BUG();
 	}
 	}
-	if (size & (size-1)) {
+	if (!is_power_of_2(size)) {
 		printk("Size 0x%x is not a power of 2\n", size);
 		printk("Size 0x%x is not a power of 2\n", size);
 		BUG();
 		BUG();
 	}
 	}