[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1233239152.4035.3.camel@johannes.local>
Date: Thu, 29 Jan 2009 15:25:52 +0100
From: Johannes Berg <johannes@...solutions.net>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
Linux Kernel list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] timer: implement lockdep deadlock detection
On Thu, 2009-01-29 at 14:38 +0100, Peter Zijlstra wrote:
> On Wed, 2009-01-28 at 19:06 +0100, Johannes Berg wrote:
>
> > +/*
> > + * All the indirection here is required to build the
> > + * "<file>:<line>" string and the pointer to it.
> > + */
> > +#define ___TIMER_INITIALIZER(_fn, _exp, _dat, _kn) \
> > + ____TIMER_INITIALIZER(_fn, _exp, _dat, (_kn), &(_kn))
> > +#define __TIMER_INITIALIZER(_fn, _exp, _dat, _f, _c, _l) \
> > + ___TIMER_INITIALIZER(_fn, _exp, _dat, _f # _c # _l)
> > +#define _TIMER_INITIALIZER(_fn, _exp, _dat, _f, _l) \
> > + __TIMER_INITIALIZER(_fn, _exp, _dat, _f, :, _l)
> > +#define TIMER_INITIALIZER(_function, _expires, _data) \
> > + _TIMER_INITIALIZER(_function, _expires, _data, __FILE__, __LINE__)
>
> The regular way to write that would be:
>
> #define __STR(foo) #foo
> #define STR(foo) __STR(foo)
>
> __FILE__ ":" STR(__LINE__)
>
> I'm sure I saw that stringify thing somewhere in the kernel before, but
> can't find it. I recently added it to lockdep.c, maybe we should add it
> to kernel.h ?
Ohh, hmm, my cpp could be stronger :) I'll try out with stringify and
send a complete v4.
johannes
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists