All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Hugh Dickins <hughd@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
	Alex Shi <alex.shi@linux.alibaba.com>,
	Minchan Kim <minchan@kernel.org>, Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mmap: replace if (cond) BUG() with BUG_ON()
Date: Wed, 6 Jan 2021 12:42:23 -0800	[thread overview]
Message-ID: <20210106124223.587b93e5fdfd6a1a5f799c16@linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.2.11.2101061213540.2492@eggly.anvils>

On Wed, 6 Jan 2021 12:18:36 -0800 (PST) Hugh Dickins <hughd@google.com> wrote:

> On Wed, 6 Jan 2021, Andrea Arcangeli wrote:
> > 
> > I'd be surprised if the kernel can boot with BUG_ON() defined as "do
> > {}while(0)" so I guess it doesn't make any difference.
> 
> I had been afraid of that too, when CONFIG_BUG is not set:
> but I think it's actually "if (cond) do {} while (0)".

Yes, that is so.  The thinking being that in most cases the compiler
will be smart enough to avoid generating any code for `cond' anyway.


  reply	other threads:[~2021-01-06 20:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12  3:26 [PATCH] mm/zsmalloc: replace if (cond) BUG() with BUG_ON() Alex Shi
2020-12-12  3:26 ` Alex Shi
2020-12-12  3:26 ` [PATCH] mm/mmap: " Alex Shi
2020-12-12  3:26   ` Alex Shi
2020-12-12  3:52   ` Alex Shi
2020-12-12  3:52     ` Alex Shi
2021-01-06  4:28     ` Hugh Dickins
2021-01-06  8:40       ` Alex Shi
2021-01-06 19:46       ` Andrew Morton
2021-01-06 20:09         ` Andrea Arcangeli
2021-01-06 20:18           ` Hugh Dickins
2021-01-06 20:42             ` Andrew Morton [this message]
2021-01-07 17:28             ` Vlastimil Babka
2021-01-07 17:36               ` Andrea Arcangeli
2021-01-07 17:45                 ` Vlastimil Babka
2021-01-06 20:10         ` Hugh Dickins
2021-01-07  8:33           ` Michal Hocko
2020-12-21 16:41 ` [PATCH] mm/zsmalloc: " Minchan Kim

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=20210106124223.587b93e5fdfd6a1a5f799c16@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aarcange@redhat.com \
    --cc=alex.shi@linux.alibaba.com \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=minchan@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.