All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@kernel.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: if(function()) BUG(); still bad?
Date: Mon, 03 Dec 2007 01:18:35 +0000	[thread overview]
Message-ID: <20071203011835.GQ15974@stusta.de> (raw)
In-Reply-To: <47534BC4.1020701@tiscali.nl>

On Sun, Dec 02, 2007 at 05:32:22PM -0700, Matthew Wilcox wrote:
> On Mon, Dec 03, 2007 at 01:20:20AM +0100, Roel Kluin wrote:
> > for instance in a patch I saw this:
> > 
> > > +		if (__blk_end_request(rq, 0, 0))
> > > +			BUG();
> > >  		spin_unlock(q->queue_lock);
> > 
> > If it's still bad, what should the fix be? (I'll write a script and post
> > patches)
> 
> This one should not be converted to a BUG_ON.  We always want to call
> __blk_end_request(), whether we have CONFIG_BUG or not.  This case just
> wants to test the return value.

It can be converted, the empty BUG_ON() in include/asm-generic/bug.h 
handles it with

  #define BUG_ON(condition) do { if (condition) ; } while(0)


cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  parent reply	other threads:[~2007-12-03  1:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-03  0:20 if(function()) BUG(); still bad? Roel Kluin
2007-12-03  0:32 ` Matthew Wilcox
2007-12-03  0:40 ` Roel Kluin
2007-12-03  1:18 ` Adrian Bunk [this message]
2007-12-03  2:48 ` Matthew Wilcox

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=20071203011835.GQ15974@stusta.de \
    --to=bunk@kernel.org \
    --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.