Re: [PATCH] mm/mmap: replace if (cond) BUG() with BUG_ON()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 6 Jan 2021 12:18:36 -0800 (PST) Hugh Dickins <hughd@xxxxxxxxxx> 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.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux