Skip to contentSkip to conversation

bluetooth: properly use pr_fmt() on lib.c

PATCH In review Luis R. Rodriguez 3 participants 3 messages Apr 24, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bluetooth: properly use pr_fmt() on lib.c

From: "Luis R. Rodriguez" <[email protected]>

pr_fmt() is either defined or we redefine it. Typically drivers define it prior to including printk.h but this is done under the assumption that no other subsystem it uses has already defined pr_fmt(). In such cases pr_fmt() should be undefined and redefined.

Doing this properly shaves down compilation time quite considerably.

---
 net/bluetooth/lib.c |    2 ++
 1 file changed, 2 insertions(+)
net/bluetooth/lib.c +2 -0
index 5066288..84ff96f 100644
@@ -24,11 +24,13 @@
 
 /* Bluetooth kernel library. */
 
+#undef pr_fmt
 #define pr_fmt(fmt) "Bluetooth: " fmt
 
 #include <linux/module.h>
 
 #include <linux/kernel.h>
+#include <linux/printk.h>
 #include <linux/stddef.h>
 #include <linux/string.h>
 #include <asm/errno.h>
Signature · 1 line
1.7.10.rc1.22.gf5241
#1 lore raw

Hi Luiz,

Quoted 8 lines · Luis R. Rodriguez

From: "Luis R. Rodriguez" <[email protected]>

pr_fmt() is either defined or we redefine it. Typically drivers define it prior to including printk.h but this is done under the assumption that no other subsystem it uses has already defined pr_fmt(). In such cases pr_fmt() should be undefined and redefined.

Quoted 7 lines

Doing this properly shaves down compilation time quite considerably.

---
 net/bluetooth/lib.c |    2 ++
 1 file changed, 2 insertions(+)

Patch has been applie, thanks.

Gustavo

maintainer
#2 lore raw

Hi Gustavo,

Quoted 9 lines
Quoted 9 lines

pr_fmt() is either defined or we redefine it. Typically drivers define it prior to including printk.h but this is done under the assumption that no other subsystem it uses has already defined pr_fmt(). In such cases pr_fmt() should be undefined and redefined.

Doing this properly shaves down compilation time quite considerably.

Quoted 6 lines
Quoted 4 lines
---
 net/bluetooth/lib.c |    2 ++
 1 file changed, 2 insertions(+)

Patch has been applie, thanks.

please get into the habit to let them know if it got applied to bluetooth tree or bluetooth-next tree or both.

Regards

Marcel