All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [Patch 8/9] BUG_ON() Conversion in md/raid6main.c
Date: Thu, 26 Jan 2006 02:01:33 +0000	[thread overview]
Message-ID: <20060126020133.GA22929@kroah.com> (raw)
In-Reply-To: <1138233643.7232.45.camel@alice>

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

On Thu, Jan 26, 2006 at 02:25:07AM +0100, Eric Sesterhenn / snakebyte wrote:
> hi,
> 
> > >  this changes if() BUG(); constructs to BUG_ON() which is
> > >  cleaner and can better optimized away
> > > 
> > gcc optimizes them away if BUG() is not defined, so this is not a true
> > statement.
> 
> if BUG() is defined to nothing it still leaves the if, which must be optimized
> away by the compiler, not by the preprocessor

"gcc" is the compiler, not the preprocessor, like I stated :)

And gcc does this for you, have you looked?

> > > -		if (!list_empty(&sh->lru))
> > > -			BUG();
> > > -		if (atomic_read(&conf->active_stripes)==0)
> > > -			BUG();
> > > +		BUG_ON(!list_empty(&sh->lru));
> > > +		BUG_ON(atomic_read(&conf->active_stripes)==0);
> > 
> > Also, no, do not do this!
> > If BUG_ON() is turned off, then the logic changes here.
> 
> list_empty() just returns wheter the list is empty or not, so there is no logic
> change. and atomic_read() as far as i can see just reads the
> conf->active_stripes->counter value, so there is nothing changed somewhere
> and the logic still stays the same. Or did i miss something here?

Sorry, I was thinking that the atomic_read() was doing something there.

Anyway, these cleanups don't really change anything, at the code or
assembly level, so I don't see the need for them...

thanks,

greg k-h

[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

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

  parent reply	other threads:[~2006-01-26  2:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26  0:00 [KJ] [Patch 8/9] BUG_ON() Conversion in md/raid6main.c Eric Sesterhenn / snakebyte
2006-01-26  0:34 ` Greg KH
2006-01-26  0:35 ` Greg KH
2006-01-26  1:25 ` Eric Sesterhenn / snakebyte
2006-01-26  2:01 ` Greg KH [this message]
2006-01-26  2:18 ` Eric Sesterhenn / snakebyte
2006-01-26  8:11 ` Adrian Bunk
2006-01-26  8:15 ` Adrian Bunk

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=20060126020133.GA22929@kroah.com \
    --to=greg@kroah.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.