Re: [patch 2/3] Add a WARN() macro; this is WARN_ON() + printk arguments

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Vegard Nossum
Date: Tuesday, May 6, 2008 - 11:41 pm

Hi!

On Wed, May 7, 2008 at 8:21 AM, Arjan van de Ven <arjan@infradead.org> wrote:

[...]


Is there a good reason why this is not a static inline function? If
I've understood correctly, we want to turn as many macros as possible
into functions, and I don't see an immediate reason why this one can't
be one.


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.

OTOH, why can't you use __FUNCTION__ or __func__ to determine the
caller (in WARN) rather than doing it here, at run-time? If it's to
save space (or something like that), I think it should be documented?



Vegard

-- 
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
	-- E. W. Dijkstra, EWD1036
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/3] Rename WARN() to WARNING() to clear the namespace, Arjan van de Ven, (Tue May 6, 11:20 pm)
[patch 3/3] Example use of WARN(), Arjan van de Ven, (Tue May 6, 11:21 pm)
Re: [patch 2/3] Add a WARN() macro; this is WARN_ON() + pr ..., Vegard Nossum, (Tue May 6, 11:41 pm)
Re: [patch 3/3] Example use of WARN(), Andrew Morton, (Tue May 13, 9:36 pm)
Re: [patch 3/3] Example use of WARN(), Arjan van de Ven, (Tue May 13, 9:51 pm)
Re: [patch 3/3] Example use of WARN(), Arjan van de Ven, (Wed May 14, 8:43 pm)