All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Lightweight patch manager <patch@luckynet.dynu.com>
Cc: andrea@suse.de, linux-kernel@vger.kernel.org
Subject: Re: BUG_ON(x) instead of if (x) BUG() in mm/page_alloc,swap_state.c
Date: Mon, 01 Jul 2002 10:40:17 -0700	[thread overview]
Message-ID: <3D209401.C89C6EE4@zip.com.au> (raw)
In-Reply-To: 200207011231.g61CVJLX026313@hawkeye.luckynet.adm

Lightweight patch manager wrote:
> 
> This replaces if(x) BUG() with BUG_ON(x) where necessarry, at least in
> mm/page_alloc.c and mm/swap_state.c

Thanks - I'll add to my pile.

> ...
> -                       if (!nr_pages--)
> -                               BUG();
> +                       BUG_ON(!nr_pages--)

Except for this chunk.  It's best to avoid putting statements
with side-effects inside BUG_ON().  If someone wants to build
a super-small kernel with a no-op BUG_ON() then code such as the
above will cause it to fail.

It'll probably fail anyway, but hey - may as well try.

-

      reply	other threads:[~2002-07-01 17:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-01 12:31 BUG_ON(x) instead of if (x) BUG() in mm/page_alloc,swap_state.c Lightweight patch manager
2002-07-01 17:40 ` Andrew Morton [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=3D209401.C89C6EE4@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patch@luckynet.dynu.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.