lkml.org 
[lkml]   [2008]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] handle failure of irqchip->set_type in setup_irq
On Fri, 4 Jul 2008 20:43:07 +0200 Uwe Kleine-K__nig <Uwe.Kleine-Koenig@digi.com> wrote:

> > I wonder if we can do better.
> > Let me think about that.
> I was about to suggest something like:
>
> /* WARNING: this returns a static pointer, so you cannot use the
> * returned value after another call to creative_function_name
> */
> char *creative_function_name(void *addr)
> {
> static char buf[SOME_LENGTH];
>
> ... format symbol name into buf ...
>
> return buf;
> }
>
> Then I could have used
>
> pr_err("setting flow type for irq %u failed (%s)\n",
> irq, creative_function_name(chip->set_type));
>
> which looks definitely nicer.

Better would be

char buf[ENOUGH /* rofl */];

pr_err("setting flow type for irq %u failed (%s)\n",
irq, render_function_name(buf, chip->set_type));

However I'm presently brewing up a plot to do this:

printk("function name is %Ss\n", (unsigned long *)chip->set_type);

which I think will work. We can also do

printk("IP address is %Si\n", (unsigned long *)ip_address_buffer);

to replace NIPQUAD. And similar printk extensions.

Am still thinking about it though.


\
 
 \ /
  Last update: 2008-07-04 21:11    [W:0.073 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site