LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: "Johannes Weiner" <hannes@saeurebad.de>
Cc: "Alan Cox" <alan@lxorguk.ukuu.org.uk>,
	"Marc Pignat" <marc.pignat@hevs.ch>,
	wim@iguana.be, linux-kernel@vger.kernel.org
Subject: Re: [RFC, PATCH] watchdog on gpio
Date: Mon, 14 Jan 2008 08:03:29 -0500	[thread overview]
Message-ID: <8bd0f97a0801140503t484ab61clcf41f4e4ea913fe4@mail.gmail.com> (raw)
In-Reply-To: <87zlv8k1w0.fsf@saeurebad.de>

On Jan 14, 2008 7:49 AM, Johannes Weiner <hannes@saeurebad.de> wrote:
> "Mike Frysinger" <vapier.adi@gmail.com> writes:
> > wonder if we could design a printk designed for __init functions to
> > address this in a clean fashion.
> > #define init_printk(fmt, __VA_ARGS__) \
> >   do { \
> >     static const __init char __fmt[] = fmt; \
> >     printk(__fmt , ## __VA_ARGS__); \
> >   } while (0)
> >
> > (yes, i know this isnt perfect as you'd need to pass back the return
> > value of printk(), but it's an idea)
>
> How about:
>
> #define init_printk(fmt, args...) ({            \
>         static const __init char __fmt[] = fmt; \
>         printk(__fmt, args);                    \
> })
>
> Now it returns the printk result.

i wasnt really worried about that ... i was worried about other random
things i may have missed

your dropping of ## wont work as you need gcc to expand args and take
away the , in the simple 1 arg case:
init_printk("MOO");
-mike

  reply	other threads:[~2008-01-14 13:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 15:11 Marc Pignat
2008-01-10 17:14 ` Ben Dooks
2008-01-11 16:40 ` Florian Fainelli
2008-01-14  7:34   ` Marc Pignat
2008-01-14  8:08   ` Mike Frysinger
2008-01-14  8:04 ` Mike Frysinger
2008-01-14  9:03   ` Alan Cox
2008-01-14  9:28     ` Mike Frysinger
2008-01-14  9:29       ` Alan Cox
2008-01-14  9:45         ` Mike Frysinger
2008-01-14 12:14           ` Haavard Skinnemoen
2008-01-14 12:22             ` Mike Frysinger
2008-01-14 13:30               ` Haavard Skinnemoen
2008-01-14 12:49           ` Johannes Weiner
2008-01-14 13:03             ` Mike Frysinger [this message]
2008-01-14 13:56               ` printk-wrapper with sectionized string constants [was: Re: [RFC, PATCH] watchdog on gpio] Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8bd0f97a0801140503t484ab61clcf41f4e4ea913fe4@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=hannes@saeurebad.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.pignat@hevs.ch \
    --cc=wim@iguana.be \
    --subject='Re: [RFC, PATCH] watchdog on gpio' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).