All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Bhumika Goyal <bhumirks@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: lustre: lmv: Remove unneeded do-while(0)
Date: Mon, 15 Feb 2016 20:41:47 -0800	[thread overview]
Message-ID: <20160216044147.GA28814@kroah.com> (raw)
In-Reply-To: <1455533899-17270-1-git-send-email-bhumirks@gmail.com>

On Mon, Feb 15, 2016 at 04:28:19PM +0530, Bhumika Goyal wrote:
> do {} while (0) wrapper in a single statement macro is unneeded.

Are you sure?  You can easly break code by changing this.

> Also its ok to keep empty #define here to avoid "statement with
> no effect" warning.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>  drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> index 733222c..7a31bd6 100644
> --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> @@ -2147,7 +2147,7 @@ static void lmv_adjust_dirpages(struct page **pages, int ncfspgs, int nlupgs)
>  	LASSERTF(nlupgs == 0, "left = %d", nlupgs);
>  }
>  #else
> -#define lmv_adjust_dirpages(pages, ncfspgs, nlupgs) do {} while (0)
> +#define lmv_adjust_dirpages(pages, ncfspgs, nlupgs)

That's scary, please leave it alone, unless you audited all users of
this call?  Hint, think about if this call was used as the result of an
if() statement?

thanks,

greg k-h


  reply	other threads:[~2016-02-16  4:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15 10:58 [PATCH] Staging: lustre: lmv: Remove unneeded do-while(0) Bhumika Goyal
2016-02-16  4:41 ` Greg KH [this message]
2016-02-16  5:01   ` [Outreachy kernel] " Bhumika Goyal

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=20160216044147.GA28814@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bhumirks@gmail.com \
    --cc=outreachy-kernel@googlegroups.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.