All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH option A] bcma: use custom printing functions
@ 2012-06-28 19:44 Rafał Miłecki
  2012-06-28 19:48 ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Rafał Miłecki @ 2012-06-28 19:44 UTC (permalink / raw)
  To: linux-wireless, Joe Perches, Hauke Mehrtens; +Cc: Rafał Miłecki

Having bus number printed makes it much easier to anaylze logs on
systems with more buses. For example Netgear WNDR4500 has 3 AMBA buses
in total, which makes standard log really messy.
---
This patch (option A) keeps using pr_<level> in custom functions.

Pros: We use prefered functions (pr_<level>) in custom functions
Cons: Sometimes we may need to call pr_<level> directly. We won't get
	messages prefixed then (because of not setting pr_fmt).
---
 drivers/bcma/bcma_private.h |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index b81755b..1f638c5 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -1,10 +1,6 @@
 #ifndef LINUX_BCMA_PRIVATE_H_
 #define LINUX_BCMA_PRIVATE_H_
 
-#ifndef pr_fmt
-#define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt
-#endif
-
 #include <linux/bcma/bcma.h>
 #include <linux/delay.h>
 
@@ -12,6 +8,11 @@
 
 struct bcma_bus;
 
+#define bcma_err(fmt, ...) \
+	pr_err(KBUILD_MODNAME "-%d: " fmt, bus->num, ##__VA_ARGS__)
+#define bcma_info(fmt, ...) \
+	pr_info(KBUILD_MODNAME "-%d: " fmt, bus->num, ##__VA_ARGS__)
+
 /* main.c */
 int __devinit bcma_bus_register(struct bcma_bus *bus);
 void bcma_bus_unregister(struct bcma_bus *bus);
-- 
1.7.7


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

end of thread, other threads:[~2012-06-28 21:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 19:44 [PATCH option A] bcma: use custom printing functions Rafał Miłecki
2012-06-28 19:48 ` Johannes Berg
2012-06-28 19:56   ` Rafał Miłecki
2012-06-28 20:05     ` Joe Perches
2012-06-28 20:18       ` Rafał Miłecki
2012-06-28 20:29         ` Hauke Mehrtens
2012-06-28 20:42           ` Rafał Miłecki
2012-06-28 21:09         ` Joe Perches
2012-06-28 20:48       ` Rafał Miłecki

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.