public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Dushistov <dushistov@mail.ru>
To: vignesh babu <vignesh.babu@wipro.com>, akpm@linux-foundation.org
Cc: daniel.pirkl@email.cz,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kernel Janitors List <kernel-janitors@lists.osdl.org>
Subject: Re: [PATCH]is_power_of_2-ufs/super.c
Date: Thu, 14 Jun 2007 21:50:59 +0400	[thread overview]
Message-ID: <20070614175059.GA11508@rain> (raw)
In-Reply-To: <1181808559.2474.9.camel@merlin.linuxcoe.com>

On Thu, Jun 14, 2007 at 01:39:18PM +0530, vignesh babu wrote:
> 
> 
> 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>

Acked-by: Evgeniy Dushistov <dushistov@mail.ru>

> --- 
> diff --git a/fs/ufs/super.c b/fs/ufs/super.c
> index 22ff6ed..2b30116 100644
> --- a/fs/ufs/super.c
> +++ b/fs/ufs/super.c
> @@ -87,6 +87,7 @@
>  #include <linux/smp_lock.h>
>  #include <linux/buffer_head.h>
>  #include <linux/vfs.h>
> +#include <linux/log2.h>
>  
>  #include "swab.h"
>  #include "util.h"
> @@ -854,7 +855,7 @@ magic_found:
>  	uspi->s_fmask = fs32_to_cpu(sb, usb1->fs_fmask);
>  	uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift);
>  
> -	if (uspi->s_fsize & (uspi->s_fsize - 1)) {
> +	if (!is_power_of_2(uspi->s_fsize)) {
>  		printk(KERN_ERR "ufs_read_super: fragment size %u is not a power of 2\n",
>  			uspi->s_fsize);
>  			goto failed;
> @@ -869,7 +870,7 @@ magic_found:
>  			uspi->s_fsize);
>  		goto failed;
>  	}
> -	if (uspi->s_bsize & (uspi->s_bsize - 1)) {
> +	if (!is_power_of_2(uspi->s_bsize)) {
>  		printk(KERN_ERR "ufs_read_super: block size %u is not a power of 2\n",
>  			uspi->s_bsize);
>  		goto failed;
> 
> -- 
> Vignesh Babu BM 
> _____________________________________________________________ 
> "Why is it that every time I'm with you, makes me believe in magic?"
> 
> 
> 
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 
> 
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>  
> www.wipro.com

-- 
/Evgeniy


  reply	other threads:[~2007-06-14 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-14  8:09 [PATCH]is_power_of_2-ufs/super.c vignesh babu
2007-06-14 17:50 ` Evgeniy Dushistov [this message]
2007-06-25 12:13 ` [PATCH]is_power_of_2-ufs/super.c Johannes Weiner
2007-06-25 12:21   ` [PATCH]is_power_of_2-ufs/super.c vignesh babu
2007-06-25 12:27   ` [PATCH]is_power_of_2-ufs/super.c Robert P. J. Day

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=20070614175059.GA11508@rain \
    --to=dushistov@mail.ru \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.pirkl@email.cz \
    --cc=kernel-janitors@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vignesh.babu@wipro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox