All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vignesh Babu BM <vignesh.babu@wipro.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH 1/5] moving to is_power_of_2
Date: Fri, 16 Feb 2007 10:07:33 +0000	[thread overview]
Message-ID: <1171619733.4096.5.camel@wriver-t81fb058.linuxcoe> (raw)
In-Reply-To: <1171605222.27506.74.camel@wriver-t81fb058.linuxcoe>

On Fri, 2007-02-16 at 10:46 +0100, Richard Knutsson wrote:
> Vignesh Babu BM wrote:
> > On Fri, 2007-02-16 at 08:47 +0100, Richard Knutsson wrote:
> >   
> >> Vignesh Babu BM wrote:
> >>     
> >>>  
> >>>  	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");  
> >>>       

> Yes, the result (I think) will be the same, but (size & (size-1)) is 0 
> when size = 0, while !is_power_of_2(0) is true (1). So can you say (size 
> & (size-1)) was intended as !is_power_of_2?
> 

In this context I'm sure that's the reason to have (size & (size-1))

Anyway...Im sending in the new ones with changes suggested by you and
rday and cc'd to the maintainers...so that should clear up and probabbly
uncover more issues ;)

-- 
Regards,  
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.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

      parent reply	other threads:[~2007-02-16 10:07 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
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 [this message]

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=1171619733.4096.5.camel@wriver-t81fb058.linuxcoe \
    --to=vignesh.babu@wipro.com \
    --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.