All of lore.kernel.org
 help / color / mirror / Atom feed
From: vignesh babu <vignesh.babu@wipro.com>
To: tony.luck@intel.com, rohit.seth@intel.com, kenneth.w.chen@intel.com
Cc: linux-ia64@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kernel Janitors List <kernel-janitors@lists.osdl.org>
Subject: [KJ][PATCH]is_power_of_2-ia64/mm/hugetlbpage.c
Date: Thu, 07 Jun 2007 10:09:46 +0000	[thread overview]
Message-ID: <1181210266.11218.3.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/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 1346b7f..d22861c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
 #include <linux/pagemap.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
+#include <linux/log2.h>
 #include <asm/mman.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
@@ -182,7 +183,7 @@ static int __init hugetlb_setup_sz(char *str)
 		tr_pages = 0x15557000UL;
 
 	size = memparse(str, &str);
-	if (*str || (size & (size-1)) || !(tr_pages & size) ||
+	if (*str || !is_power_of_2(size) || !(tr_pages & size) ||
 		size <= PAGE_SIZE ||
 		size >= (1UL << PAGE_SHIFT << MAX_ORDER)) {
 		printk(KERN_WARNING "Invalid huge page size specified\n");

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

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

WARNING: multiple messages have this Message-ID (diff)
From: vignesh babu <vignesh.babu@wipro.com>
To: tony.luck@intel.com, rohit.seth@intel.com, kenneth.w.chen@intel.com
Cc: linux-ia64@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kernel Janitors List <kernel-janitors@lists.osdl.org>
Subject: [KJ][PATCH]is_power_of_2-ia64/mm/hugetlbpage.c
Date: Thu, 07 Jun 2007 10:09:46 +0000	[thread overview]
Message-ID: <1181210266.11218.3.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/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 1346b7f..d22861c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
 #include <linux/pagemap.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
+#include <linux/log2.h>
 #include <asm/mman.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
@@ -182,7 +183,7 @@ static int __init hugetlb_setup_sz(char *str)
 		tr_pages = 0x15557000UL;
 
 	size = memparse(str, &str);
-	if (*str || (size & (size-1)) || !(tr_pages & size) ||
+	if (*str || !is_power_of_2(size) || !(tr_pages & size) ||
 		size <= PAGE_SIZE ||
 		size >= (1UL << PAGE_SHIFT << MAX_ORDER)) {
 		printk(KERN_WARNING "Invalid huge page size specified\n");

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


WARNING: multiple messages have this Message-ID (diff)
From: vignesh babu <vignesh.babu@wipro.com>
To: tony.luck@intel.com, rohit.seth@intel.com, kenneth.w.chen@intel.com
Cc: linux-ia64@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kernel Janitors List <kernel-janitors@lists.osdl.org>
Subject: [KJ][PATCH]is_power_of_2-ia64/mm/hugetlbpage.c
Date: Thu, 07 Jun 2007 15:27:46 +0530	[thread overview]
Message-ID: <1181210266.11218.3.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/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 1346b7f..d22861c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
 #include <linux/pagemap.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
+#include <linux/log2.h>
 #include <asm/mman.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
@@ -182,7 +183,7 @@ static int __init hugetlb_setup_sz(char *str)
 		tr_pages = 0x15557000UL;
 
 	size = memparse(str, &str);
-	if (*str || (size & (size-1)) || !(tr_pages & size) ||
+	if (*str || !is_power_of_2(size) || !(tr_pages & size) ||
 		size <= PAGE_SIZE ||
 		size >= (1UL << PAGE_SHIFT << MAX_ORDER)) {
 		printk(KERN_WARNING "Invalid huge page size specified\n");

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


WARNING: multiple messages have this Message-ID (diff)
From: vignesh babu <vignesh.babu@wipro.com>
To: tony.luck@intel.com, rohit.seth@intel.com, kenneth.w.chen@intel.com
Cc: linux-ia64@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kernel Janitors List <kernel-janitors@lists.osdl.org>
Subject: [KJ][PATCH]is_power_of_2-ia64/mm/hugetlbpage.c
Date: Thu, 07 Jun 2007 15:27:46 +0530	[thread overview]
Message-ID: <1181210266.11218.3.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/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index 1346b7f..d22861c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -15,6 +15,7 @@
 #include <linux/pagemap.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
+#include <linux/log2.h>
 #include <asm/mman.h>
 #include <asm/pgalloc.h>
 #include <asm/tlb.h>
@@ -182,7 +183,7 @@ static int __init hugetlb_setup_sz(char *str)
 		tr_pages = 0x15557000UL;
 
 	size = memparse(str, &str);
-	if (*str || (size & (size-1)) || !(tr_pages & size) ||
+	if (*str || !is_power_of_2(size) || !(tr_pages & size) ||
 		size <= PAGE_SIZE ||
 		size >= (1UL << PAGE_SHIFT << MAX_ORDER)) {
 		printk(KERN_WARNING "Invalid huge page size specified\n");

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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2007-06-07 10:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07  9:57 vignesh babu [this message]
2007-06-07 10:09 ` [KJ][PATCH]is_power_of_2-ia64/mm/hugetlbpage.c vignesh babu
2007-06-07 10:09 ` [KJ][PATCH]is_power_of_2-ia64/mm/hugetlbpage.c vignesh babu
2007-06-07  9:57 ` [KJ][PATCH]is_power_of_2-ia64/mm/hugetlbpage.c vignesh babu

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=1181210266.11218.3.camel@merlin.linuxcoe.com \
    --to=vignesh.babu@wipro.com \
    --cc=kenneth.w.chen@intel.com \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rohit.seth@intel.com \
    --cc=tony.luck@intel.com \
    /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 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.