[PATCH] loopback: Prepend module name to log messages

Tormod Volden lists.tormod at gmail.com
Sun Aug 11 21:07:06 CEST 2019


From: Tormod Volden <debian.tormod at gmail.com>

Signed-off-by: Tormod Volden <debian.tormod at gmail.com>
---
 kernel/drivers/net/drivers/loopback.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/drivers/net/drivers/loopback.c b/kernel/drivers/net/drivers/loopback.c
index ef5323a..ebfcf5c 100644
--- a/kernel/drivers/net/drivers/loopback.c
+++ b/kernel/drivers/net/drivers/loopback.c
@@ -18,6 +18,9 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/printk.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -93,7 +96,7 @@ static int __init loopback_init(void)
     int err;
     struct rtnet_device *rtdev;
 
-    printk("initializing loopback...\n");
+    pr_info("initializing loopback interface...\n");
 
     if ((rtdev = rt_alloc_etherdev(0, 1)) == NULL)
 	return -ENODEV;
@@ -129,7 +132,7 @@ static void __exit loopback_cleanup(void)
 {
     struct rtnet_device *rtdev = rt_loopback_dev;
 
-    printk("removing loopback...\n");
+    pr_info("removing loopback interface...\n");
 
     rt_unregister_rtnetdev(rtdev);
     rt_rtdev_disconnect(rtdev);
-- 
2.7.4




More information about the Xenomai mailing list