All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua>
To: Adrian Bunk <bunk@fs.tum.de>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch][3/3] mm/ BUG -> BUG_ON conversions
Date: Sat, 28 Aug 2004 19:32:05 +0300	[thread overview]
Message-ID: <200408281932.05964.vda@port.imtp.ilyichevsk.odessa.ua> (raw)
In-Reply-To: <20040828151837.GD12772@fs.tum.de>

On Saturday 28 August 2004 18:18, Adrian Bunk wrote:
> The patch below does BUG -> BUG_ON conversions in mm/ .
>
> diffstat output:
>  mm/bootmem.c    |    6 ++----
>  mm/filemap.c    |    6 ++----
>  mm/highmem.c    |   15 +++++----------
>  mm/memory.c     |   12 ++++--------
>  mm/mempool.c    |    5 +++--
>  mm/mmap.c       |   12 ++++--------
>  mm/mprotect.c   |    3 +--
>  mm/msync.c      |    3 +--
>  mm/page_alloc.c |    3 +--
>  mm/pdflush.c    |    3 +--
>  mm/shmem.c      |    3 +--
>  mm/slab.c       |   30 ++++++++++--------------------
>  mm/swap.c       |   12 ++++--------
>  mm/swap_state.c |    6 ++----
>  mm/swapfile.c   |    6 ++----
>  mm/vmalloc.c    |    3 +--
>  mm/vmscan.c     |   18 ++++++------------
>  17 files changed, 50 insertions(+), 96 deletions(-)
>
>
> Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
>
> --- linux-2.6.9-rc1-mm1-full-3.4/mm/bootmem.c.old	2004-08-28
> 16:25:18.000000000 +0200 +++
> linux-2.6.9-rc1-mm1-full-3.4/mm/bootmem.c	2004-08-28 16:26:48.000000000
> +0200 @@ -125,8 +125,7 @@
>  	sidx = start - (bdata->node_boot_start/PAGE_SIZE);
>
>  	for (i = sidx; i < eidx; i++) {
> -		if (unlikely(!test_and_clear_bit(i, bdata->node_bootmem_map)))
> -			BUG();
> +		BUG_ON(!test_and_clear_bit(i, bdata->node_bootmem_map));
>  	}
>  }
>
> @@ -246,8 +245,7 @@
>  	 * Reserve the area now:
>  	 */
>  	for (i = start; i < start+areasize; i++)
> -		if (unlikely(test_and_set_bit(i, bdata->node_bootmem_map)))
> -			BUG();
> +		BUG_ON(test_and_set_bit(i, bdata->node_bootmem_map));

BUG_ON is like assert(). It may be #defined to nothing.
Do not place expression with side effects into it.
--
vda


  reply	other threads:[~2004-08-28 16:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-28 15:11 [2.6 patch][0/3] BUG -> BUG_ON conversions Adrian Bunk
2004-08-28 15:15 ` [2.6 patch][1/3] ipc/ " Adrian Bunk
2004-08-28 16:05   ` Kyle Moffett
2004-08-28 16:26     ` Adrian Bunk
2004-08-28 16:50       ` Michael Buesch
2004-08-28 19:58       ` Andrew Morton
2004-08-28 20:22         ` Adrian Bunk
2004-08-28 20:59         ` Jens Axboe
2004-08-28 21:43         ` Matt Mackall
2004-08-28 15:17 ` [2.6 patch][2/3] kernel/ " Adrian Bunk
2004-08-28 16:09   ` Kyle Moffett
2004-08-28 15:18 ` [2.6 patch][3/3] mm/ " Adrian Bunk
2004-08-28 16:32   ` Denis Vlasenko [this message]
2004-08-28 20:58     ` Jens Axboe
2004-08-28 21:24       ` Adrian Bunk
2004-08-29 12:03         ` Jens Axboe
2004-08-29 12:18           ` Oliver Neukum
2004-08-29 13:01             ` Jens Axboe
2004-08-29 13:50               ` Adrian Bunk
2004-08-29 14:08                 ` Jens Axboe

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=200408281932.05964.vda@port.imtp.ilyichevsk.odessa.ua \
    --to=vda@port.imtp.ilyichevsk.odessa.ua \
    --cc=akpm@osdl.org \
    --cc=bunk@fs.tum.de \
    --cc=linux-kernel@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.