lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 1 Oct 2009 13:02:19 +0200
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Sam Ravnborg <sam@...nborg.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] move #define pr_fmt KBUILD_MODNAME and KMSG_COMPONENT to
 Makefiles?

On Wed, 30 Sep 2009 07:52:58 -0700
Joe Perches <joe@...ches.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@...ches.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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ