All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Knutsson <ricknu-0@student.ltu.se>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH 1/5] moving to is_power_of_2
Date: Fri, 16 Feb 2007 07:47:06 +0000	[thread overview]
Message-ID: <45D5617A.7070106@student.ltu.se> (raw)
In-Reply-To: <1171605222.27506.74.camel@wriver-t81fb058.linuxcoe>

Vignesh Babu BM wrote:
> Removing instances of (n&(n-1)) for power of 2 
> check with is_power_of_2 from linux/log.h.
>   
As has been stated in this m-l before: is_power_of_2 is also non-zero.
>
>
> Signed-off-by: vignesh babu <vignesh.babu@wipro.com>
> ---
>   
[snip]
> diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
> index 0c7e94e..4fc6887 100644
> --- a/arch/ia64/mm/hugetlbpage.c
> +++ b/arch/ia64/mm/hugetlbpage.c
> @@ -16,6 +16,7 @@
>  #include <linux/smp_lock.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>
> @@ -175,7 +176,8 @@ 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 || (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");
>   

I don't think this line is correct by the reason said above and what is 
the deal with the _C++_ commentary?
One of the "golden rules" with patches is: it should only doing one 
thing and do it right. You are only doing one thing but why comment out 
the line that you later delete? If I understand it correctly, you 
patch-serie of 5 only need to be 2. (Makes it simpler to add/remove).

cu :)
Richard Knutsson

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

  reply	other threads:[~2007-02-16  7:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-16  6:05 [KJ] [PATCH 1/5] moving to is_power_of_2 Vignesh Babu BM
2007-02-16  7:47 ` Richard Knutsson [this message]
2007-02-16  8:14 ` Darren Jenkins
2007-02-16  8:32 ` Vignesh Babu BM
2007-02-16  9:02 ` Vignesh Babu BM
2007-02-16  9:20 ` Robert P. J. Day
2007-02-16  9:25 ` Robert P. J. Day
2007-02-16  9:26 ` Robert P. J. Day
2007-02-16  9:46 ` Richard Knutsson
2007-02-16 10:07 ` Vignesh Babu BM

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=45D5617A.7070106@student.ltu.se \
    --to=ricknu-0@student.ltu.se \
    --cc=kernel-janitors@vger.kernel.org \
    /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.