All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next-2.6] bonding: remove unused macro "pr_fmt""
@ 2010-06-21 19:34 Jiri Pirko
  2010-06-21 20:38 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2010-06-21 19:34 UTC (permalink / raw)
  To: netdev; +Cc: davem


Signed-off-by: Jiri Pirko <jpirko@redhat.com>

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a95a41b..e079117 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -31,8 +31,6 @@
  *
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next-2.6] bonding: remove unused macro "pr_fmt""
  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
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2010-06-21 20:38 UTC (permalink / raw)
  To: jpirko; +Cc: netdev

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 :-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next-2.6] bonding: remove unused macro "pr_fmt""
  2010-06-21 20:38 ` David Miller
@ 2010-06-21 20:44   ` Jiri Pirko
  2010-06-21 21:22     ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Jiri Pirko @ 2010-06-21 20:44 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

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.

>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next-2.6] bonding: remove unused macro "pr_fmt""
  2010-06-21 20:44   ` Jiri Pirko
@ 2010-06-21 21:22     ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2010-06-21 21:22 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: David Miller, netdev

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, ...) \



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-21 21:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.