From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Joe Perches <joe@perches.com>
Cc: Sam Ravnborg <sam@ravnborg.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] move #define pr_fmt KBUILD_MODNAME and KMSG_COMPONENT to Makefiles?
Date: Thu, 1 Oct 2009 13:02:19 +0200 [thread overview]
Message-ID: <20091001130219.7f0db35d@mschwide.boeblingen.de.ibm.com> (raw)
In-Reply-To: <1254322378.2960.86.camel@Joe-Laptop.home>
On Wed, 30 Sep 2009 07:52:58 -0700
Joe Perches <joe@perches.com> wrote:
> On Wed, 2009-09-30 at 11:20 +0200, Martin Schwidefsky wrote:
> > On Wed, 30 Sep 2009 00:54:59 -0700
> > Joe Perches <joe@perches.com> wrote:
> > > If something like were added to a module Makefile:
> > > ccflags-y += -D "pr_fmt(fmt)=KBUILD_MODNAME \": \" fmt"
> >
> > Where is the difference between the definition of the macro in the
> > source file? It's still one additional line, no?
>
> Look at net/netfilter/ipvs for instance.
>
> It would have been possible to add:
>
> ccflags-y += -D "KMSG_COMPONENT=IPVS"
> ccflags-y += -D "pr_fmt(fmt)=KMSG_COMPONENT \": \" fmt"
>
> to net/netfilter/ipvs/Makefile instead of adding it
> to 23 files.
That can make sense if you have lots of files that use the same
KMSG_COMPONENT.
> Same sort of thing for drivers/s390/char/Makefile,
> though it's less beneficial there.
>
> Multiple
> CFLAGS_foo.o += -D "KMSG_COMPONENT=foo"
> and a single
> ccflags-y += -D "pr_fmt(fmt)=KMSG_COMPONENT \": \" fmt"
>
> > And if you are dreaming of converting all source files
> > to the pr_fmt mechanism, this is a big effort ..
>
> I think it could be a useful mechanism to define pr_fmt
> for individual module Makefiles and there's no rush...
If you need multiple
CFLAGS_foo.o += -D "KMSG_COMPONENT=foo"
lines the benefit of the Makfile method is limited. In general I find
the code to be less clear if I have to search for the message prefix in
the Makefile instead of the start of the C file. Personal preference I
guess.
--
blue skies,
Martin.
"Reality continues to ruin my life." - Calvin.
prev parent reply other threads:[~2009-10-01 11:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 18:15 Joe Perches
2009-09-30 6:55 ` Sam Ravnborg
2009-09-30 7:54 ` Joe Perches
2009-09-30 9:20 ` Martin Schwidefsky
2009-09-30 14:52 ` Joe Perches
2009-10-01 11:02 ` Martin Schwidefsky [this message]
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=20091001130219.7f0db35d@mschwide.boeblingen.de.ibm.com \
--to=schwidefsky@de.ibm.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®