All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Monam Agarwal <monamagarwal123@gmail.com>
Cc: gregkh@linuxfoundation.org, andreas.dilger@intel.com,
	peter.p.waskiewicz.jr@intel.com, tao.peng@emc.com,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] Staging: lustre: Use of fls to find last set bit
Date: Mon, 13 Jan 2014 11:21:24 +0300	[thread overview]
Message-ID: <20140113082124.GC7444@mwanda> (raw)
In-Reply-To: <1389471351-31782-1-git-send-email-monamagarwal123@gmail.com>

On Sun, Jan 12, 2014 at 01:45:51AM +0530, Monam Agarwal wrote:
> This introduces fls in lustre/ldlm/ldlm_extent.c
> to find the last set bit.
> 
> Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
> ---
> Changes since v1:
> * Incorrect commit message
> * Use of fls function
> Changes since v2:
> * Removal of extra variable
> 
>  drivers/staging/lustre/lustre/ldlm/ldlm_extent.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
> index ac5d66a..a4f382d 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
> @@ -153,7 +153,7 @@ static inline int lock_mode_to_index(ldlm_mode_t mode)
>  
>  	LASSERT(mode != 0);
>  	LASSERT(IS_PO2(mode));
> -	for (index = -1; mode; index++, mode >>= 1) ;
> +	index = fls(mode)-1;

Put spaces around math operations.  Just cut and paste what Joe wrote.

regards,
dan carpenter


      reply	other threads:[~2014-01-13  8:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-11 11:41 [PATCH 1/2] Staging: lustre: Removal of Unnecessary white spaces Monam Agarwal
2014-01-11 17:23 ` Joe Perches
2014-01-11 19:32 ` [PATCH v2] Staging: lustre: Use of fls to find last set bit Monam Agarwal
2014-01-11 20:02   ` Joe Perches
2014-01-11 20:15   ` [PATCH v3] " Monam Agarwal
2014-01-13  8:21     ` Dan Carpenter [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=20140113082124.GC7444@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monamagarwal123@gmail.com \
    --cc=peter.p.waskiewicz.jr@intel.com \
    --cc=tao.peng@emc.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.