Re: [patch 1/3] move WARN_ON() out of line

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Arjan van de Ven <arjan@...>
Cc: <linux-kernel@...>, Ingo Molnar <mingo@...>, Andrew Morton <akpm@...>
Date: Saturday, January 5, 2008 - 1:09 am

Arjan van de Ven пишет:

Isn't this going to print "panic.c" for __FILE__, "do_warn_on" for __FUNCTION__
and whatever line number you have there for __LINE__? I put up a userspace equivalent
of what you're doing here, which confirms my suspision:

dmvo@cipher:/tmp$ cat c.c
#include <stdio.h>

#define WARN_ON(condition) do_warn_on((unsigned long)(condition), __FILE__, \
                        __LINE__, __FUNCTION__)

int do_warn_on(const unsigned long condition, const char *file,
                const int line, const char *function)
{
        if (condition) {
                printf("WARNING: at %s:%d %s()\n",
                                __FILE__, __LINE__, __FUNCTION__);
        }
        return !!condition;
}

int main()
{
        WARN_ON(1);
        return 0;
}
dmvo@cipher:/tmp$ cc c.c
dmvo@cipher:/tmp$ ./a.out
WARNING: at c.c:11 do_warn_on()
dmvo@cipher:/tmp$

I think that your intention was to propagate the parameters to the do_warn_on() routine
to the printk() call, right?


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Wed Jan 2, 8:56 pm)
Re: [patch 1/3] move WARN_ON() out of line, Jeremy Fitzhardinge, (Sat Jan 5, 2:41 am)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Sat Jan 5, 2:01 pm)
Re: [patch 1/3] move WARN_ON() out of line, Jeremy Fitzhardinge, (Sat Jan 5, 2:45 pm)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Sat Jan 5, 4:02 pm)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Sat Jan 5, 2:08 pm)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Sat Jan 5, 2:37 pm)
Re: [patch 1/3] move WARN_ON() out of line, Dmitri Vorobiev, (Sat Jan 5, 1:09 am)
Re: [patch 1/3] move WARN_ON() out of line, Pekka Enberg, (Thu Jan 3, 7:20 am)
Re: [patch 1/3] move WARN_ON() out of line, Ingo Molnar, (Thu Jan 3, 5:25 am)
Re: [patch 1/3] move WARN_ON() out of line, Jeremy Fitzhardinge, (Sat Jan 5, 2:42 am)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Thu Jan 3, 12:22 pm)
Re: [patch 1/3] move WARN_ON() out of line, Olof Johansson, (Thu Jan 3, 12:58 am)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Thu Jan 3, 5:03 pm)
Re: [patch 1/3] move WARN_ON() out of line, Matt Mackall, (Wed Jan 2, 9:59 pm)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Thu Jan 3, 5:06 pm)
Re: [patch 1/3] move WARN_ON() out of line, Herbert Xu, (Fri Jan 4, 10:35 pm)
Re: [patch 1/3] move WARN_ON() out of line, Arjan van de Ven, (Sat Jan 5, 2:33 pm)