From: Tilman Schmidt <tilman@imap.cc>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] usb.h: reduce syslog clutter
Date: Mon, 20 Mar 2006 19:44:40 +0000 [thread overview]
Message-ID: <441F0628.3080202@imap.cc> (raw)
In-Reply-To: <441C6536.2060800@imap.cc>
[-- Attachment #1.1: Type: text/plain, Size: 2045 bytes --]
The current versions of the err() / info() / warn() message macros in
include/linux/usb.h insert __FILE__ at the beginning of the message.
When those macros where introduced, back in 2.2 times, that expanded
to the name of the source file, which was fine.
However, with the build process changes in 2.5, __FILE__ now expands
to the complete path name of the source file within the kernel tree.
Consequently, that part of the kernel message now takes up about half
of an 80 character screen line.
The following patch modifies these macros so that, when used in a
module, they'll insert the module name instead, which is significantly
shorter and also tends to be more useful to users (as opposed to kernel
developers) trying to make sense of a particular message.
It also adds a macro for the "notice" message level which was missing
so far.
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
usb.h | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
--- linux-2.6.16-rc6/include/linux/usb.h 2006-02-27 06:09:35.000000000 +0100
+++ linux-2.6.16-rc6-patch-unclutter/include/linux/usb.h 2006-03-20 20:31:21.000000000 +0100
@@ -1199,12 +1199,14 @@
#define dbg(format, arg...) do {} while (0)
#endif
-#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
- __FILE__ , ## arg)
-#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" , \
- __FILE__ , ## arg)
-#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" , \
- __FILE__ , ## arg)
+#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
+ format "\n" , ## arg)
+#define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \
+ format "\n" , ## arg)
+#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \
+ format "\n" , ## arg)
+#define notice(format, arg...) printk(KERN_NOTICE KBUILD_MODNAME ": " \
+ format "\n" , ## arg)
#endif /* __KERNEL__ */
--
Tilman Schmidt E-Mail: tilman@imap.cc
Bonn, Germany
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 253 bytes --]
[-- Attachment #2: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
prev parent reply other threads:[~2006-03-20 19:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-18 19:53 [KJ] [PATCH] usb.h: reduce syslog clutter Tilman Schmidt
2006-03-20 9:54 ` Arnd Bergmann
2006-03-20 19:40 ` Tilman Schmidt
2006-03-20 19:44 ` Tilman Schmidt [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=441F0628.3080202@imap.cc \
--to=tilman@imap.cc \
--cc=kernel-janitors@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 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.