aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorvignesh babu <vignesh.babu@wipro.com>2007-06-07 05:57:46 -0400
committerTony Luck <tony.luck@intel.com>2007-06-26 16:32:59 -0400
commit9be26f4c4b138c425598bd3cc50411bd87fce287 (patch)
tree9517030267a1bd3be5f5e0d7d08178f283f031e4 /arch
parent189548642c5962e60c3667bdb3a703fe0bed12a6 (diff)
[IA64] is_power_of_2-ia64/mm/hugetlbpage.c
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> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/mm/hugetlbpage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 1346b7f05397..d22861c5b04c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
15#include <linux/pagemap.h> 15#include <linux/pagemap.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/sysctl.h> 17#include <linux/sysctl.h>
18#include <linux/log2.h>
18#include <asm/mman.h> 19#include <asm/mman.h>
19#include <asm/pgalloc.h> 20#include <asm/pgalloc.h>
20#include <asm/tlb.h> 21#include <asm/tlb.h>
@@ -182,7 +183,7 @@ static int __init hugetlb_setup_sz(char *str)
182 tr_pages = 0x15557000UL; 183 tr_pages = 0x15557000UL;
183 184
184 size = memparse(str, &str); 185 size = memparse(str, &str);
185 if (*str || (size & (size-1)) || !(tr_pages & size) || 186 if (*str || !is_power_of_2(size) || !(tr_pages & size) ||
186 size <= PAGE_SIZE || 187 size <= PAGE_SIZE ||
187 size >= (1UL << PAGE_SHIFT << MAX_ORDER)) { 188 size >= (1UL << PAGE_SHIFT << MAX_ORDER)) {
188 printk(KERN_WARNING "Invalid huge page size specified\n"); 189 printk(KERN_WARNING "Invalid huge page size specified\n");