lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080507063720.7aa1baf7@infradead.org>
Date:	Wed, 7 May 2008 06:37:20 -0700
From:	Arjan van de Ven <arjan@...radead.org>
To:	"Vegard Nossum" <vegard.nossum@...il.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Subject: Re: [patch 2/3] Add a WARN() macro; this is WARN_ON() + printk
 arguments

On Wed, 7 May 2008 08:41:31 +0200
"Vegard Nossum" <vegard.nossum@...il.com> wrote:

> Hi!
> 
> On Wed, May 7, 2008 at 8:21 AM, Arjan van de Ven
> <arjan@...radead.org> wrote:
> > Subject: Add a WARN() macro; this is WARN_ON() + printk arguments
> >  From: Arjan van de Ven <arjan@...ux.intel.com>
> >
> >  Add a WARN() macro that acts like WARN_ON(), with the added
> > feature that it takes a printk like argument that is printed as
> > part of the warning message.
> 
> [...]
> 
> >  +#ifndef WARN
> >  +#define WARN(condition, format...)
> > ({                                          \
> >  +       int __ret_warn_on
> > = !!(condition);                              \
> >  +       if
> > (unlikely(__ret_warn_on))                                    \
> >  +
> > __WARN_printf(format);                                  \
> >  +
> > unlikely(__ret_warn_on);                                        \
> > +}) +#endif
> 
> Is there a good reason why this is not a static inline function? 

yes there is, and it's the same one that makes WARN_ON() not an inline
function (I tried); it's not possible to find a type for "condition"
that works for all callers.

> If WARN() is made a static inline, you can call
> __builtin_return_address(0) there and pass it into here instead. This
> seems like a kind of low-level internal function anyway, because of
> the file/line info.

if I could make it a static inline, I would make it an out of line
instead to save space ;)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ