public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jiri Pirko <jpirko@redhat.com>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] bonding: remove unused macro "pr_fmt""
Date: Mon, 21 Jun 2010 14:22:36 -0700	[thread overview]
Message-ID: <1277155356.1775.208.camel@Joe-Laptop.home> (raw)
In-Reply-To: <20100621204411.GL2656@psychotron.bos.redhat.com>

On Mon, 2010-06-21 at 22:44 +0200, Jiri Pirko wrote:
> Mon, Jun 21, 2010 at 10:38:06PM CEST, davem@davemloft.net wrote:
> >From: Jiri Pirko <jpirko@redhat.com>
> >Date: Mon, 21 Jun 2010 21:34:06 +0200
> >> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
> >> -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >Jiri, it is used by every single pr_*() logging call made
> >in this file.
> >I was hoping that this facilty and the voluminous amounty of pervasive
> >usage of this in the networking drivers nowadays would make it
> >familiar to active hackers like you :-)
> 
> Ough, right, missed that. That's just strange. I don't like this.

At some point in the future, this

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

should be the default in kernel.h and only files that
want to change the setting should add it.

Then all the current uses (~175) in the rest of the
sources would be superfluous and could be removed.

I've plans to eventually convert the pr_<level> macros
to functions  using a vsnprintf %pV mechanism.

see: http://lkml.org/lkml/2010/3/5/33

The KBUILD_MODNAME could also be emitted by the
pr_<level> functions rather than stored in
the format string to save quite a bit of text.

Something like below would be a start:

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 8317ec4..41544c8 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -378,7 +378,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
 extern int hex_to_bin(char ch);
 
 #ifndef pr_fmt
-#define pr_fmt(fmt) fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 #endif
 
 #define pr_emerg(fmt, ...) \



      reply	other threads:[~2010-06-21 21:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21 19:34 [PATCH net-next-2.6] bonding: remove unused macro "pr_fmt"" Jiri Pirko
2010-06-21 20:38 ` David Miller
2010-06-21 20:44   ` Jiri Pirko
2010-06-21 21:22     ` Joe Perches [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=1277155356.1775.208.camel@Joe-Laptop.home \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=jpirko@redhat.com \
    --cc=netdev@vger.kernel.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