All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM
@ 2010-06-02 17:10 Joe Perches
  2010-06-02 18:12 ` [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-02 17:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel

Remove the last uses of MAC_FMT

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/batman-adv/main.c              |    3 +-
 drivers/staging/batman-adv/translation-table.c |   25 ++++-------------------
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c
index 74c70d5..72851cd 100644
--- a/drivers/staging/batman-adv/main.c
+++ b/drivers/staging/batman-adv/main.c
@@ -226,8 +226,7 @@ void dec_module_count(void)
 
 int addr_to_string(char *buff, uint8_t *addr)
 {
-	return sprintf(buff, MAC_FMT,
-		       addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+	return sprintf(buff, "%pM", addr);
 }
 
 /* returns 1 if they are the same originator */
diff --git a/drivers/staging/batman-adv/translation-table.c b/drivers/staging/batman-adv/translation-table.c
index e01ff21..63d0967 100644
--- a/drivers/staging/batman-adv/translation-table.c
+++ b/drivers/staging/batman-adv/translation-table.c
@@ -202,13 +202,8 @@ int hna_local_fill_buffer_text(struct net_device *net_dev, char *buff,
 		hna_local_entry = hashit.bucket->data;
 
 		bytes_written += snprintf(buff + bytes_written, 22,
-					  " * " MAC_FMT "\n",
-					  hna_local_entry->addr[0],
-					  hna_local_entry->addr[1],
-					  hna_local_entry->addr[2],
-					  hna_local_entry->addr[3],
-					  hna_local_entry->addr[4],
-					  hna_local_entry->addr[5]);
+					  " * %pM\n",
+					  hna_local_entry->addr);
 	}
 
 	spin_unlock_irqrestore(&hna_local_hash_lock, flags);
@@ -420,19 +415,9 @@ int hna_global_fill_buffer_text(struct net_device *net_dev, char *buff,
 		hna_global_entry = hashit.bucket->data;
 
 		bytes_written += snprintf(buff + bytes_written, 44,
-					  " * " MAC_FMT " via " MAC_FMT "\n",
-					  hna_global_entry->addr[0],
-					  hna_global_entry->addr[1],
-					  hna_global_entry->addr[2],
-					  hna_global_entry->addr[3],
-					  hna_global_entry->addr[4],
-					  hna_global_entry->addr[5],
-					  hna_global_entry->orig_node->orig[0],
-					  hna_global_entry->orig_node->orig[1],
-					  hna_global_entry->orig_node->orig[2],
-					  hna_global_entry->orig_node->orig[3],
-					  hna_global_entry->orig_node->orig[4],
-					  hna_global_entry->orig_node->orig[5]);
+					  " * %pM via %pM\n",
+					  hna_global_entry->addr,
+					  hna_global_entry->orig_node->orig);
 	}
 
 	spin_unlock_irqrestore(&hna_global_hash_lock, flags);



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

* [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-02 17:10 [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Joe Perches
@ 2010-06-02 18:12 ` Joe Perches
  2010-06-02 18:53 ` [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Greg KH
  2010-06-02 20:11   ` Joe Perches
  2 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-02 18:12 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: devel, linux-kernel

Compile tested only

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove "batman-adv:" from format strings
Use pr_<level>
Use netdev_<level>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/batman-adv/aggregation.c       |    2 +
 drivers/staging/batman-adv/bat_sysfs.c         |   53 ++++++++++++-----------
 drivers/staging/batman-adv/bitarray.c          |    2 +
 drivers/staging/batman-adv/device.c            |   19 ++++----
 drivers/staging/batman-adv/hard-interface.c    |   31 +++++--------
 drivers/staging/batman-adv/main.c              |   17 +++----
 drivers/staging/batman-adv/main.h              |   18 ++++----
 drivers/staging/batman-adv/originator.c        |   17 +++----
 drivers/staging/batman-adv/routing.c           |   14 +++----
 drivers/staging/batman-adv/send.c              |   11 ++---
 drivers/staging/batman-adv/translation-table.c |    8 ++--
 drivers/staging/batman-adv/vis.c               |   11 +++--
 12 files changed, 98 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/batman-adv/aggregation.c b/drivers/staging/batman-adv/aggregation.c
index ce8b8a6..66ee09e 100644
--- a/drivers/staging/batman-adv/aggregation.c
+++ b/drivers/staging/batman-adv/aggregation.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "aggregation.h"
 #include "send.h"
diff --git a/drivers/staging/batman-adv/bat_sysfs.c b/drivers/staging/batman-adv/bat_sysfs.c
index e2c000b..5da7b92 100644
--- a/drivers/staging/batman-adv/bat_sysfs.c
+++ b/drivers/staging/batman-adv/bat_sysfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "translation-table.h"
@@ -99,18 +101,19 @@ static ssize_t store_aggr_ogm(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'aggregate OGM' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'aggregate OGM' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->aggregation_enabled) == aggr_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing aggregation from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->aggregation_enabled) == 1 ?
-	       "enabled" : "disabled", aggr_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	netdev_info(net_dev, "Changing aggregation from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->aggregation_enabled) == 1 ?
+		    "enabled" : "disabled",
+		    aggr_tmp == 1 ? "enabled" : "disabled");
 
 	atomic_set(&bat_priv->aggregation_enabled, (unsigned)aggr_tmp);
 	return count;
@@ -152,18 +155,18 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", net_dev->name);
+	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server",
+		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ? "client" : "server");
 
 	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
 	return count;
@@ -190,23 +193,23 @@ static ssize_t store_orig_interval(struct kobject *kobj, struct attribute *attr,
 
 	ret = strict_strtoul(buff, 10, &orig_interval_tmp);
 	if (ret) {
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'orig_interval' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'orig_interval' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (orig_interval_tmp <= JITTER * 2) {
-		printk(KERN_INFO "batman-adv:New originator interval too small: %li (min: %i)\n",
-		       orig_interval_tmp, JITTER * 2);
+		netdev_info(net_dev, "New originator interval too small: %li (min: %i)\n",
+			    orig_interval_tmp, JITTER * 2);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->orig_interval) == orig_interval_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing originator interval from: %i to: %li on mesh: %s\n",
-	       atomic_read(&bat_priv->orig_interval),
-	       orig_interval_tmp, net_dev->name);
+	netdev_info(net_dev, "Changing originator interval from: %i to: %li on mesh\n",
+		    atomic_read(&bat_priv->orig_interval),
+		    orig_interval_tmp);
 
 	atomic_set(&bat_priv->orig_interval, orig_interval_tmp);
 	return count;
@@ -297,7 +300,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
 						    batif_kobject);
 	if (!bat_priv->mesh_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_MESH_SUBDIR);
 		goto out;
 	}
@@ -306,7 +309,7 @@ int sysfs_add_meshif(struct net_device *dev)
 		err = sysfs_create_file(bat_priv->mesh_obj,
 					&((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
@@ -316,7 +319,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	for (bin_attr = mesh_bin_attrs; *bin_attr; ++bin_attr) {
 		err = sysfs_create_bin_file(bat_priv->mesh_obj, (*bin_attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bin_attr)->attr).name);
 			goto rem_bin_attr;
@@ -390,7 +393,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'mesh_iface' setting received: %s\n",
+		pr_err("Invalid parameter for 'mesh_iface' setting received: %s\n",
 		       buff);
 		return -EINVAL;
 	}
@@ -453,7 +456,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 						    hardif_kobject);
 
 	if (!*hardif_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_BAT_SUBDIR);
 		goto out;
 	}
@@ -461,7 +464,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 	for (hardif_attr = batman_attrs; *hardif_attr; ++hardif_attr) {
 		err = sysfs_create_file(*hardif_obj, &((*hardif_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_BAT_SUBDIR,
 			       ((*hardif_attr)->attr).name);
 			goto rem_attr;
diff --git a/drivers/staging/batman-adv/bitarray.c b/drivers/staging/batman-adv/bitarray.c
index 2fef6e3..d493625 100644
--- a/drivers/staging/batman-adv/bitarray.c
+++ b/drivers/staging/batman-adv/bitarray.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bitarray.h"
 
diff --git a/drivers/staging/batman-adv/device.c b/drivers/staging/batman-adv/device.c
index 7eb6559..d4c4e7d 100644
--- a/drivers/staging/batman-adv/device.c
+++ b/drivers/staging/batman-adv/device.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/device.h>
 #include <linux/slab.h>
 #include "main.h"
@@ -57,17 +59,15 @@ int bat_device_setup(void)
 	/* register our device - kernel assigns a free major number */
 	tmp_major = register_chrdev(0, DRIVER_DEVICE, &fops);
 	if (tmp_major < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Registering the character device failed with %d\n",
-			  tmp_major);
+		pr_err("Registering the character device failed with %d\n",
+		       tmp_major);
 		return 0;
 	}
 
 	batman_class = class_create(THIS_MODULE, "batman-adv");
 
 	if (IS_ERR(batman_class)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Could not register class 'batman-adv'\n");
+		pr_err("Could not register class 'batman-adv'\n");
 		return 0;
 	}
 
@@ -110,8 +110,7 @@ int bat_device_open(struct inode *inode, struct file *file)
 	}
 
 	if (i == ARRAY_SIZE(device_client_hash)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Error - can't add another packet client: "
+		pr_err("Error - can't add another packet client: "
 		       "maximum number of clients reached\n");
 		kfree(device_client);
 		return -EXFULL;
@@ -213,7 +212,7 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
 	unsigned long flags;
 
 	if (len < sizeof(struct icmp_packet)) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"invalid packet size\n");
 		return -EINVAL;
@@ -226,14 +225,14 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
 		return -EFAULT;
 
 	if (icmp_packet.packet_type != BAT_ICMP) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus packet type (expected: BAT_ICMP)\n");
 		return -EINVAL;
 	}
 
 	if (icmp_packet.msg_type != ECHO_REQUEST) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus message type (expected: ECHO_REQUEST)\n");
 		return -EINVAL;
diff --git a/drivers/staging/batman-adv/hard-interface.c b/drivers/staging/batman-adv/hard-interface.c
index 7a582e8..1c6cdd7 100644
--- a/drivers/staging/batman-adv/hard-interface.c
+++ b/drivers/staging/batman-adv/hard-interface.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "hard-interface.h"
 #include "soft-interface.h"
@@ -149,12 +151,9 @@ static void check_known_mac_addr(uint8_t *addr)
 		if (!compare_orig(batman_if->net_dev->dev_addr, addr))
 			continue;
 
-		printk(KERN_WARNING "batman-adv:"
-		    "The newly added mac address (%pM) already exists on: %s\n",
-		    addr, batman_if->dev);
-		printk(KERN_WARNING "batman-adv:"
-		    "It is strongly recommended to keep mac addresses unique"
-		    "to avoid problems!\n");
+		pr_warning("The newly added mac address (%pM) already exists on: %s\n",
+			   addr, batman_if->dev);
+		pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
 	}
 	rcu_read_unlock();
 }
@@ -206,8 +205,7 @@ static void hardif_activate_interface(struct bat_priv *bat_priv,
 	if (!bat_priv->primary_if)
 		set_primary_if(bat_priv, batman_if);
 
-	printk(KERN_INFO "batman-adv:Interface activated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface activated: %s\n", batman_if->dev);
 
 	if (atomic_read(&module_state) == MODULE_INACTIVE)
 		activate_module();
@@ -226,8 +224,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	batman_if->if_status = IF_INACTIVE;
 
-	printk(KERN_INFO "batman-adv:Interface deactivated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface deactivated: %s\n", batman_if->dev);
 
 	update_min_mtu();
 }
@@ -245,8 +242,7 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	batman_if->packet_buff = kmalloc(batman_if->packet_len, GFP_ATOMIC);
 
 	if (!batman_if->packet_buff) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface packet (%s): out of memory\n",
+		pr_err("Can't add interface packet (%s): out of memory\n",
 		       batman_if->dev);
 		goto err;
 	}
@@ -265,14 +261,12 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	orig_hash_add_if(batman_if, bat_priv->num_ifaces);
 
 	atomic_set(&batman_if->seqno, 1);
-	printk(KERN_INFO "batman-adv:Adding interface: %s\n", batman_if->dev);
+	pr_info("Adding interface: %s\n", batman_if->dev);
 
 	if (hardif_is_iface_up(batman_if))
 		hardif_activate_interface(bat_priv, batman_if);
 	else
-		printk(KERN_ERR "batman-adv:"
-		       "Not using interface %s "
-		       "(retrying later): interface not active\n",
+		pr_err("Not using interface %s (retrying later): interface not active\n",
 		       batman_if->dev);
 
 	/* begin scheduling originator messages on that interface */
@@ -296,7 +290,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 	if (batman_if->if_status != IF_INACTIVE)
 		return;
 
-	printk(KERN_INFO "batman-adv:Removing interface: %s\n", batman_if->dev);
+	pr_info("Removing interface: %s\n", batman_if->dev);
 	bat_priv->num_ifaces--;
 	orig_hash_del_if(batman_if, bat_priv->num_ifaces);
 
@@ -323,8 +317,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
 
 	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
 	if (!batman_if) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface (%s): out of memory\n",
+		pr_err("Can't add interface (%s): out of memory\n",
 		       net_dev->name);
 		goto out;
 	}
diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c
index 72851cd..46682c0 100644
--- a/drivers/staging/batman-adv/main.c
+++ b/drivers/staging/batman-adv/main.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "routing.h"
@@ -99,16 +101,14 @@ int init_module(void)
 				   interface_setup);
 
 	if (!soft_device) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to allocate the batman interface\n");
+		pr_err("Unable to allocate the batman interface\n");
 		goto end;
 	}
 
 	retval = register_netdev(soft_device);
 
 	if (retval < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to register the batman interface: %i\n", retval);
+		pr_err("Unable to register the batman interface: %i\n", retval);
 		goto free_soft_device;
 	}
 
@@ -120,9 +120,8 @@ int init_module(void)
 	register_netdevice_notifier(&hard_if_notifier);
 	dev_add_pack(&batman_adv_packet_type);
 
-	printk(KERN_INFO "batman-adv:"
-	       "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
-	       SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+	pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
+		SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
 
 	return 0;
 
@@ -182,9 +181,7 @@ void activate_module(void)
 	goto end;
 
 err:
-	printk(KERN_ERR "batman-adv:"
-	       "Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
+	pr_err("Unable to allocate memory for mesh information structures: out of mem ?\n");
 	deactivate_module();
 end:
 	return;
diff --git a/drivers/staging/batman-adv/main.h b/drivers/staging/batman-adv/main.h
index 5f8343d..afc322d 100644
--- a/drivers/staging/batman-adv/main.h
+++ b/drivers/staging/batman-adv/main.h
@@ -85,15 +85,17 @@
 extern int debug;
 
 extern int bat_debug_type(int type);
-#define bat_dbg(type, fmt, arg...) do {					\
-		if (bat_debug_type(type))				\
-			printk(KERN_DEBUG "batman-adv:" fmt, ## arg);	\
-	}								\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (bat_debug_type(type))				\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-#define bat_dbg(type, fmt, arg...) do {		\
-	}					\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (0)							\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #endif
 
 /*
diff --git a/drivers/staging/batman-adv/originator.c b/drivers/staging/batman-adv/originator.c
index 568aef8..1a61887 100644
--- a/drivers/staging/batman-adv/originator.c
+++ b/drivers/staging/batman-adv/originator.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /* increase the reference counter for this originator */
 
 #include "main.h"
@@ -163,8 +165,7 @@ struct orig_node *get_orig_node(uint8_t *addr)
 		swaphash = hash_resize(orig_hash, orig_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR
-			       "batman-adv:Couldn't resize orig hash table\n");
+			pr_err("Couldn't resize orig hash table\n");
 		else
 			orig_hash = swaphash;
 	}
@@ -373,8 +374,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	data_ptr = kmalloc(max_if_num * sizeof(TYPE_OF_WORD) * NUM_WORDS,
 			   GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -385,8 +385,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -435,8 +434,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
 	chunk_size = sizeof(TYPE_OF_WORD) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -457,8 +455,7 @@ free_bcast_own:
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c
index 066dc8b..b04ddcb 100644
--- a/drivers/staging/batman-adv/routing.c
+++ b/drivers/staging/batman-adv/routing.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "routing.h"
 #include "send.h"
@@ -731,10 +733,8 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb)
 
 	/* send TTL exceeded if packet is an echo request (traceroute) */
 	if (icmp_packet->msg_type != ECHO_REQUEST) {
-		printk(KERN_WARNING "batman-adv:"
-		       "Warning - can't forward icmp packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       icmp_packet->orig, icmp_packet->dst);
+		pr_warning("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
+			   icmp_packet->orig, icmp_packet->dst);
 		return NET_RX_DROP;
 	}
 
@@ -899,10 +899,8 @@ int recv_unicast_packet(struct sk_buff *skb)
 
 	/* TTL exceeded */
 	if (unicast_packet->ttl < 2) {
-		printk(KERN_WARNING "batman-adv:Warning - "
-		       "can't forward unicast packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       ethhdr->h_source, unicast_packet->dest);
+		pr_warning("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
+			   ethhdr->h_source, unicast_packet->dest);
 		return NET_RX_DROP;
 	}
 
diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c
index ac69ed8..f5d6b69 100644
--- a/drivers/staging/batman-adv/send.c
+++ b/drivers/staging/batman-adv/send.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "routing.h"
@@ -64,10 +66,8 @@ int send_skb_packet(struct sk_buff *skb,
 		goto send_skb_err;
 
 	if (!(batman_if->net_dev->flags & IFF_UP)) {
-		printk(KERN_WARNING
-		       "batman-adv:Interface %s "
-		       "is not up - can't send packet via that interface!\n",
-		       batman_if->dev);
+		pr_warning("Interface %s is not up - can't send packet via that interface!\n",
+			   batman_if->dev);
 		goto send_skb_err;
 	}
 
@@ -179,8 +179,7 @@ static void send_packet(struct forw_packet *forw_packet)
 	unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0);
 
 	if (!forw_packet->if_incoming) {
-		printk(KERN_ERR "batman-adv: Error - can't forward packet: "
-		       "incoming iface not specified\n");
+		pr_err("Error - can't forward packet: incoming iface not specified\n");
 		return;
 	}
 
diff --git a/drivers/staging/batman-adv/translation-table.c b/drivers/staging/batman-adv/translation-table.c
index 63d0967..a41bedd 100644
--- a/drivers/staging/batman-adv/translation-table.c
+++ b/drivers/staging/batman-adv/translation-table.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "translation-table.h"
 #include "soft-interface.h"
@@ -111,8 +113,7 @@ void hna_local_add(uint8_t *addr)
 				       hna_local_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize local hna hash table\n");
+			pr_err("Couldn't resize local hna hash table\n");
 		else
 			hna_local_hash = swaphash;
 	}
@@ -364,8 +365,7 @@ void hna_global_add_orig(struct orig_node *orig_node,
 				       hna_global_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize global hna hash table\n");
+			pr_err("Couldn't resize global hna hash table\n");
 		else
 			hna_global_hash = swaphash;
 	}
diff --git a/drivers/staging/batman-adv/vis.c b/drivers/staging/batman-adv/vis.c
index 1d3d954..380e996 100644
--- a/drivers/staging/batman-adv/vis.c
+++ b/drivers/staging/batman-adv/vis.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "translation-table.h"
@@ -628,7 +630,7 @@ static void send_vis_packet(struct vis_info *info)
 	int packet_length;
 
 	if (info->packet.ttl < 2) {
-		printk(KERN_WARNING "batman-adv: Error - can't send vis packet: ttl exceeded\n");
+		pr_warning("Error - can't send vis packet: ttl exceeded\n");
 		return;
 	}
 
@@ -690,13 +692,13 @@ int vis_init(void)
 
 	vis_hash = hash_new(256, vis_info_cmp, vis_info_choose);
 	if (!vis_hash) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis_hash\n");
+		pr_err("Can't initialize vis_hash\n");
 		goto err;
 	}
 
 	my_vis_info = kmalloc(1000, GFP_ATOMIC);
 	if (!my_vis_info) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis packet\n");
+		pr_err("Can't initialize vis packet\n");
 		goto err;
 	}
 
@@ -717,8 +719,7 @@ int vis_init(void)
 	memcpy(my_vis_info->packet.sender_orig, mainIfAddr, ETH_ALEN);
 
 	if (hash_add(vis_hash, my_vis_info) < 0) {
-		printk(KERN_ERR
-		       "batman-adv:Can't add own vis packet into hash\n");
+		pr_err("Can't add own vis packet into hash\n");
 		/* not in hash, need to remove it manually. */
 		kref_put(&my_vis_info->refcount, free_info);
 		goto err;



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

* Re: [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM
  2010-06-02 17:10 [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Joe Perches
  2010-06-02 18:12 ` [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers Joe Perches
@ 2010-06-02 18:53 ` Greg KH
  2010-06-02 20:08   ` [PATCH] MAINTAINERS: Add staging/b.a.t.m.a.n Joe Perches
  2010-06-02 20:11   ` Joe Perches
  2 siblings, 1 reply; 20+ messages in thread
From: Greg KH @ 2010-06-02 18:53 UTC (permalink / raw)
  To: Joe Perches; +Cc: devel, linux-kernel

On Wed, Jun 02, 2010 at 10:10:15AM -0700, Joe Perches wrote:
> Remove the last uses of MAC_FMT
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/staging/batman-adv/main.c              |    3 +-
>  drivers/staging/batman-adv/translation-table.c |   25 ++++-------------------

The TODO file in this directory clearly states who to copy on patches to
these files.

Please resend them to the people there so that they can sync up with the
other patches they have already sent me.

thanks,

greg k-h

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

* [PATCH] MAINTAINERS: Add staging/b.a.t.m.a.n
  2010-06-02 18:53 ` [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Greg KH
@ 2010-06-02 20:08   ` Joe Perches
  2010-06-02 20:17     ` Greg KH
  0 siblings, 1 reply; 20+ messages in thread
From: Joe Perches @ 2010-06-02 20:08 UTC (permalink / raw)
  To: Greg KH; +Cc: devel, linux-kernel, Andrew Morton

On Wed, 2010-06-02 at 11:53 -0700, Greg KH wrote:
> The TODO file in this directory clearly states who to copy on patches to
> these files.

Does anyone look at those? ;)

Signed-off-by: Joe Perches <joe@perches.com>
---
 MAINTAINERS |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 2652ebc..e25e15a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5436,6 +5436,14 @@ L:	devel@driverdev.osuosl.org
 S:	Maintained
 F:	drivers/staging/
 
+STAGING B.A.T.M.A.N.
+M:	Marek Lindner <lindner_marek@yahoo.de>
+M:	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
+M:	Andrew Lunn <andrew@lunn.ch>
+L:	b.a.t.m.a.n@lists.open-mesh.net
+S:	Maintained (one day soon)
+F:	drivers/staging/batman-adv/
+
 STARFIRE/DURALAN NETWORK DRIVER
 M:	Ion Badulescu <ionut@badula.org>
 S:	Odd Fixes




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

* [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-02 17:10 [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Joe Perches
@ 2010-06-02 20:11   ` Joe Perches
  2010-06-02 18:53 ` [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Greg KH
  2010-06-02 20:11   ` Joe Perches
  2 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-02 20:11 UTC (permalink / raw)
  To: Marek Lindner, Simon Wunderlich, Andrew Lunn, Greg Kroah-Hartman
  Cc: devel, b.a.t.m.a.n, linux-kernel

Compile tested only

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove "batman-adv:" from format strings
Use pr_<level>
Use netdev_<level>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/batman-adv/aggregation.c       |    2 +
 drivers/staging/batman-adv/bat_sysfs.c         |   53 ++++++++++++-----------
 drivers/staging/batman-adv/bitarray.c          |    2 +
 drivers/staging/batman-adv/device.c            |   19 ++++----
 drivers/staging/batman-adv/hard-interface.c    |   31 +++++--------
 drivers/staging/batman-adv/main.c              |   17 +++----
 drivers/staging/batman-adv/main.h              |   18 ++++----
 drivers/staging/batman-adv/originator.c        |   17 +++----
 drivers/staging/batman-adv/routing.c           |   14 +++----
 drivers/staging/batman-adv/send.c              |   11 ++---
 drivers/staging/batman-adv/translation-table.c |    8 ++--
 drivers/staging/batman-adv/vis.c               |   11 +++--
 12 files changed, 98 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/batman-adv/aggregation.c b/drivers/staging/batman-adv/aggregation.c
index ce8b8a6..66ee09e 100644
--- a/drivers/staging/batman-adv/aggregation.c
+++ b/drivers/staging/batman-adv/aggregation.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "aggregation.h"
 #include "send.h"
diff --git a/drivers/staging/batman-adv/bat_sysfs.c b/drivers/staging/batman-adv/bat_sysfs.c
index e2c000b..5da7b92 100644
--- a/drivers/staging/batman-adv/bat_sysfs.c
+++ b/drivers/staging/batman-adv/bat_sysfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "translation-table.h"
@@ -99,18 +101,19 @@ static ssize_t store_aggr_ogm(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'aggregate OGM' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'aggregate OGM' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->aggregation_enabled) == aggr_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing aggregation from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->aggregation_enabled) == 1 ?
-	       "enabled" : "disabled", aggr_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	netdev_info(net_dev, "Changing aggregation from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->aggregation_enabled) == 1 ?
+		    "enabled" : "disabled",
+		    aggr_tmp == 1 ? "enabled" : "disabled");
 
 	atomic_set(&bat_priv->aggregation_enabled, (unsigned)aggr_tmp);
 	return count;
@@ -152,18 +155,18 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", net_dev->name);
+	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server",
+		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ? "client" : "server");
 
 	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
 	return count;
@@ -190,23 +193,23 @@ static ssize_t store_orig_interval(struct kobject *kobj, struct attribute *attr,
 
 	ret = strict_strtoul(buff, 10, &orig_interval_tmp);
 	if (ret) {
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'orig_interval' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'orig_interval' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (orig_interval_tmp <= JITTER * 2) {
-		printk(KERN_INFO "batman-adv:New originator interval too small: %li (min: %i)\n",
-		       orig_interval_tmp, JITTER * 2);
+		netdev_info(net_dev, "New originator interval too small: %li (min: %i)\n",
+			    orig_interval_tmp, JITTER * 2);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->orig_interval) == orig_interval_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing originator interval from: %i to: %li on mesh: %s\n",
-	       atomic_read(&bat_priv->orig_interval),
-	       orig_interval_tmp, net_dev->name);
+	netdev_info(net_dev, "Changing originator interval from: %i to: %li on mesh\n",
+		    atomic_read(&bat_priv->orig_interval),
+		    orig_interval_tmp);
 
 	atomic_set(&bat_priv->orig_interval, orig_interval_tmp);
 	return count;
@@ -297,7 +300,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
 						    batif_kobject);
 	if (!bat_priv->mesh_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_MESH_SUBDIR);
 		goto out;
 	}
@@ -306,7 +309,7 @@ int sysfs_add_meshif(struct net_device *dev)
 		err = sysfs_create_file(bat_priv->mesh_obj,
 					&((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
@@ -316,7 +319,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	for (bin_attr = mesh_bin_attrs; *bin_attr; ++bin_attr) {
 		err = sysfs_create_bin_file(bat_priv->mesh_obj, (*bin_attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bin_attr)->attr).name);
 			goto rem_bin_attr;
@@ -390,7 +393,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'mesh_iface' setting received: %s\n",
+		pr_err("Invalid parameter for 'mesh_iface' setting received: %s\n",
 		       buff);
 		return -EINVAL;
 	}
@@ -453,7 +456,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 						    hardif_kobject);
 
 	if (!*hardif_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_BAT_SUBDIR);
 		goto out;
 	}
@@ -461,7 +464,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 	for (hardif_attr = batman_attrs; *hardif_attr; ++hardif_attr) {
 		err = sysfs_create_file(*hardif_obj, &((*hardif_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_BAT_SUBDIR,
 			       ((*hardif_attr)->attr).name);
 			goto rem_attr;
diff --git a/drivers/staging/batman-adv/bitarray.c b/drivers/staging/batman-adv/bitarray.c
index 2fef6e3..d493625 100644
--- a/drivers/staging/batman-adv/bitarray.c
+++ b/drivers/staging/batman-adv/bitarray.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bitarray.h"
 
diff --git a/drivers/staging/batman-adv/device.c b/drivers/staging/batman-adv/device.c
index 7eb6559..d4c4e7d 100644
--- a/drivers/staging/batman-adv/device.c
+++ b/drivers/staging/batman-adv/device.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/device.h>
 #include <linux/slab.h>
 #include "main.h"
@@ -57,17 +59,15 @@ int bat_device_setup(void)
 	/* register our device - kernel assigns a free major number */
 	tmp_major = register_chrdev(0, DRIVER_DEVICE, &fops);
 	if (tmp_major < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Registering the character device failed with %d\n",
-			  tmp_major);
+		pr_err("Registering the character device failed with %d\n",
+		       tmp_major);
 		return 0;
 	}
 
 	batman_class = class_create(THIS_MODULE, "batman-adv");
 
 	if (IS_ERR(batman_class)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Could not register class 'batman-adv'\n");
+		pr_err("Could not register class 'batman-adv'\n");
 		return 0;
 	}
 
@@ -110,8 +110,7 @@ int bat_device_open(struct inode *inode, struct file *file)
 	}
 
 	if (i == ARRAY_SIZE(device_client_hash)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Error - can't add another packet client: "
+		pr_err("Error - can't add another packet client: "
 		       "maximum number of clients reached\n");
 		kfree(device_client);
 		return -EXFULL;
@@ -213,7 +212,7 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
 	unsigned long flags;
 
 	if (len < sizeof(struct icmp_packet)) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"invalid packet size\n");
 		return -EINVAL;
@@ -226,14 +225,14 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
 		return -EFAULT;
 
 	if (icmp_packet.packet_type != BAT_ICMP) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus packet type (expected: BAT_ICMP)\n");
 		return -EINVAL;
 	}
 
 	if (icmp_packet.msg_type != ECHO_REQUEST) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus message type (expected: ECHO_REQUEST)\n");
 		return -EINVAL;
diff --git a/drivers/staging/batman-adv/hard-interface.c b/drivers/staging/batman-adv/hard-interface.c
index 7a582e8..1c6cdd7 100644
--- a/drivers/staging/batman-adv/hard-interface.c
+++ b/drivers/staging/batman-adv/hard-interface.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "hard-interface.h"
 #include "soft-interface.h"
@@ -149,12 +151,9 @@ static void check_known_mac_addr(uint8_t *addr)
 		if (!compare_orig(batman_if->net_dev->dev_addr, addr))
 			continue;
 
-		printk(KERN_WARNING "batman-adv:"
-		    "The newly added mac address (%pM) already exists on: %s\n",
-		    addr, batman_if->dev);
-		printk(KERN_WARNING "batman-adv:"
-		    "It is strongly recommended to keep mac addresses unique"
-		    "to avoid problems!\n");
+		pr_warning("The newly added mac address (%pM) already exists on: %s\n",
+			   addr, batman_if->dev);
+		pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
 	}
 	rcu_read_unlock();
 }
@@ -206,8 +205,7 @@ static void hardif_activate_interface(struct bat_priv *bat_priv,
 	if (!bat_priv->primary_if)
 		set_primary_if(bat_priv, batman_if);
 
-	printk(KERN_INFO "batman-adv:Interface activated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface activated: %s\n", batman_if->dev);
 
 	if (atomic_read(&module_state) == MODULE_INACTIVE)
 		activate_module();
@@ -226,8 +224,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	batman_if->if_status = IF_INACTIVE;
 
-	printk(KERN_INFO "batman-adv:Interface deactivated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface deactivated: %s\n", batman_if->dev);
 
 	update_min_mtu();
 }
@@ -245,8 +242,7 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	batman_if->packet_buff = kmalloc(batman_if->packet_len, GFP_ATOMIC);
 
 	if (!batman_if->packet_buff) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface packet (%s): out of memory\n",
+		pr_err("Can't add interface packet (%s): out of memory\n",
 		       batman_if->dev);
 		goto err;
 	}
@@ -265,14 +261,12 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	orig_hash_add_if(batman_if, bat_priv->num_ifaces);
 
 	atomic_set(&batman_if->seqno, 1);
-	printk(KERN_INFO "batman-adv:Adding interface: %s\n", batman_if->dev);
+	pr_info("Adding interface: %s\n", batman_if->dev);
 
 	if (hardif_is_iface_up(batman_if))
 		hardif_activate_interface(bat_priv, batman_if);
 	else
-		printk(KERN_ERR "batman-adv:"
-		       "Not using interface %s "
-		       "(retrying later): interface not active\n",
+		pr_err("Not using interface %s (retrying later): interface not active\n",
 		       batman_if->dev);
 
 	/* begin scheduling originator messages on that interface */
@@ -296,7 +290,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 	if (batman_if->if_status != IF_INACTIVE)
 		return;
 
-	printk(KERN_INFO "batman-adv:Removing interface: %s\n", batman_if->dev);
+	pr_info("Removing interface: %s\n", batman_if->dev);
 	bat_priv->num_ifaces--;
 	orig_hash_del_if(batman_if, bat_priv->num_ifaces);
 
@@ -323,8 +317,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
 
 	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
 	if (!batman_if) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface (%s): out of memory\n",
+		pr_err("Can't add interface (%s): out of memory\n",
 		       net_dev->name);
 		goto out;
 	}
diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c
index 72851cd..46682c0 100644
--- a/drivers/staging/batman-adv/main.c
+++ b/drivers/staging/batman-adv/main.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "routing.h"
@@ -99,16 +101,14 @@ int init_module(void)
 				   interface_setup);
 
 	if (!soft_device) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to allocate the batman interface\n");
+		pr_err("Unable to allocate the batman interface\n");
 		goto end;
 	}
 
 	retval = register_netdev(soft_device);
 
 	if (retval < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to register the batman interface: %i\n", retval);
+		pr_err("Unable to register the batman interface: %i\n", retval);
 		goto free_soft_device;
 	}
 
@@ -120,9 +120,8 @@ int init_module(void)
 	register_netdevice_notifier(&hard_if_notifier);
 	dev_add_pack(&batman_adv_packet_type);
 
-	printk(KERN_INFO "batman-adv:"
-	       "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
-	       SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+	pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
+		SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
 
 	return 0;
 
@@ -182,9 +181,7 @@ void activate_module(void)
 	goto end;
 
 err:
-	printk(KERN_ERR "batman-adv:"
-	       "Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
+	pr_err("Unable to allocate memory for mesh information structures: out of mem ?\n");
 	deactivate_module();
 end:
 	return;
diff --git a/drivers/staging/batman-adv/main.h b/drivers/staging/batman-adv/main.h
index 5f8343d..afc322d 100644
--- a/drivers/staging/batman-adv/main.h
+++ b/drivers/staging/batman-adv/main.h
@@ -85,15 +85,17 @@
 extern int debug;
 
 extern int bat_debug_type(int type);
-#define bat_dbg(type, fmt, arg...) do {					\
-		if (bat_debug_type(type))				\
-			printk(KERN_DEBUG "batman-adv:" fmt, ## arg);	\
-	}								\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (bat_debug_type(type))				\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-#define bat_dbg(type, fmt, arg...) do {		\
-	}					\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (0)							\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #endif
 
 /*
diff --git a/drivers/staging/batman-adv/originator.c b/drivers/staging/batman-adv/originator.c
index 568aef8..1a61887 100644
--- a/drivers/staging/batman-adv/originator.c
+++ b/drivers/staging/batman-adv/originator.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /* increase the reference counter for this originator */
 
 #include "main.h"
@@ -163,8 +165,7 @@ struct orig_node *get_orig_node(uint8_t *addr)
 		swaphash = hash_resize(orig_hash, orig_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR
-			       "batman-adv:Couldn't resize orig hash table\n");
+			pr_err("Couldn't resize orig hash table\n");
 		else
 			orig_hash = swaphash;
 	}
@@ -373,8 +374,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	data_ptr = kmalloc(max_if_num * sizeof(TYPE_OF_WORD) * NUM_WORDS,
 			   GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -385,8 +385,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -435,8 +434,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
 	chunk_size = sizeof(TYPE_OF_WORD) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -457,8 +455,7 @@ free_bcast_own:
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c
index 066dc8b..b04ddcb 100644
--- a/drivers/staging/batman-adv/routing.c
+++ b/drivers/staging/batman-adv/routing.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "routing.h"
 #include "send.h"
@@ -731,10 +733,8 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb)
 
 	/* send TTL exceeded if packet is an echo request (traceroute) */
 	if (icmp_packet->msg_type != ECHO_REQUEST) {
-		printk(KERN_WARNING "batman-adv:"
-		       "Warning - can't forward icmp packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       icmp_packet->orig, icmp_packet->dst);
+		pr_warning("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
+			   icmp_packet->orig, icmp_packet->dst);
 		return NET_RX_DROP;
 	}
 
@@ -899,10 +899,8 @@ int recv_unicast_packet(struct sk_buff *skb)
 
 	/* TTL exceeded */
 	if (unicast_packet->ttl < 2) {
-		printk(KERN_WARNING "batman-adv:Warning - "
-		       "can't forward unicast packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       ethhdr->h_source, unicast_packet->dest);
+		pr_warning("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
+			   ethhdr->h_source, unicast_packet->dest);
 		return NET_RX_DROP;
 	}
 
diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c
index ac69ed8..f5d6b69 100644
--- a/drivers/staging/batman-adv/send.c
+++ b/drivers/staging/batman-adv/send.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "routing.h"
@@ -64,10 +66,8 @@ int send_skb_packet(struct sk_buff *skb,
 		goto send_skb_err;
 
 	if (!(batman_if->net_dev->flags & IFF_UP)) {
-		printk(KERN_WARNING
-		       "batman-adv:Interface %s "
-		       "is not up - can't send packet via that interface!\n",
-		       batman_if->dev);
+		pr_warning("Interface %s is not up - can't send packet via that interface!\n",
+			   batman_if->dev);
 		goto send_skb_err;
 	}
 
@@ -179,8 +179,7 @@ static void send_packet(struct forw_packet *forw_packet)
 	unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0);
 
 	if (!forw_packet->if_incoming) {
-		printk(KERN_ERR "batman-adv: Error - can't forward packet: "
-		       "incoming iface not specified\n");
+		pr_err("Error - can't forward packet: incoming iface not specified\n");
 		return;
 	}
 
diff --git a/drivers/staging/batman-adv/translation-table.c b/drivers/staging/batman-adv/translation-table.c
index 63d0967..a41bedd 100644
--- a/drivers/staging/batman-adv/translation-table.c
+++ b/drivers/staging/batman-adv/translation-table.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "translation-table.h"
 #include "soft-interface.h"
@@ -111,8 +113,7 @@ void hna_local_add(uint8_t *addr)
 				       hna_local_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize local hna hash table\n");
+			pr_err("Couldn't resize local hna hash table\n");
 		else
 			hna_local_hash = swaphash;
 	}
@@ -364,8 +365,7 @@ void hna_global_add_orig(struct orig_node *orig_node,
 				       hna_global_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize global hna hash table\n");
+			pr_err("Couldn't resize global hna hash table\n");
 		else
 			hna_global_hash = swaphash;
 	}
diff --git a/drivers/staging/batman-adv/vis.c b/drivers/staging/batman-adv/vis.c
index 1d3d954..380e996 100644
--- a/drivers/staging/batman-adv/vis.c
+++ b/drivers/staging/batman-adv/vis.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "translation-table.h"
@@ -628,7 +630,7 @@ static void send_vis_packet(struct vis_info *info)
 	int packet_length;
 
 	if (info->packet.ttl < 2) {
-		printk(KERN_WARNING "batman-adv: Error - can't send vis packet: ttl exceeded\n");
+		pr_warning("Error - can't send vis packet: ttl exceeded\n");
 		return;
 	}
 
@@ -690,13 +692,13 @@ int vis_init(void)
 
 	vis_hash = hash_new(256, vis_info_cmp, vis_info_choose);
 	if (!vis_hash) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis_hash\n");
+		pr_err("Can't initialize vis_hash\n");
 		goto err;
 	}
 
 	my_vis_info = kmalloc(1000, GFP_ATOMIC);
 	if (!my_vis_info) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis packet\n");
+		pr_err("Can't initialize vis packet\n");
 		goto err;
 	}
 
@@ -717,8 +719,7 @@ int vis_init(void)
 	memcpy(my_vis_info->packet.sender_orig, mainIfAddr, ETH_ALEN);
 
 	if (hash_add(vis_hash, my_vis_info) < 0) {
-		printk(KERN_ERR
-		       "batman-adv:Can't add own vis packet into hash\n");
+		pr_err("Can't add own vis packet into hash\n");
 		/* not in hash, need to remove it manually. */
 		kref_put(&my_vis_info->refcount, free_info);
 		goto err;




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

* [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
@ 2010-06-02 20:11   ` Joe Perches
  0 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-02 20:11 UTC (permalink / raw)
  To: Marek Lindner, Simon Wunderlich, Andrew Lunn, Greg Kroah-Hartman
  Cc: devel, linux-kernel, b.a.t.m.a.n

Compile tested only

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove "batman-adv:" from format strings
Use pr_<level>
Use netdev_<level>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/batman-adv/aggregation.c       |    2 +
 drivers/staging/batman-adv/bat_sysfs.c         |   53 ++++++++++++-----------
 drivers/staging/batman-adv/bitarray.c          |    2 +
 drivers/staging/batman-adv/device.c            |   19 ++++----
 drivers/staging/batman-adv/hard-interface.c    |   31 +++++--------
 drivers/staging/batman-adv/main.c              |   17 +++----
 drivers/staging/batman-adv/main.h              |   18 ++++----
 drivers/staging/batman-adv/originator.c        |   17 +++----
 drivers/staging/batman-adv/routing.c           |   14 +++----
 drivers/staging/batman-adv/send.c              |   11 ++---
 drivers/staging/batman-adv/translation-table.c |    8 ++--
 drivers/staging/batman-adv/vis.c               |   11 +++--
 12 files changed, 98 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/batman-adv/aggregation.c b/drivers/staging/batman-adv/aggregation.c
index ce8b8a6..66ee09e 100644
--- a/drivers/staging/batman-adv/aggregation.c
+++ b/drivers/staging/batman-adv/aggregation.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "aggregation.h"
 #include "send.h"
diff --git a/drivers/staging/batman-adv/bat_sysfs.c b/drivers/staging/batman-adv/bat_sysfs.c
index e2c000b..5da7b92 100644
--- a/drivers/staging/batman-adv/bat_sysfs.c
+++ b/drivers/staging/batman-adv/bat_sysfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "translation-table.h"
@@ -99,18 +101,19 @@ static ssize_t store_aggr_ogm(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'aggregate OGM' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'aggregate OGM' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->aggregation_enabled) == aggr_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing aggregation from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->aggregation_enabled) == 1 ?
-	       "enabled" : "disabled", aggr_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	netdev_info(net_dev, "Changing aggregation from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->aggregation_enabled) == 1 ?
+		    "enabled" : "disabled",
+		    aggr_tmp == 1 ? "enabled" : "disabled");
 
 	atomic_set(&bat_priv->aggregation_enabled, (unsigned)aggr_tmp);
 	return count;
@@ -152,18 +155,18 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", net_dev->name);
+	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server",
+		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ? "client" : "server");
 
 	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
 	return count;
@@ -190,23 +193,23 @@ static ssize_t store_orig_interval(struct kobject *kobj, struct attribute *attr,
 
 	ret = strict_strtoul(buff, 10, &orig_interval_tmp);
 	if (ret) {
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'orig_interval' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'orig_interval' setting on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (orig_interval_tmp <= JITTER * 2) {
-		printk(KERN_INFO "batman-adv:New originator interval too small: %li (min: %i)\n",
-		       orig_interval_tmp, JITTER * 2);
+		netdev_info(net_dev, "New originator interval too small: %li (min: %i)\n",
+			    orig_interval_tmp, JITTER * 2);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->orig_interval) == orig_interval_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing originator interval from: %i to: %li on mesh: %s\n",
-	       atomic_read(&bat_priv->orig_interval),
-	       orig_interval_tmp, net_dev->name);
+	netdev_info(net_dev, "Changing originator interval from: %i to: %li on mesh\n",
+		    atomic_read(&bat_priv->orig_interval),
+		    orig_interval_tmp);
 
 	atomic_set(&bat_priv->orig_interval, orig_interval_tmp);
 	return count;
@@ -297,7 +300,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
 						    batif_kobject);
 	if (!bat_priv->mesh_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_MESH_SUBDIR);
 		goto out;
 	}
@@ -306,7 +309,7 @@ int sysfs_add_meshif(struct net_device *dev)
 		err = sysfs_create_file(bat_priv->mesh_obj,
 					&((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
@@ -316,7 +319,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	for (bin_attr = mesh_bin_attrs; *bin_attr; ++bin_attr) {
 		err = sysfs_create_bin_file(bat_priv->mesh_obj, (*bin_attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bin_attr)->attr).name);
 			goto rem_bin_attr;
@@ -390,7 +393,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'mesh_iface' setting received: %s\n",
+		pr_err("Invalid parameter for 'mesh_iface' setting received: %s\n",
 		       buff);
 		return -EINVAL;
 	}
@@ -453,7 +456,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 						    hardif_kobject);
 
 	if (!*hardif_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_BAT_SUBDIR);
 		goto out;
 	}
@@ -461,7 +464,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 	for (hardif_attr = batman_attrs; *hardif_attr; ++hardif_attr) {
 		err = sysfs_create_file(*hardif_obj, &((*hardif_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_BAT_SUBDIR,
 			       ((*hardif_attr)->attr).name);
 			goto rem_attr;
diff --git a/drivers/staging/batman-adv/bitarray.c b/drivers/staging/batman-adv/bitarray.c
index 2fef6e3..d493625 100644
--- a/drivers/staging/batman-adv/bitarray.c
+++ b/drivers/staging/batman-adv/bitarray.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bitarray.h"
 
diff --git a/drivers/staging/batman-adv/device.c b/drivers/staging/batman-adv/device.c
index 7eb6559..d4c4e7d 100644
--- a/drivers/staging/batman-adv/device.c
+++ b/drivers/staging/batman-adv/device.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/device.h>
 #include <linux/slab.h>
 #include "main.h"
@@ -57,17 +59,15 @@ int bat_device_setup(void)
 	/* register our device - kernel assigns a free major number */
 	tmp_major = register_chrdev(0, DRIVER_DEVICE, &fops);
 	if (tmp_major < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Registering the character device failed with %d\n",
-			  tmp_major);
+		pr_err("Registering the character device failed with %d\n",
+		       tmp_major);
 		return 0;
 	}
 
 	batman_class = class_create(THIS_MODULE, "batman-adv");
 
 	if (IS_ERR(batman_class)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Could not register class 'batman-adv'\n");
+		pr_err("Could not register class 'batman-adv'\n");
 		return 0;
 	}
 
@@ -110,8 +110,7 @@ int bat_device_open(struct inode *inode, struct file *file)
 	}
 
 	if (i == ARRAY_SIZE(device_client_hash)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Error - can't add another packet client: "
+		pr_err("Error - can't add another packet client: "
 		       "maximum number of clients reached\n");
 		kfree(device_client);
 		return -EXFULL;
@@ -213,7 +212,7 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
 	unsigned long flags;
 
 	if (len < sizeof(struct icmp_packet)) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"invalid packet size\n");
 		return -EINVAL;
@@ -226,14 +225,14 @@ ssize_t bat_device_write(struct file *file, const char __user *buff,
 		return -EFAULT;
 
 	if (icmp_packet.packet_type != BAT_ICMP) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus packet type (expected: BAT_ICMP)\n");
 		return -EINVAL;
 	}
 
 	if (icmp_packet.msg_type != ECHO_REQUEST) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus message type (expected: ECHO_REQUEST)\n");
 		return -EINVAL;
diff --git a/drivers/staging/batman-adv/hard-interface.c b/drivers/staging/batman-adv/hard-interface.c
index 7a582e8..1c6cdd7 100644
--- a/drivers/staging/batman-adv/hard-interface.c
+++ b/drivers/staging/batman-adv/hard-interface.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "hard-interface.h"
 #include "soft-interface.h"
@@ -149,12 +151,9 @@ static void check_known_mac_addr(uint8_t *addr)
 		if (!compare_orig(batman_if->net_dev->dev_addr, addr))
 			continue;
 
-		printk(KERN_WARNING "batman-adv:"
-		    "The newly added mac address (%pM) already exists on: %s\n",
-		    addr, batman_if->dev);
-		printk(KERN_WARNING "batman-adv:"
-		    "It is strongly recommended to keep mac addresses unique"
-		    "to avoid problems!\n");
+		pr_warning("The newly added mac address (%pM) already exists on: %s\n",
+			   addr, batman_if->dev);
+		pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
 	}
 	rcu_read_unlock();
 }
@@ -206,8 +205,7 @@ static void hardif_activate_interface(struct bat_priv *bat_priv,
 	if (!bat_priv->primary_if)
 		set_primary_if(bat_priv, batman_if);
 
-	printk(KERN_INFO "batman-adv:Interface activated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface activated: %s\n", batman_if->dev);
 
 	if (atomic_read(&module_state) == MODULE_INACTIVE)
 		activate_module();
@@ -226,8 +224,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	batman_if->if_status = IF_INACTIVE;
 
-	printk(KERN_INFO "batman-adv:Interface deactivated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface deactivated: %s\n", batman_if->dev);
 
 	update_min_mtu();
 }
@@ -245,8 +242,7 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	batman_if->packet_buff = kmalloc(batman_if->packet_len, GFP_ATOMIC);
 
 	if (!batman_if->packet_buff) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface packet (%s): out of memory\n",
+		pr_err("Can't add interface packet (%s): out of memory\n",
 		       batman_if->dev);
 		goto err;
 	}
@@ -265,14 +261,12 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	orig_hash_add_if(batman_if, bat_priv->num_ifaces);
 
 	atomic_set(&batman_if->seqno, 1);
-	printk(KERN_INFO "batman-adv:Adding interface: %s\n", batman_if->dev);
+	pr_info("Adding interface: %s\n", batman_if->dev);
 
 	if (hardif_is_iface_up(batman_if))
 		hardif_activate_interface(bat_priv, batman_if);
 	else
-		printk(KERN_ERR "batman-adv:"
-		       "Not using interface %s "
-		       "(retrying later): interface not active\n",
+		pr_err("Not using interface %s (retrying later): interface not active\n",
 		       batman_if->dev);
 
 	/* begin scheduling originator messages on that interface */
@@ -296,7 +290,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 	if (batman_if->if_status != IF_INACTIVE)
 		return;
 
-	printk(KERN_INFO "batman-adv:Removing interface: %s\n", batman_if->dev);
+	pr_info("Removing interface: %s\n", batman_if->dev);
 	bat_priv->num_ifaces--;
 	orig_hash_del_if(batman_if, bat_priv->num_ifaces);
 
@@ -323,8 +317,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
 
 	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
 	if (!batman_if) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface (%s): out of memory\n",
+		pr_err("Can't add interface (%s): out of memory\n",
 		       net_dev->name);
 		goto out;
 	}
diff --git a/drivers/staging/batman-adv/main.c b/drivers/staging/batman-adv/main.c
index 72851cd..46682c0 100644
--- a/drivers/staging/batman-adv/main.c
+++ b/drivers/staging/batman-adv/main.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "routing.h"
@@ -99,16 +101,14 @@ int init_module(void)
 				   interface_setup);
 
 	if (!soft_device) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to allocate the batman interface\n");
+		pr_err("Unable to allocate the batman interface\n");
 		goto end;
 	}
 
 	retval = register_netdev(soft_device);
 
 	if (retval < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to register the batman interface: %i\n", retval);
+		pr_err("Unable to register the batman interface: %i\n", retval);
 		goto free_soft_device;
 	}
 
@@ -120,9 +120,8 @@ int init_module(void)
 	register_netdevice_notifier(&hard_if_notifier);
 	dev_add_pack(&batman_adv_packet_type);
 
-	printk(KERN_INFO "batman-adv:"
-	       "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
-	       SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+	pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
+		SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
 
 	return 0;
 
@@ -182,9 +181,7 @@ void activate_module(void)
 	goto end;
 
 err:
-	printk(KERN_ERR "batman-adv:"
-	       "Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
+	pr_err("Unable to allocate memory for mesh information structures: out of mem ?\n");
 	deactivate_module();
 end:
 	return;
diff --git a/drivers/staging/batman-adv/main.h b/drivers/staging/batman-adv/main.h
index 5f8343d..afc322d 100644
--- a/drivers/staging/batman-adv/main.h
+++ b/drivers/staging/batman-adv/main.h
@@ -85,15 +85,17 @@
 extern int debug;
 
 extern int bat_debug_type(int type);
-#define bat_dbg(type, fmt, arg...) do {					\
-		if (bat_debug_type(type))				\
-			printk(KERN_DEBUG "batman-adv:" fmt, ## arg);	\
-	}								\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (bat_debug_type(type))				\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-#define bat_dbg(type, fmt, arg...) do {		\
-	}					\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (0)							\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #endif
 
 /*
diff --git a/drivers/staging/batman-adv/originator.c b/drivers/staging/batman-adv/originator.c
index 568aef8..1a61887 100644
--- a/drivers/staging/batman-adv/originator.c
+++ b/drivers/staging/batman-adv/originator.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /* increase the reference counter for this originator */
 
 #include "main.h"
@@ -163,8 +165,7 @@ struct orig_node *get_orig_node(uint8_t *addr)
 		swaphash = hash_resize(orig_hash, orig_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR
-			       "batman-adv:Couldn't resize orig hash table\n");
+			pr_err("Couldn't resize orig hash table\n");
 		else
 			orig_hash = swaphash;
 	}
@@ -373,8 +374,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	data_ptr = kmalloc(max_if_num * sizeof(TYPE_OF_WORD) * NUM_WORDS,
 			   GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -385,8 +385,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -435,8 +434,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
 	chunk_size = sizeof(TYPE_OF_WORD) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -457,8 +455,7 @@ free_bcast_own:
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c
index 066dc8b..b04ddcb 100644
--- a/drivers/staging/batman-adv/routing.c
+++ b/drivers/staging/batman-adv/routing.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "routing.h"
 #include "send.h"
@@ -731,10 +733,8 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb)
 
 	/* send TTL exceeded if packet is an echo request (traceroute) */
 	if (icmp_packet->msg_type != ECHO_REQUEST) {
-		printk(KERN_WARNING "batman-adv:"
-		       "Warning - can't forward icmp packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       icmp_packet->orig, icmp_packet->dst);
+		pr_warning("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
+			   icmp_packet->orig, icmp_packet->dst);
 		return NET_RX_DROP;
 	}
 
@@ -899,10 +899,8 @@ int recv_unicast_packet(struct sk_buff *skb)
 
 	/* TTL exceeded */
 	if (unicast_packet->ttl < 2) {
-		printk(KERN_WARNING "batman-adv:Warning - "
-		       "can't forward unicast packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       ethhdr->h_source, unicast_packet->dest);
+		pr_warning("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
+			   ethhdr->h_source, unicast_packet->dest);
 		return NET_RX_DROP;
 	}
 
diff --git a/drivers/staging/batman-adv/send.c b/drivers/staging/batman-adv/send.c
index ac69ed8..f5d6b69 100644
--- a/drivers/staging/batman-adv/send.c
+++ b/drivers/staging/batman-adv/send.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "routing.h"
@@ -64,10 +66,8 @@ int send_skb_packet(struct sk_buff *skb,
 		goto send_skb_err;
 
 	if (!(batman_if->net_dev->flags & IFF_UP)) {
-		printk(KERN_WARNING
-		       "batman-adv:Interface %s "
-		       "is not up - can't send packet via that interface!\n",
-		       batman_if->dev);
+		pr_warning("Interface %s is not up - can't send packet via that interface!\n",
+			   batman_if->dev);
 		goto send_skb_err;
 	}
 
@@ -179,8 +179,7 @@ static void send_packet(struct forw_packet *forw_packet)
 	unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0);
 
 	if (!forw_packet->if_incoming) {
-		printk(KERN_ERR "batman-adv: Error - can't forward packet: "
-		       "incoming iface not specified\n");
+		pr_err("Error - can't forward packet: incoming iface not specified\n");
 		return;
 	}
 
diff --git a/drivers/staging/batman-adv/translation-table.c b/drivers/staging/batman-adv/translation-table.c
index 63d0967..a41bedd 100644
--- a/drivers/staging/batman-adv/translation-table.c
+++ b/drivers/staging/batman-adv/translation-table.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "translation-table.h"
 #include "soft-interface.h"
@@ -111,8 +113,7 @@ void hna_local_add(uint8_t *addr)
 				       hna_local_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize local hna hash table\n");
+			pr_err("Couldn't resize local hna hash table\n");
 		else
 			hna_local_hash = swaphash;
 	}
@@ -364,8 +365,7 @@ void hna_global_add_orig(struct orig_node *orig_node,
 				       hna_global_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize global hna hash table\n");
+			pr_err("Couldn't resize global hna hash table\n");
 		else
 			hna_global_hash = swaphash;
 	}
diff --git a/drivers/staging/batman-adv/vis.c b/drivers/staging/batman-adv/vis.c
index 1d3d954..380e996 100644
--- a/drivers/staging/batman-adv/vis.c
+++ b/drivers/staging/batman-adv/vis.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "translation-table.h"
@@ -628,7 +630,7 @@ static void send_vis_packet(struct vis_info *info)
 	int packet_length;
 
 	if (info->packet.ttl < 2) {
-		printk(KERN_WARNING "batman-adv: Error - can't send vis packet: ttl exceeded\n");
+		pr_warning("Error - can't send vis packet: ttl exceeded\n");
 		return;
 	}
 
@@ -690,13 +692,13 @@ int vis_init(void)
 
 	vis_hash = hash_new(256, vis_info_cmp, vis_info_choose);
 	if (!vis_hash) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis_hash\n");
+		pr_err("Can't initialize vis_hash\n");
 		goto err;
 	}
 
 	my_vis_info = kmalloc(1000, GFP_ATOMIC);
 	if (!my_vis_info) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis packet\n");
+		pr_err("Can't initialize vis packet\n");
 		goto err;
 	}
 
@@ -717,8 +719,7 @@ int vis_init(void)
 	memcpy(my_vis_info->packet.sender_orig, mainIfAddr, ETH_ALEN);
 
 	if (hash_add(vis_hash, my_vis_info) < 0) {
-		printk(KERN_ERR
-		       "batman-adv:Can't add own vis packet into hash\n");
+		pr_err("Can't add own vis packet into hash\n");
 		/* not in hash, need to remove it manually. */
 		kref_put(&my_vis_info->refcount, free_info);
 		goto err;




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

* Re: [PATCH] MAINTAINERS: Add staging/b.a.t.m.a.n
  2010-06-02 20:08   ` [PATCH] MAINTAINERS: Add staging/b.a.t.m.a.n Joe Perches
@ 2010-06-02 20:17     ` Greg KH
  2010-06-02 20:19       ` Randy Dunlap
  0 siblings, 1 reply; 20+ messages in thread
From: Greg KH @ 2010-06-02 20:17 UTC (permalink / raw)
  To: Joe Perches; +Cc: devel, linux-kernel, Andrew Morton

On Wed, Jun 02, 2010 at 01:08:39PM -0700, Joe Perches wrote:
> On Wed, 2010-06-02 at 11:53 -0700, Greg KH wrote:
> > The TODO file in this directory clearly states who to copy on patches to
> > these files.
> 
> Does anyone look at those? ;)

Yes, they should.

Heck, get_maintainer.pl would have given you the correct people to cc:
as well, why not use that?

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  MAINTAINERS |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 2652ebc..e25e15a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -5436,6 +5436,14 @@ L:	devel@driverdev.osuosl.org
>  S:	Maintained
>  F:	drivers/staging/
>  
> +STAGING B.A.T.M.A.N.
> +M:	Marek Lindner <lindner_marek@yahoo.de>
> +M:	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> +M:	Andrew Lunn <andrew@lunn.ch>
> +L:	b.a.t.m.a.n@lists.open-mesh.net
> +S:	Maintained (one day soon)
> +F:	drivers/staging/batman-adv/

Care to at least cc: the people who you are adding to the file?

To not do so is a bit rude, don't you think so?

I'm not going to take this, sorry.

greg k-h

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

* Re: [PATCH] MAINTAINERS: Add staging/b.a.t.m.a.n
  2010-06-02 20:17     ` Greg KH
@ 2010-06-02 20:19       ` Randy Dunlap
  2010-06-02 20:27         ` Joe Perches
  0 siblings, 1 reply; 20+ messages in thread
From: Randy Dunlap @ 2010-06-02 20:19 UTC (permalink / raw)
  To: Greg KH; +Cc: Joe Perches, devel, linux-kernel, Andrew Morton

On Wed, 2 Jun 2010 13:17:17 -0700 Greg KH wrote:

> On Wed, Jun 02, 2010 at 01:08:39PM -0700, Joe Perches wrote:
> > On Wed, 2010-06-02 at 11:53 -0700, Greg KH wrote:
> > > The TODO file in this directory clearly states who to copy on patches to
> > > these files.
> > 
> > Does anyone look at those? ;)
> 
> Yes, they should.
> 
> Heck, get_maintainer.pl would have given you the correct people to cc:
> as well, why not use that?
> 
> > Signed-off-by: Joe Perches <joe@perches.com>
> > ---
> >  MAINTAINERS |    8 ++++++++
> >  1 files changed, 8 insertions(+), 0 deletions(-)
> > 
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 2652ebc..e25e15a 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -5436,6 +5436,14 @@ L:	devel@driverdev.osuosl.org
> >  S:	Maintained
> >  F:	drivers/staging/
> >  
> > +STAGING B.A.T.M.A.N.
> > +M:	Marek Lindner <lindner_marek@yahoo.de>
> > +M:	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> > +M:	Andrew Lunn <andrew@lunn.ch>
> > +L:	b.a.t.m.a.n@lists.open-mesh.net
> > +S:	Maintained (one day soon)
> > +F:	drivers/staging/batman-adv/
> 
> Care to at least cc: the people who you are adding to the file?
> 
> To not do so is a bit rude, don't you think so?
> 
> I'm not going to take this, sorry.


Sure he should have cc-ed them, but it's still a valid patch and should
be applied.

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

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

* Re: [PATCH] MAINTAINERS: Add staging/b.a.t.m.a.n
  2010-06-02 20:19       ` Randy Dunlap
@ 2010-06-02 20:27         ` Joe Perches
  0 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-02 20:27 UTC (permalink / raw)
  To: Randy Dunlap, Marek Lindner, Simon Wunderlich, Andrew Lunn
  Cc: Greg KH, devel, linux-kernel, Andrew Morton

On Wed, 2010-06-02 at 13:19 -0700, Randy Dunlap wrote:
> On Wed, 2 Jun 2010 13:17:17 -0700 Greg KH wrote:
> > On Wed, Jun 02, 2010 at 01:08:39PM -0700, Joe Perches wrote:
> > > On Wed, 2010-06-02 at 11:53 -0700, Greg KH wrote:
> > > > The TODO file in this directory clearly states who to copy on patches to
> > > > these files.
> > > Does anyone look at those? ;)
> > Yes, they should.
> > Heck, get_maintainer.pl would have given you the correct people to cc:
> > as well, why not use that?

I know that script.
In fact, I did use it with my preferred options.

> > > Signed-off-by: Joe Perches <joe@perches.com>
> > > ---
> > >  MAINTAINERS |    8 ++++++++
> > >  1 files changed, 8 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/MAINTAINERS b/MAINTAINERS
> > > index 2652ebc..e25e15a 100644
> > > --- a/MAINTAINERS
> > > +++ b/MAINTAINERS
> > > @@ -5436,6 +5436,14 @@ L:	devel@driverdev.osuosl.org
> > >  S:	Maintained
> > >  F:	drivers/staging/
> > >  
> > > +STAGING B.A.T.M.A.N.
> > > +M:	Marek Lindner <lindner_marek@yahoo.de>
> > > +M:	Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
> > > +M:	Andrew Lunn <andrew@lunn.ch>
> > > +L:	b.a.t.m.a.n@lists.open-mesh.net
> > > +S:	Maintained (one day soon)
> > > +F:	drivers/staging/batman-adv/
> > 
> > Care to at least cc: the people who you are adding to the file?
> > To not do so is a bit rude, don't you think so?

twas, oversight.  Apologies to them.

They're already described in a TODO file as the people to cc,
so I rather doubt they'll mind.
 
> > I'm not going to take this, sorry.

You're just being you.
Perhaps Andrew will take it.

cheers, Joe



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

* [B.A.T.M.A.N.] [PATCH-trunk] batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-02 20:11   ` Joe Perches
  (?)
@ 2010-06-03 15:53   ` Sven Eckelmann
  2010-06-03 17:27     ` Sven Eckelmann
  -1 siblings, 1 reply; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-03 15:53 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Joe Perches

From: Joe Perches <joe@perches.com>

Compile tested only

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove "batman-adv:" from format strings
Use pr_<level>
Use netdev_<level>

Signed-off-by: Joe Perches <joe@perches.com>
[sven.eckelmann@gmx.de: Adapted for current batman-adv version]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 This version is just for trunk because I haven't checked if it really works.
 (not on 2.6.34 nor on 2.6.21).

 batman-adv-kernelland/aggregation.c       |    2 +
 batman-adv-kernelland/bat_debugfs.c       |    6 ++-
 batman-adv-kernelland/bat_sysfs.c         |   68 ++++++++++++++++------------
 batman-adv-kernelland/bitarray.c          |    2 +
 batman-adv-kernelland/compat.h            |   32 +++++++++++++
 batman-adv-kernelland/gateway_client.c    |    2 +
 batman-adv-kernelland/gateway_common.c    |   54 ++++++++++-------------
 batman-adv-kernelland/hard-interface.c    |   31 +++++--------
 batman-adv-kernelland/icmp_socket.c       |   11 +++--
 batman-adv-kernelland/main.c              |   17 +++----
 batman-adv-kernelland/main.h              |   18 ++++---
 batman-adv-kernelland/originator.c        |   17 +++----
 batman-adv-kernelland/routing.c           |   14 +++---
 batman-adv-kernelland/send.c              |   11 ++---
 batman-adv-kernelland/translation-table.c |    8 ++--
 batman-adv-kernelland/vis.c               |   11 +++--
 16 files changed, 168 insertions(+), 136 deletions(-)

diff --git a/batman-adv-kernelland/aggregation.c b/batman-adv-kernelland/aggregation.c
index 61b6192..2c3c2a1 100644
--- a/batman-adv-kernelland/aggregation.c
+++ b/batman-adv-kernelland/aggregation.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "aggregation.h"
 #include "send.h"
diff --git a/batman-adv-kernelland/bat_debugfs.c b/batman-adv-kernelland/bat_debugfs.c
index bc1591f..cf2545a 100644
--- a/batman-adv-kernelland/bat_debugfs.c
+++ b/batman-adv-kernelland/bat_debugfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 
 #include "main.h"
@@ -130,8 +132,8 @@ int debugfs_add_meshif(struct net_device *dev)
 					  bat_priv->debug_dir,
 					  dev, &(*bat_debug)->fops);
 		if (!file) {
-			printk(KERN_ERR "batman-adv:Can't add debugfs file: "
-			       "%s/%s\n", dev->name, ((*bat_debug)->attr).name);
+			pr_err("Can't add debugfs file: %s/%s\n",
+			       dev->name, ((*bat_debug)->attr).name);
 			goto rem_attr;
 		}
 	}
diff --git a/batman-adv-kernelland/bat_sysfs.c b/batman-adv-kernelland/bat_sysfs.c
index 180023e..0832200 100644
--- a/batman-adv-kernelland/bat_sysfs.c
+++ b/batman-adv-kernelland/bat_sysfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "translation-table.h"
@@ -70,18 +72,20 @@ static ssize_t store_aggr_ogms(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'aggregate OGM' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'aggregate OGM' setting on"
+			    " mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->aggregation_enabled) == aggr_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing aggregation from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->aggregation_enabled) == 1 ?
-	       "enabled" : "disabled", aggr_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	netdev_info(net_dev, "Changing aggregation from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->aggregation_enabled) == 1 ?
+		    "enabled" : "disabled",
+		    aggr_tmp == 1 ? "enabled" : "disabled");
 
 	atomic_set(&bat_priv->aggregation_enabled, (unsigned)aggr_tmp);
 	return count;
@@ -125,17 +129,16 @@ static ssize_t store_bond(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'bonding' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'bonding' setting"
+			    "on mesh received: %s\n", buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->bonding_mode) == bonding_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing bonding from: %d to: %d on mesh: %s\n",
-	       atomic_read(&bat_priv->bonding_mode), bonding_mode_tmp,
-	       net_dev->name);
+	netdev_info(net_dev, "Changing bonding from: %d to: %d on mesh\n",
+		    atomic_read(&bat_priv->bonding_mode), bonding_mode_tmp);
 
 	atomic_set(&bat_priv->bonding_mode, (unsigned)bonding_mode_tmp);
 	return count;
@@ -177,18 +180,20 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting"
+			    " on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", net_dev->name);
+	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server",
+		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server");
 
 	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
 	return count;
@@ -259,23 +264,27 @@ static ssize_t store_orig_interval(struct kobject *kobj, struct attribute *attr,
 
 	ret = strict_strtoul(buff, 10, &orig_interval_tmp);
 	if (ret) {
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'orig_interval' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'orig_interval' setting on "
+			    "mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (orig_interval_tmp <= JITTER * 2) {
-		printk(KERN_INFO "batman-adv:New originator interval too small: %li (min: %i)\n",
-		       orig_interval_tmp, JITTER * 2);
+		netdev_info(net_dev, "New originator interval too small: %li"
+			    " (min: %i)\n",
+			    orig_interval_tmp, JITTER * 2);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->orig_interval) == orig_interval_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing originator interval from: %i to: %li on mesh: %s\n",
-	       atomic_read(&bat_priv->orig_interval),
-	       orig_interval_tmp, net_dev->name);
+	netdev_info(net_dev,
+		    "Changing originator interval from: %i to: %li"" on mesh\n",
+		    atomic_read(&bat_priv->orig_interval),
+		    orig_interval_tmp);
 
 	atomic_set(&bat_priv->orig_interval, orig_interval_tmp);
 	return count;
@@ -322,7 +331,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
 						    batif_kobject);
 	if (!bat_priv->mesh_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_MESH_SUBDIR);
 		goto out;
 	}
@@ -331,7 +340,7 @@ int sysfs_add_meshif(struct net_device *dev)
 		err = sysfs_create_file(bat_priv->mesh_obj,
 					&((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
@@ -398,7 +407,8 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'mesh_iface' setting received: %s\n",
+		pr_err("Invalid parameter for 'mesh_iface' setting received: "
+		       "%s\n",
 		       buff);
 		return -EINVAL;
 	}
@@ -461,7 +471,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 						    hardif_kobject);
 
 	if (!*hardif_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_BAT_SUBDIR);
 		goto out;
 	}
@@ -469,7 +479,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 	for (bat_attr = batman_attrs; *bat_attr; ++bat_attr) {
 		err = sysfs_create_file(*hardif_obj, &((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_BAT_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
diff --git a/batman-adv-kernelland/bitarray.c b/batman-adv-kernelland/bitarray.c
index a607827..ac9ae97 100644
--- a/batman-adv-kernelland/bitarray.c
+++ b/batman-adv-kernelland/bitarray.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bitarray.h"
 
diff --git a/batman-adv-kernelland/compat.h b/batman-adv-kernelland/compat.h
index 614d116..e9a0a20 100644
--- a/batman-adv-kernelland/compat.h
+++ b/batman-adv-kernelland/compat.h
@@ -74,6 +74,19 @@ static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
 
 #endif /* < KERNEL_VERSION(2, 6, 23) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_err(fmt, ...) \
+	printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+	printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+
+#endif /* < KERNEL_VERSION(2, 6, 24) */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
 
 #define strict_strtoul(cp, base, res) \
@@ -244,3 +257,22 @@ static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
 }
 
 #endif /* < KERNEL_VERSION(2, 6, 29) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+
+static inline const char *netdev_name(const struct net_device *dev)
+{
+	if (dev->reg_state != NETREG_REGISTERED)
+		return "(unregistered net_device)";
+	return dev->name;
+}
+
+#define netdev_printk(level, netdev, format, args...)		\
+	dev_printk(level, (netdev)->dev.parent,			\
+		   "%s: " format,				\
+		   netdev_name(netdev), ##args)
+
+#define netdev_info(dev, format, args...)			\
+	netdev_printk(KERN_INFO, dev, format, ##args)
+
+#endif /* < KERNEL_VERSION(2, 6, 34) */
diff --git a/batman-adv-kernelland/gateway_client.c b/batman-adv-kernelland/gateway_client.c
index 552ef6f..d975d15 100644
--- a/batman-adv-kernelland/gateway_client.c
+++ b/batman-adv-kernelland/gateway_client.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "gateway_client.h"
 #include "gateway_common.h"
diff --git a/batman-adv-kernelland/gateway_common.c b/batman-adv-kernelland/gateway_common.c
index 270cf3d..09b76bc 100644
--- a/batman-adv-kernelland/gateway_common.c
+++ b/batman-adv-kernelland/gateway_common.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "gateway_common.h"
 #include "gateway_client.h"
@@ -87,16 +89,14 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 	case GW_MODE_CLIENT:
 		ret = strict_strtoul(tokptr, 10, gw_class_tmp);
 		if (ret) {
-			printk(KERN_ERR "batman-adv: "
-			       "Client class of gateway mode invalid: %s\n",
+			pr_err("Client class of gateway mode invalid: %s\n",
 			       tokptr);
 			return false;
 		}
 
 		if (*gw_class_tmp > TQ_MAX_VALUE) {
-			printk(KERN_ERR "batman-adv: Client class of gateway "
-					"mode greater than %i: %ld\n",
-					TQ_MAX_VALUE, *gw_class_tmp);
+			pr_err("Client class of gateway mode greater than "
+			       "%i: %ld\n", TQ_MAX_VALUE, *gw_class_tmp);
 			return false;
 		}
 
@@ -121,8 +121,7 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 
 		ret = strict_strtoul(tokptr, 10, down);
 		if (ret) {
-			printk(KERN_ERR "batman-adv: "
-			       "Download speed of gateway mode invalid: %s\n",
+			pr_err("Download speed of gateway mode invalid: %s\n",
 			       tokptr);
 			return false;
 		}
@@ -147,9 +146,8 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 
 			ret = strict_strtoul(slash_ptr + 1, 10, up);
 			if (ret) {
-				printk(KERN_ERR "batman-adv: Upload speed of "
-				       "gateway mode invalid: %s\n",
-				       slash_ptr + 1);
+				pr_err("Upload speed of gateway mode invalid: "
+				       "%s\n", slash_ptr + 1);
 				return false;
 			}
 
@@ -217,11 +215,10 @@ next:
 	}
 
 	if (!gw_mode_tmp_str) {
-		printk(KERN_INFO "batman-adv: "
-		       "Gateway mode can only be set to: '%s', '%s' or '%s' - "
-		       "given value: %s\n",
-		       GW_MODE_OFF_NAME, GW_MODE_CLIENT_NAME,
-		       GW_MODE_SERVER_NAME, buff);
+		pr_info("Gateway mode can only be set to: '%s', '%s' or '%s' - "
+			"given value: %s\n",
+			GW_MODE_OFF_NAME, GW_MODE_CLIENT_NAME,
+			GW_MODE_SERVER_NAME, buff);
 		goto end;
 	}
 
@@ -242,10 +239,9 @@ next:
 		if ((gw_mode_tmp == GW_MODE_CLIENT) && (!gw_class_tmp))
 			gw_class_tmp = 20;
 
-		printk(KERN_INFO "batman-adv: "
-		       "Changing gateway mode from: '%s' to: '%s' "
-		       "(gw_class: %ld)\n",
-		       gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp);
+		pr_info("Changing gateway mode from: '%s' to: '%s' "
+			"(gw_class: %ld)\n",
+			gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp);
 		break;
 	case GW_MODE_SERVER:
 		if (!down)
@@ -265,19 +261,17 @@ next:
 				     (int *)&down, (int *)&up);
 
 		gw_deselect();
-		printk(KERN_INFO
-		       "batman-adv: Changing gateway mode from: '%s' to: '%s' "
-		       "(gw_class: %ld -> propagating: %ld%s/%ld%s)\n",
-		       gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp,
-		       (down > 2048 ? down / 1024 : down),
-		       (down > 2048 ? "MBit" : "KBit"),
-		       (up > 2048 ? up / 1024 : up),
-		       (up > 2048 ? "MBit" : "KBit"));
+		pr_info("Changing gateway mode from: '%s' to: '%s' "
+			"(gw_class: %ld -> propagating: %ld%s/%ld%s)\n",
+			gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp,
+			(down > 2048 ? down / 1024 : down),
+			(down > 2048 ? "MBit" : "KBit"),
+			(up > 2048 ? up / 1024 : up),
+			(up > 2048 ? "MBit" : "KBit"));
 		break;
 	default:
-		printk(KERN_INFO "batman-adv: "
-			  "Changing gateway mode from: '%s' to: '%s'\n",
-			  gw_mode_curr_str, gw_mode_tmp_str);
+		pr_info("Changing gateway mode from: '%s' to: '%s'\n",
+			gw_mode_curr_str, gw_mode_tmp_str);
 		break;
 	}
 
diff --git a/batman-adv-kernelland/hard-interface.c b/batman-adv-kernelland/hard-interface.c
index ad2e496..9c637b0 100644
--- a/batman-adv-kernelland/hard-interface.c
+++ b/batman-adv-kernelland/hard-interface.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "hard-interface.h"
 #include "soft-interface.h"
@@ -152,12 +154,9 @@ static void check_known_mac_addr(uint8_t *addr)
 		if (!compare_orig(batman_if->net_dev->dev_addr, addr))
 			continue;
 
-		printk(KERN_WARNING "batman-adv:"
-		    "The newly added mac address (%pM) already exists on: %s\n",
-		    addr, batman_if->dev);
-		printk(KERN_WARNING "batman-adv:"
-		    "It is strongly recommended to keep mac addresses unique"
-		    "to avoid problems!\n");
+		pr_warning("The newly added mac address (%pM) already exists on: %s\n",
+			   addr, batman_if->dev);
+		pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
 	}
 	rcu_read_unlock();
 }
@@ -209,8 +208,7 @@ static void hardif_activate_interface(struct bat_priv *bat_priv,
 	if (!bat_priv->primary_if)
 		set_primary_if(bat_priv, batman_if);
 
-	printk(KERN_INFO "batman-adv:Interface activated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface activated: %s\n", batman_if->dev);
 
 	if (atomic_read(&module_state) == MODULE_INACTIVE)
 		activate_module();
@@ -229,8 +227,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	batman_if->if_status = IF_INACTIVE;
 
-	printk(KERN_INFO "batman-adv:Interface deactivated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface deactivated: %s\n", batman_if->dev);
 
 	update_min_mtu();
 }
@@ -248,8 +245,7 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	batman_if->packet_buff = kmalloc(batman_if->packet_len, GFP_ATOMIC);
 
 	if (!batman_if->packet_buff) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface packet (%s): out of memory\n",
+		pr_err("Can't add interface packet (%s): out of memory\n",
 		       batman_if->dev);
 		goto err;
 	}
@@ -268,14 +264,12 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	orig_hash_add_if(batman_if, bat_priv->num_ifaces);
 
 	atomic_set(&batman_if->seqno, 1);
-	printk(KERN_INFO "batman-adv:Adding interface: %s\n", batman_if->dev);
+	pr_info("Adding interface: %s\n", batman_if->dev);
 
 	if (hardif_is_iface_up(batman_if))
 		hardif_activate_interface(bat_priv, batman_if);
 	else
-		printk(KERN_ERR "batman-adv:"
-		       "Not using interface %s "
-		       "(retrying later): interface not active\n",
+		pr_err("Not using interface %s (retrying later): interface not active\n",
 		       batman_if->dev);
 
 	/* begin scheduling originator messages on that interface */
@@ -299,7 +293,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 	if (batman_if->if_status != IF_INACTIVE)
 		return;
 
-	printk(KERN_INFO "batman-adv:Removing interface: %s\n", batman_if->dev);
+	pr_info("Removing interface: %s\n", batman_if->dev);
 	bat_priv->num_ifaces--;
 	orig_hash_del_if(batman_if, bat_priv->num_ifaces);
 
@@ -326,8 +320,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
 
 	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
 	if (!batman_if) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface (%s): out of memory\n",
+		pr_err("Can't add interface (%s): out of memory\n",
 		       net_dev->name);
 		goto out;
 	}
diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c
index 08cca22..d75e8af 100644
--- a/batman-adv-kernelland/icmp_socket.c
+++ b/batman-adv-kernelland/icmp_socket.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 #include <linux/slab.h>
 #include "main.h"
@@ -60,8 +62,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
 	}
 
 	if (i == ARRAY_SIZE(socket_client_hash)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Error - can't add another packet client: "
+		pr_err("Error - can't add another packet client: "
 		       "maximum number of clients reached\n");
 		kfree(socket_client);
 		return -EXFULL;
@@ -166,7 +167,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 	unsigned long flags;
 
 	if (len < sizeof(struct icmp_packet)) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"invalid packet size\n");
 		return -EINVAL;
@@ -182,14 +183,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 		return -EFAULT;
 
 	if (icmp_packet.packet_type != BAT_ICMP) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus packet type (expected: BAT_ICMP)\n");
 		return -EINVAL;
 	}
 
 	if (icmp_packet.msg_type != ECHO_REQUEST) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus message type (expected: ECHO_REQUEST)\n");
 		return -EINVAL;
diff --git a/batman-adv-kernelland/main.c b/batman-adv-kernelland/main.c
index 20a0d54..0b14f07 100644
--- a/batman-adv-kernelland/main.c
+++ b/batman-adv-kernelland/main.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "bat_debugfs.h"
@@ -94,16 +96,14 @@ int init_module(void)
 				   interface_setup);
 
 	if (!soft_device) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to allocate the batman interface\n");
+		pr_err("Unable to allocate the batman interface\n");
 		goto end;
 	}
 
 	retval = register_netdev(soft_device);
 
 	if (retval < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to register the batman interface: %i\n", retval);
+		pr_err("Unable to register the batman interface: %i\n", retval);
 		goto free_soft_device;
 	}
 
@@ -120,9 +120,8 @@ int init_module(void)
 	register_netdevice_notifier(&hard_if_notifier);
 	dev_add_pack(&batman_adv_packet_type);
 
-	printk(KERN_INFO "batman-adv:"
-	       "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
-	       SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+	pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
+		SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
 
 	return 0;
 
@@ -182,9 +181,7 @@ void activate_module(void)
 	goto end;
 
 err:
-	printk(KERN_ERR "batman-adv:"
-	       "Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
+	pr_err("Unable to allocate memory for mesh information structures: out of mem ?\n");
 	deactivate_module();
 end:
 	return;
diff --git a/batman-adv-kernelland/main.h b/batman-adv-kernelland/main.h
index e2b086b..f5dbe78 100644
--- a/batman-adv-kernelland/main.h
+++ b/batman-adv-kernelland/main.h
@@ -96,15 +96,17 @@
 extern int debug;
 
 extern int bat_debug_type(int type);
-#define bat_dbg(type, fmt, arg...) do {					\
-		if (bat_debug_type(type))				\
-			printk(KERN_DEBUG "batman-adv:" fmt, ## arg);	\
-	}								\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (bat_debug_type(type))				\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-#define bat_dbg(type, fmt, arg...) do {		\
-	}					\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (0)							\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #endif
 
 /*
diff --git a/batman-adv-kernelland/originator.c b/batman-adv-kernelland/originator.c
index 28e35b6..c86a92d 100644
--- a/batman-adv-kernelland/originator.c
+++ b/batman-adv-kernelland/originator.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /* increase the reference counter for this originator */
 
 #include "main.h"
@@ -165,8 +167,7 @@ struct orig_node *get_orig_node(uint8_t *addr)
 		swaphash = hash_resize(orig_hash, orig_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR
-			       "batman-adv:Couldn't resize orig hash table\n");
+			pr_err("Couldn't resize orig hash table\n");
 		else
 			orig_hash = swaphash;
 	}
@@ -360,8 +361,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	data_ptr = kmalloc(max_if_num * sizeof(TYPE_OF_WORD) * NUM_WORDS,
 			   GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -372,8 +372,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -422,8 +421,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
 	chunk_size = sizeof(TYPE_OF_WORD) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -444,8 +442,7 @@ free_bcast_own:
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
diff --git a/batman-adv-kernelland/routing.c b/batman-adv-kernelland/routing.c
index 62699ca..3ff0c67 100644
--- a/batman-adv-kernelland/routing.c
+++ b/batman-adv-kernelland/routing.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "routing.h"
 #include "send.h"
@@ -863,10 +865,8 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb, size_t icmp_len)
 
 	/* send TTL exceeded if packet is an echo request (traceroute) */
 	if (icmp_packet->msg_type != ECHO_REQUEST) {
-		printk(KERN_WARNING "batman-adv:"
-		       "Warning - can't forward icmp packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       icmp_packet->orig, icmp_packet->dst);
+		pr_warning("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
+			   icmp_packet->orig, icmp_packet->dst);
 		return NET_RX_DROP;
 	}
 
@@ -1138,10 +1138,8 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if)
 
 	/* TTL exceeded */
 	if (unicast_packet->ttl < 2) {
-		printk(KERN_WARNING "batman-adv:Warning - "
-		       "can't forward unicast packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       ethhdr->h_source, unicast_packet->dest);
+		pr_warning("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
+			   ethhdr->h_source, unicast_packet->dest);
 		return NET_RX_DROP;
 	}
 
diff --git a/batman-adv-kernelland/send.c b/batman-adv-kernelland/send.c
index 8df44a6..fcfa639 100644
--- a/batman-adv-kernelland/send.c
+++ b/batman-adv-kernelland/send.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "routing.h"
@@ -68,10 +70,8 @@ int send_skb_packet(struct sk_buff *skb,
 		goto send_skb_err;
 
 	if (!(batman_if->net_dev->flags & IFF_UP)) {
-		printk(KERN_WARNING
-		       "batman-adv:Interface %s "
-		       "is not up - can't send packet via that interface!\n",
-		       batman_if->dev);
+		pr_warning("Interface %s is not up - can't send packet via that interface!\n",
+			   batman_if->dev);
 		goto send_skb_err;
 	}
 
@@ -186,8 +186,7 @@ static void send_packet(struct forw_packet *forw_packet)
 	unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0);
 
 	if (!forw_packet->if_incoming) {
-		printk(KERN_ERR "batman-adv: Error - can't forward packet: "
-		       "incoming iface not specified\n");
+		pr_err("Error - can't forward packet: incoming iface not specified\n");
 		return;
 	}
 
diff --git a/batman-adv-kernelland/translation-table.c b/batman-adv-kernelland/translation-table.c
index 8edc175..e4c5055 100644
--- a/batman-adv-kernelland/translation-table.c
+++ b/batman-adv-kernelland/translation-table.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "translation-table.h"
 #include "soft-interface.h"
@@ -112,8 +114,7 @@ void hna_local_add(uint8_t *addr)
 				       hna_local_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize local hna hash table\n");
+			pr_err("Couldn't resize local hna hash table\n");
 		else
 			hna_local_hash = swaphash;
 	}
@@ -365,8 +366,7 @@ void hna_global_add_orig(struct orig_node *orig_node,
 				       hna_global_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize global hna hash table\n");
+			pr_err("Couldn't resize global hna hash table\n");
 		else
 			hna_global_hash = swaphash;
 	}
diff --git a/batman-adv-kernelland/vis.c b/batman-adv-kernelland/vis.c
index 68ee903..8308ce2 100644
--- a/batman-adv-kernelland/vis.c
+++ b/batman-adv-kernelland/vis.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "translation-table.h"
@@ -679,7 +681,7 @@ static void send_vis_packet(struct vis_info *info)
 	int packet_length;
 
 	if (info->packet.ttl < 2) {
-		printk(KERN_WARNING "batman-adv: Error - can't send vis packet: ttl exceeded\n");
+		pr_warning("Error - can't send vis packet: ttl exceeded\n");
 		return;
 	}
 
@@ -741,13 +743,13 @@ int vis_init(void)
 
 	vis_hash = hash_new(256, vis_info_cmp, vis_info_choose);
 	if (!vis_hash) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis_hash\n");
+		pr_err("Can't initialize vis_hash\n");
 		goto err;
 	}
 
 	my_vis_info = kmalloc(1000, GFP_ATOMIC);
 	if (!my_vis_info) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis packet\n");
+		pr_err("Can't initialize vis packet\n");
 		goto err;
 	}
 
@@ -768,8 +770,7 @@ int vis_init(void)
 	memcpy(my_vis_info->packet.sender_orig, mainIfAddr, ETH_ALEN);
 
 	if (hash_add(vis_hash, my_vis_info) < 0) {
-		printk(KERN_ERR
-		       "batman-adv:Can't add own vis packet into hash\n");
+		pr_err("Can't add own vis packet into hash\n");
 		/* not in hash, need to remove it manually. */
 		kref_put(&my_vis_info->refcount, free_info);
 		goto err;
-- 
1.7.1


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

* Re: [B.A.T.M.A.N.] [PATCH-trunk] batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-03 15:53   ` [B.A.T.M.A.N.] [PATCH-trunk] batman-adv: " Sven Eckelmann
@ 2010-06-03 17:27     ` Sven Eckelmann
  0 siblings, 0 replies; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-03 17:27 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: Text/Plain, Size: 829 bytes --]

Sven Eckelmann wrote:
> From: Joe Perches <joe@perches.com>
> 
> Compile tested only
> 
> Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> Remove "batman-adv:" from format strings
> Use pr_<level>
> Use netdev_<level>
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> [sven.eckelmann@gmx.de: Adapted for current batman-adv version]
> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
> ---
>  This version is just for trunk because I haven't checked if it really
> works. (not on 2.6.34 nor on 2.6.21).

Forgot to say that this patch is on top of Simon's "bonding and interface 
alternating" patch and my version of the "Convert MAC_FMT to %pM" patch. So it 
is open for discussion which should enter first... but if you want to test it, 
please first apply the other patches.

Best regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* [B.A.T.M.A.N.] [PATCHv2-trunk] batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-02 20:11   ` Joe Perches
  (?)
  (?)
@ 2010-06-04 14:20   ` Sven Eckelmann
  2010-06-04 14:21     ` Sven Eckelmann
  -1 siblings, 1 reply; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-04 14:20 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Joe Perches

From: Joe Perches <joe@perches.com>

Compile tested only

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove "batman-adv:" from format strings
Use pr_<level>
Use netdev_<level>

Signed-off-by: Joe Perches <joe@perches.com>
[sven.eckelmann@gmx.de: Adapted for current batman-adv version]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 Marek, can you please test it with 2.6.21?
 This patch depends on batman-adv: "Convert MAC_FMT to %pM"
 It was rebased on top of "bonding and interface alternating"

 batman-adv-kernelland/aggregation.c       |    2 +
 batman-adv-kernelland/bat_debugfs.c       |    6 ++-
 batman-adv-kernelland/bat_sysfs.c         |   70 ++++++++++++++++------------
 batman-adv-kernelland/bitarray.c          |    2 +
 batman-adv-kernelland/compat.h            |   32 +++++++++++++
 batman-adv-kernelland/gateway_client.c    |    2 +
 batman-adv-kernelland/gateway_common.c    |   54 ++++++++++------------
 batman-adv-kernelland/hard-interface.c    |   31 +++++--------
 batman-adv-kernelland/icmp_socket.c       |   11 +++--
 batman-adv-kernelland/main.c              |   17 +++----
 batman-adv-kernelland/main.h              |   18 ++++---
 batman-adv-kernelland/originator.c        |   17 +++----
 batman-adv-kernelland/routing.c           |   14 +++---
 batman-adv-kernelland/send.c              |   11 ++---
 batman-adv-kernelland/translation-table.c |    8 ++--
 batman-adv-kernelland/vis.c               |   11 +++--
 16 files changed, 169 insertions(+), 137 deletions(-)

diff --git a/batman-adv-kernelland/aggregation.c b/batman-adv-kernelland/aggregation.c
index 61b6192..2c3c2a1 100644
--- a/batman-adv-kernelland/aggregation.c
+++ b/batman-adv-kernelland/aggregation.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "aggregation.h"
 #include "send.h"
diff --git a/batman-adv-kernelland/bat_debugfs.c b/batman-adv-kernelland/bat_debugfs.c
index bc1591f..cf2545a 100644
--- a/batman-adv-kernelland/bat_debugfs.c
+++ b/batman-adv-kernelland/bat_debugfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 
 #include "main.h"
@@ -130,8 +132,8 @@ int debugfs_add_meshif(struct net_device *dev)
 					  bat_priv->debug_dir,
 					  dev, &(*bat_debug)->fops);
 		if (!file) {
-			printk(KERN_ERR "batman-adv:Can't add debugfs file: "
-			       "%s/%s\n", dev->name, ((*bat_debug)->attr).name);
+			pr_err("Can't add debugfs file: %s/%s\n",
+			       dev->name, ((*bat_debug)->attr).name);
 			goto rem_attr;
 		}
 	}
diff --git a/batman-adv-kernelland/bat_sysfs.c b/batman-adv-kernelland/bat_sysfs.c
index 05703c1..319c09c 100644
--- a/batman-adv-kernelland/bat_sysfs.c
+++ b/batman-adv-kernelland/bat_sysfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "translation-table.h"
@@ -70,18 +72,20 @@ static ssize_t store_aggr_ogms(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'aggregate OGM' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'aggregate OGM' setting on"
+			    " mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->aggregation_enabled) == aggr_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing aggregation from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->aggregation_enabled) == 1 ?
-	       "enabled" : "disabled", aggr_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	netdev_info(net_dev, "Changing aggregation from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->aggregation_enabled) == 1 ?
+		    "enabled" : "disabled",
+		    aggr_tmp == 1 ? "enabled" : "disabled");
 
 	atomic_set(&bat_priv->aggregation_enabled, (unsigned)aggr_tmp);
 	return count;
@@ -118,19 +122,18 @@ static ssize_t store_bond(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'bonding' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'bonding' setting"
+			    "on mesh received: %s\n", buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->bonding_enabled) == bonding_enabled_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing bonding from: %s to: %s on mesh: %s\n",
+	netdev_info(net_dev, "Changing bonding from: %s to: %s on mesh\n",
 	       atomic_read(&bat_priv->bonding_enabled) == 1 ?
-	       "enabled" : "disabled",
-	       bonding_enabled_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	       "enabled" : "disabled",  bonding_enabled_tmp == 1 ? "enabled" :
+	       "disabled");
 
 	atomic_set(&bat_priv->bonding_enabled, (unsigned)bonding_enabled_tmp);
 	return count;
@@ -172,18 +175,20 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting"
+			    " on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", net_dev->name);
+	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server",
+		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server");
 
 	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
 	return count;
@@ -254,23 +259,27 @@ static ssize_t store_orig_interval(struct kobject *kobj, struct attribute *attr,
 
 	ret = strict_strtoul(buff, 10, &orig_interval_tmp);
 	if (ret) {
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'orig_interval' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'orig_interval' setting on "
+			    "mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (orig_interval_tmp <= JITTER * 2) {
-		printk(KERN_INFO "batman-adv:New originator interval too small: %li (min: %i)\n",
-		       orig_interval_tmp, JITTER * 2);
+		netdev_info(net_dev, "New originator interval too small: %li"
+			    " (min: %i)\n",
+			    orig_interval_tmp, JITTER * 2);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->orig_interval) == orig_interval_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing originator interval from: %i to: %li on mesh: %s\n",
-	       atomic_read(&bat_priv->orig_interval),
-	       orig_interval_tmp, net_dev->name);
+	netdev_info(net_dev,
+		    "Changing originator interval from: %i to: %li"" on mesh\n",
+		    atomic_read(&bat_priv->orig_interval),
+		    orig_interval_tmp);
 
 	atomic_set(&bat_priv->orig_interval, orig_interval_tmp);
 	return count;
@@ -317,7 +326,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
 						    batif_kobject);
 	if (!bat_priv->mesh_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_MESH_SUBDIR);
 		goto out;
 	}
@@ -326,7 +335,7 @@ int sysfs_add_meshif(struct net_device *dev)
 		err = sysfs_create_file(bat_priv->mesh_obj,
 					&((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
@@ -393,7 +402,8 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'mesh_iface' setting received: %s\n",
+		pr_err("Invalid parameter for 'mesh_iface' setting received: "
+		       "%s\n",
 		       buff);
 		return -EINVAL;
 	}
@@ -456,7 +466,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 						    hardif_kobject);
 
 	if (!*hardif_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_BAT_SUBDIR);
 		goto out;
 	}
@@ -464,7 +474,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 	for (bat_attr = batman_attrs; *bat_attr; ++bat_attr) {
 		err = sysfs_create_file(*hardif_obj, &((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_BAT_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
diff --git a/batman-adv-kernelland/bitarray.c b/batman-adv-kernelland/bitarray.c
index a607827..ac9ae97 100644
--- a/batman-adv-kernelland/bitarray.c
+++ b/batman-adv-kernelland/bitarray.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bitarray.h"
 
diff --git a/batman-adv-kernelland/compat.h b/batman-adv-kernelland/compat.h
index 614d116..e9a0a20 100644
--- a/batman-adv-kernelland/compat.h
+++ b/batman-adv-kernelland/compat.h
@@ -74,6 +74,19 @@ static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
 
 #endif /* < KERNEL_VERSION(2, 6, 23) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_err(fmt, ...) \
+	printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+	printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+
+#endif /* < KERNEL_VERSION(2, 6, 24) */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
 
 #define strict_strtoul(cp, base, res) \
@@ -244,3 +257,22 @@ static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
 }
 
 #endif /* < KERNEL_VERSION(2, 6, 29) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+
+static inline const char *netdev_name(const struct net_device *dev)
+{
+	if (dev->reg_state != NETREG_REGISTERED)
+		return "(unregistered net_device)";
+	return dev->name;
+}
+
+#define netdev_printk(level, netdev, format, args...)		\
+	dev_printk(level, (netdev)->dev.parent,			\
+		   "%s: " format,				\
+		   netdev_name(netdev), ##args)
+
+#define netdev_info(dev, format, args...)			\
+	netdev_printk(KERN_INFO, dev, format, ##args)
+
+#endif /* < KERNEL_VERSION(2, 6, 34) */
diff --git a/batman-adv-kernelland/gateway_client.c b/batman-adv-kernelland/gateway_client.c
index 552ef6f..d975d15 100644
--- a/batman-adv-kernelland/gateway_client.c
+++ b/batman-adv-kernelland/gateway_client.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "gateway_client.h"
 #include "gateway_common.h"
diff --git a/batman-adv-kernelland/gateway_common.c b/batman-adv-kernelland/gateway_common.c
index d542306..90ff9ce 100644
--- a/batman-adv-kernelland/gateway_common.c
+++ b/batman-adv-kernelland/gateway_common.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "gateway_common.h"
 #include "gateway_client.h"
@@ -87,16 +89,14 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 	case GW_MODE_CLIENT:
 		ret = strict_strtoul(tokptr, 10, gw_class_tmp);
 		if (ret) {
-			printk(KERN_ERR "batman-adv: "
-			       "Client class of gateway mode invalid: %s\n",
+			pr_err("Client class of gateway mode invalid: %s\n",
 			       tokptr);
 			return false;
 		}
 
 		if (*gw_class_tmp > TQ_MAX_VALUE) {
-			printk(KERN_ERR "batman-adv: Client class of gateway "
-					"mode greater than %i: %ld\n",
-					TQ_MAX_VALUE, *gw_class_tmp);
+			pr_err("Client class of gateway mode greater than "
+			       "%i: %ld\n", TQ_MAX_VALUE, *gw_class_tmp);
 			return false;
 		}
 
@@ -121,8 +121,7 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 
 		ret = strict_strtoul(tokptr, 10, down);
 		if (ret) {
-			printk(KERN_ERR "batman-adv: "
-			       "Download speed of gateway mode invalid: %s\n",
+			pr_err("Download speed of gateway mode invalid: %s\n",
 			       tokptr);
 			return false;
 		}
@@ -147,9 +146,8 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 
 			ret = strict_strtoul(slash_ptr + 1, 10, up);
 			if (ret) {
-				printk(KERN_ERR "batman-adv: Upload speed of "
-				       "gateway mode invalid: %s\n",
-				       slash_ptr + 1);
+				pr_err("Upload speed of gateway mode invalid: "
+				       "%s\n", slash_ptr + 1);
 				return false;
 			}
 
@@ -217,11 +215,10 @@ next:
 	}
 
 	if (!gw_mode_tmp_str) {
-		printk(KERN_INFO "batman-adv: "
-		       "Gateway mode can only be set to: '%s', '%s' or '%s' - "
-		       "given value: %s\n",
-		       GW_MODE_OFF_NAME, GW_MODE_CLIENT_NAME,
-		       GW_MODE_SERVER_NAME, buff);
+		pr_info("Gateway mode can only be set to: '%s', '%s' or '%s' - "
+			"given value: %s\n",
+			GW_MODE_OFF_NAME, GW_MODE_CLIENT_NAME,
+			GW_MODE_SERVER_NAME, buff);
 		goto end;
 	}
 
@@ -242,10 +239,9 @@ next:
 		if ((gw_mode_tmp == GW_MODE_CLIENT) && (!gw_class_tmp))
 			gw_class_tmp = 20;
 
-		printk(KERN_INFO "batman-adv: "
-		       "Changing gateway mode from: '%s' to: '%s' "
-		       "(gw_class: %ld)\n",
-		       gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp);
+		pr_info("Changing gateway mode from: '%s' to: '%s' "
+			"(gw_class: %ld)\n",
+			gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp);
 		break;
 	case GW_MODE_SERVER:
 		if (!down)
@@ -265,19 +261,17 @@ next:
 				     (int *)&down, (int *)&up);
 
 		gw_deselect();
-		printk(KERN_INFO
-		       "batman-adv: Changing gateway mode from: '%s' to: '%s' "
-		       "(gw_class: %ld -> propagating: %ld%s/%ld%s)\n",
-		       gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp,
-		       (down > 2048 ? down / 1024 : down),
-		       (down > 2048 ? "MBit" : "KBit"),
-		       (up > 2048 ? up / 1024 : up),
-		       (up > 2048 ? "MBit" : "KBit"));
+		pr_info("Changing gateway mode from: '%s' to: '%s' "
+			"(gw_class: %ld -> propagating: %ld%s/%ld%s)\n",
+			gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp,
+			(down > 2048 ? down / 1024 : down),
+			(down > 2048 ? "MBit" : "KBit"),
+			(up > 2048 ? up / 1024 : up),
+			(up > 2048 ? "MBit" : "KBit"));
 		break;
 	default:
-		printk(KERN_INFO "batman-adv: "
-			  "Changing gateway mode from: '%s' to: '%s'\n",
-			  gw_mode_curr_str, gw_mode_tmp_str);
+		pr_info("Changing gateway mode from: '%s' to: '%s'\n",
+			gw_mode_curr_str, gw_mode_tmp_str);
 		break;
 	}
 
diff --git a/batman-adv-kernelland/hard-interface.c b/batman-adv-kernelland/hard-interface.c
index ad2e496..9c637b0 100644
--- a/batman-adv-kernelland/hard-interface.c
+++ b/batman-adv-kernelland/hard-interface.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "hard-interface.h"
 #include "soft-interface.h"
@@ -152,12 +154,9 @@ static void check_known_mac_addr(uint8_t *addr)
 		if (!compare_orig(batman_if->net_dev->dev_addr, addr))
 			continue;
 
-		printk(KERN_WARNING "batman-adv:"
-		    "The newly added mac address (%pM) already exists on: %s\n",
-		    addr, batman_if->dev);
-		printk(KERN_WARNING "batman-adv:"
-		    "It is strongly recommended to keep mac addresses unique"
-		    "to avoid problems!\n");
+		pr_warning("The newly added mac address (%pM) already exists on: %s\n",
+			   addr, batman_if->dev);
+		pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
 	}
 	rcu_read_unlock();
 }
@@ -209,8 +208,7 @@ static void hardif_activate_interface(struct bat_priv *bat_priv,
 	if (!bat_priv->primary_if)
 		set_primary_if(bat_priv, batman_if);
 
-	printk(KERN_INFO "batman-adv:Interface activated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface activated: %s\n", batman_if->dev);
 
 	if (atomic_read(&module_state) == MODULE_INACTIVE)
 		activate_module();
@@ -229,8 +227,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	batman_if->if_status = IF_INACTIVE;
 
-	printk(KERN_INFO "batman-adv:Interface deactivated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface deactivated: %s\n", batman_if->dev);
 
 	update_min_mtu();
 }
@@ -248,8 +245,7 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	batman_if->packet_buff = kmalloc(batman_if->packet_len, GFP_ATOMIC);
 
 	if (!batman_if->packet_buff) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface packet (%s): out of memory\n",
+		pr_err("Can't add interface packet (%s): out of memory\n",
 		       batman_if->dev);
 		goto err;
 	}
@@ -268,14 +264,12 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	orig_hash_add_if(batman_if, bat_priv->num_ifaces);
 
 	atomic_set(&batman_if->seqno, 1);
-	printk(KERN_INFO "batman-adv:Adding interface: %s\n", batman_if->dev);
+	pr_info("Adding interface: %s\n", batman_if->dev);
 
 	if (hardif_is_iface_up(batman_if))
 		hardif_activate_interface(bat_priv, batman_if);
 	else
-		printk(KERN_ERR "batman-adv:"
-		       "Not using interface %s "
-		       "(retrying later): interface not active\n",
+		pr_err("Not using interface %s (retrying later): interface not active\n",
 		       batman_if->dev);
 
 	/* begin scheduling originator messages on that interface */
@@ -299,7 +293,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 	if (batman_if->if_status != IF_INACTIVE)
 		return;
 
-	printk(KERN_INFO "batman-adv:Removing interface: %s\n", batman_if->dev);
+	pr_info("Removing interface: %s\n", batman_if->dev);
 	bat_priv->num_ifaces--;
 	orig_hash_del_if(batman_if, bat_priv->num_ifaces);
 
@@ -326,8 +320,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
 
 	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
 	if (!batman_if) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface (%s): out of memory\n",
+		pr_err("Can't add interface (%s): out of memory\n",
 		       net_dev->name);
 		goto out;
 	}
diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c
index bad87fd..4f4c7f9 100644
--- a/batman-adv-kernelland/icmp_socket.c
+++ b/batman-adv-kernelland/icmp_socket.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 #include <linux/slab.h>
 #include "main.h"
@@ -60,8 +62,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
 	}
 
 	if (i == ARRAY_SIZE(socket_client_hash)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Error - can't add another packet client: "
+		pr_err("Error - can't add another packet client: "
 		       "maximum number of clients reached\n");
 		kfree(socket_client);
 		return -EXFULL;
@@ -166,7 +167,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 	unsigned long flags;
 
 	if (len < sizeof(struct icmp_packet)) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"invalid packet size\n");
 		return -EINVAL;
@@ -182,14 +183,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 		return -EFAULT;
 
 	if (icmp_packet.packet_type != BAT_ICMP) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus packet type (expected: BAT_ICMP)\n");
 		return -EINVAL;
 	}
 
 	if (icmp_packet.msg_type != ECHO_REQUEST) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus message type (expected: ECHO_REQUEST)\n");
 		return -EINVAL;
diff --git a/batman-adv-kernelland/main.c b/batman-adv-kernelland/main.c
index 20a0d54..0b14f07 100644
--- a/batman-adv-kernelland/main.c
+++ b/batman-adv-kernelland/main.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "bat_debugfs.h"
@@ -94,16 +96,14 @@ int init_module(void)
 				   interface_setup);
 
 	if (!soft_device) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to allocate the batman interface\n");
+		pr_err("Unable to allocate the batman interface\n");
 		goto end;
 	}
 
 	retval = register_netdev(soft_device);
 
 	if (retval < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to register the batman interface: %i\n", retval);
+		pr_err("Unable to register the batman interface: %i\n", retval);
 		goto free_soft_device;
 	}
 
@@ -120,9 +120,8 @@ int init_module(void)
 	register_netdevice_notifier(&hard_if_notifier);
 	dev_add_pack(&batman_adv_packet_type);
 
-	printk(KERN_INFO "batman-adv:"
-	       "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
-	       SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+	pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
+		SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
 
 	return 0;
 
@@ -182,9 +181,7 @@ void activate_module(void)
 	goto end;
 
 err:
-	printk(KERN_ERR "batman-adv:"
-	       "Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
+	pr_err("Unable to allocate memory for mesh information structures: out of mem ?\n");
 	deactivate_module();
 end:
 	return;
diff --git a/batman-adv-kernelland/main.h b/batman-adv-kernelland/main.h
index 4d7cc2a..cac8434 100644
--- a/batman-adv-kernelland/main.h
+++ b/batman-adv-kernelland/main.h
@@ -92,15 +92,17 @@
 extern int debug;
 
 extern int bat_debug_type(int type);
-#define bat_dbg(type, fmt, arg...) do {					\
-		if (bat_debug_type(type))				\
-			printk(KERN_DEBUG "batman-adv:" fmt, ## arg);	\
-	}								\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (bat_debug_type(type))				\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-#define bat_dbg(type, fmt, arg...) do {		\
-	}					\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (0)							\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #endif
 
 /*
diff --git a/batman-adv-kernelland/originator.c b/batman-adv-kernelland/originator.c
index 28e35b6..c86a92d 100644
--- a/batman-adv-kernelland/originator.c
+++ b/batman-adv-kernelland/originator.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /* increase the reference counter for this originator */
 
 #include "main.h"
@@ -165,8 +167,7 @@ struct orig_node *get_orig_node(uint8_t *addr)
 		swaphash = hash_resize(orig_hash, orig_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR
-			       "batman-adv:Couldn't resize orig hash table\n");
+			pr_err("Couldn't resize orig hash table\n");
 		else
 			orig_hash = swaphash;
 	}
@@ -360,8 +361,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	data_ptr = kmalloc(max_if_num * sizeof(TYPE_OF_WORD) * NUM_WORDS,
 			   GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -372,8 +372,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -422,8 +421,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
 	chunk_size = sizeof(TYPE_OF_WORD) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -444,8 +442,7 @@ free_bcast_own:
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
diff --git a/batman-adv-kernelland/routing.c b/batman-adv-kernelland/routing.c
index b906f79..aef5fcc 100644
--- a/batman-adv-kernelland/routing.c
+++ b/batman-adv-kernelland/routing.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "routing.h"
 #include "send.h"
@@ -857,10 +859,8 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb, size_t icmp_len)
 
 	/* send TTL exceeded if packet is an echo request (traceroute) */
 	if (icmp_packet->msg_type != ECHO_REQUEST) {
-		printk(KERN_WARNING "batman-adv:"
-		       "Warning - can't forward icmp packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       icmp_packet->orig, icmp_packet->dst);
+		pr_warning("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
+			   icmp_packet->orig, icmp_packet->dst);
 		return NET_RX_DROP;
 	}
 
@@ -1132,10 +1132,8 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if)
 
 	/* TTL exceeded */
 	if (unicast_packet->ttl < 2) {
-		printk(KERN_WARNING "batman-adv:Warning - "
-		       "can't forward unicast packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       ethhdr->h_source, unicast_packet->dest);
+		pr_warning("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
+			   ethhdr->h_source, unicast_packet->dest);
 		return NET_RX_DROP;
 	}
 
diff --git a/batman-adv-kernelland/send.c b/batman-adv-kernelland/send.c
index 8df44a6..fcfa639 100644
--- a/batman-adv-kernelland/send.c
+++ b/batman-adv-kernelland/send.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "routing.h"
@@ -68,10 +70,8 @@ int send_skb_packet(struct sk_buff *skb,
 		goto send_skb_err;
 
 	if (!(batman_if->net_dev->flags & IFF_UP)) {
-		printk(KERN_WARNING
-		       "batman-adv:Interface %s "
-		       "is not up - can't send packet via that interface!\n",
-		       batman_if->dev);
+		pr_warning("Interface %s is not up - can't send packet via that interface!\n",
+			   batman_if->dev);
 		goto send_skb_err;
 	}
 
@@ -186,8 +186,7 @@ static void send_packet(struct forw_packet *forw_packet)
 	unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0);
 
 	if (!forw_packet->if_incoming) {
-		printk(KERN_ERR "batman-adv: Error - can't forward packet: "
-		       "incoming iface not specified\n");
+		pr_err("Error - can't forward packet: incoming iface not specified\n");
 		return;
 	}
 
diff --git a/batman-adv-kernelland/translation-table.c b/batman-adv-kernelland/translation-table.c
index 8edc175..e4c5055 100644
--- a/batman-adv-kernelland/translation-table.c
+++ b/batman-adv-kernelland/translation-table.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "translation-table.h"
 #include "soft-interface.h"
@@ -112,8 +114,7 @@ void hna_local_add(uint8_t *addr)
 				       hna_local_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize local hna hash table\n");
+			pr_err("Couldn't resize local hna hash table\n");
 		else
 			hna_local_hash = swaphash;
 	}
@@ -365,8 +366,7 @@ void hna_global_add_orig(struct orig_node *orig_node,
 				       hna_global_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize global hna hash table\n");
+			pr_err("Couldn't resize global hna hash table\n");
 		else
 			hna_global_hash = swaphash;
 	}
diff --git a/batman-adv-kernelland/vis.c b/batman-adv-kernelland/vis.c
index 68ee903..8308ce2 100644
--- a/batman-adv-kernelland/vis.c
+++ b/batman-adv-kernelland/vis.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "translation-table.h"
@@ -679,7 +681,7 @@ static void send_vis_packet(struct vis_info *info)
 	int packet_length;
 
 	if (info->packet.ttl < 2) {
-		printk(KERN_WARNING "batman-adv: Error - can't send vis packet: ttl exceeded\n");
+		pr_warning("Error - can't send vis packet: ttl exceeded\n");
 		return;
 	}
 
@@ -741,13 +743,13 @@ int vis_init(void)
 
 	vis_hash = hash_new(256, vis_info_cmp, vis_info_choose);
 	if (!vis_hash) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis_hash\n");
+		pr_err("Can't initialize vis_hash\n");
 		goto err;
 	}
 
 	my_vis_info = kmalloc(1000, GFP_ATOMIC);
 	if (!my_vis_info) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis packet\n");
+		pr_err("Can't initialize vis packet\n");
 		goto err;
 	}
 
@@ -768,8 +770,7 @@ int vis_init(void)
 	memcpy(my_vis_info->packet.sender_orig, mainIfAddr, ETH_ALEN);
 
 	if (hash_add(vis_hash, my_vis_info) < 0) {
-		printk(KERN_ERR
-		       "batman-adv:Can't add own vis packet into hash\n");
+		pr_err("Can't add own vis packet into hash\n");
 		/* not in hash, need to remove it manually. */
 		kref_put(&my_vis_info->refcount, free_info);
 		goto err;
-- 
1.7.1


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

* [B.A.T.M.A.N.] [PATCHv2-trunk] batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-04 14:20   ` [B.A.T.M.A.N.] [PATCHv2-trunk] " Sven Eckelmann
@ 2010-06-04 14:21     ` Sven Eckelmann
  2010-06-04 14:25       ` [B.A.T.M.A.N.] [PATCHv2-maint] " Sven Eckelmann
  0 siblings, 1 reply; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-04 14:21 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Joe Perches

From: Joe Perches <joe@perches.com>

Compile tested only

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove "batman-adv:" from format strings
Use pr_<level>
Use netdev_<level>

Signed-off-by: Joe Perches <joe@perches.com>
[sven.eckelmann@gmx.de: Adapted for current batman-adv version]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 Marek, can you please test it with 2.6.21?
 This patch depends on batman-adv: "Convert MAC_FMT to %pM"
 It was rebased on top of "bonding and interface alternating"

 batman-adv-kernelland/aggregation.c       |    2 +
 batman-adv-kernelland/bat_debugfs.c       |    6 ++-
 batman-adv-kernelland/bat_sysfs.c         |   70 ++++++++++++++++------------
 batman-adv-kernelland/bitarray.c          |    2 +
 batman-adv-kernelland/compat.h            |   32 +++++++++++++
 batman-adv-kernelland/gateway_client.c    |    2 +
 batman-adv-kernelland/gateway_common.c    |   54 ++++++++++------------
 batman-adv-kernelland/hard-interface.c    |   31 +++++--------
 batman-adv-kernelland/icmp_socket.c       |   11 +++--
 batman-adv-kernelland/main.c              |   17 +++----
 batman-adv-kernelland/main.h              |   18 ++++---
 batman-adv-kernelland/originator.c        |   17 +++----
 batman-adv-kernelland/routing.c           |   14 +++---
 batman-adv-kernelland/send.c              |   11 ++---
 batman-adv-kernelland/translation-table.c |    8 ++--
 batman-adv-kernelland/vis.c               |   11 +++--
 16 files changed, 169 insertions(+), 137 deletions(-)

diff --git a/batman-adv-kernelland/aggregation.c b/batman-adv-kernelland/aggregation.c
index 61b6192..2c3c2a1 100644
--- a/batman-adv-kernelland/aggregation.c
+++ b/batman-adv-kernelland/aggregation.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "aggregation.h"
 #include "send.h"
diff --git a/batman-adv-kernelland/bat_debugfs.c b/batman-adv-kernelland/bat_debugfs.c
index bc1591f..cf2545a 100644
--- a/batman-adv-kernelland/bat_debugfs.c
+++ b/batman-adv-kernelland/bat_debugfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 
 #include "main.h"
@@ -130,8 +132,8 @@ int debugfs_add_meshif(struct net_device *dev)
 					  bat_priv->debug_dir,
 					  dev, &(*bat_debug)->fops);
 		if (!file) {
-			printk(KERN_ERR "batman-adv:Can't add debugfs file: "
-			       "%s/%s\n", dev->name, ((*bat_debug)->attr).name);
+			pr_err("Can't add debugfs file: %s/%s\n",
+			       dev->name, ((*bat_debug)->attr).name);
 			goto rem_attr;
 		}
 	}
diff --git a/batman-adv-kernelland/bat_sysfs.c b/batman-adv-kernelland/bat_sysfs.c
index 05703c1..319c09c 100644
--- a/batman-adv-kernelland/bat_sysfs.c
+++ b/batman-adv-kernelland/bat_sysfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "translation-table.h"
@@ -70,18 +72,20 @@ static ssize_t store_aggr_ogms(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'aggregate OGM' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'aggregate OGM' setting on"
+			    " mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->aggregation_enabled) == aggr_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing aggregation from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->aggregation_enabled) == 1 ?
-	       "enabled" : "disabled", aggr_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	netdev_info(net_dev, "Changing aggregation from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->aggregation_enabled) == 1 ?
+		    "enabled" : "disabled",
+		    aggr_tmp == 1 ? "enabled" : "disabled");
 
 	atomic_set(&bat_priv->aggregation_enabled, (unsigned)aggr_tmp);
 	return count;
@@ -118,19 +122,18 @@ static ssize_t store_bond(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'bonding' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'bonding' setting"
+			    "on mesh received: %s\n", buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->bonding_enabled) == bonding_enabled_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing bonding from: %s to: %s on mesh: %s\n",
+	netdev_info(net_dev, "Changing bonding from: %s to: %s on mesh\n",
 	       atomic_read(&bat_priv->bonding_enabled) == 1 ?
-	       "enabled" : "disabled",
-	       bonding_enabled_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	       "enabled" : "disabled",  bonding_enabled_tmp == 1 ? "enabled" :
+	       "disabled");
 
 	atomic_set(&bat_priv->bonding_enabled, (unsigned)bonding_enabled_tmp);
 	return count;
@@ -172,18 +175,20 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting"
+			    " on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", net_dev->name);
+	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server",
+		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server");
 
 	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
 	return count;
@@ -254,23 +259,27 @@ static ssize_t store_orig_interval(struct kobject *kobj, struct attribute *attr,
 
 	ret = strict_strtoul(buff, 10, &orig_interval_tmp);
 	if (ret) {
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'orig_interval' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'orig_interval' setting on "
+			    "mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (orig_interval_tmp <= JITTER * 2) {
-		printk(KERN_INFO "batman-adv:New originator interval too small: %li (min: %i)\n",
-		       orig_interval_tmp, JITTER * 2);
+		netdev_info(net_dev, "New originator interval too small: %li"
+			    " (min: %i)\n",
+			    orig_interval_tmp, JITTER * 2);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->orig_interval) == orig_interval_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing originator interval from: %i to: %li on mesh: %s\n",
-	       atomic_read(&bat_priv->orig_interval),
-	       orig_interval_tmp, net_dev->name);
+	netdev_info(net_dev,
+		    "Changing originator interval from: %i to: %li"" on mesh\n",
+		    atomic_read(&bat_priv->orig_interval),
+		    orig_interval_tmp);
 
 	atomic_set(&bat_priv->orig_interval, orig_interval_tmp);
 	return count;
@@ -317,7 +326,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
 						    batif_kobject);
 	if (!bat_priv->mesh_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_MESH_SUBDIR);
 		goto out;
 	}
@@ -326,7 +335,7 @@ int sysfs_add_meshif(struct net_device *dev)
 		err = sysfs_create_file(bat_priv->mesh_obj,
 					&((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
@@ -393,7 +402,8 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'mesh_iface' setting received: %s\n",
+		pr_err("Invalid parameter for 'mesh_iface' setting received: "
+		       "%s\n",
 		       buff);
 		return -EINVAL;
 	}
@@ -456,7 +466,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 						    hardif_kobject);
 
 	if (!*hardif_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_BAT_SUBDIR);
 		goto out;
 	}
@@ -464,7 +474,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 	for (bat_attr = batman_attrs; *bat_attr; ++bat_attr) {
 		err = sysfs_create_file(*hardif_obj, &((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_BAT_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
diff --git a/batman-adv-kernelland/bitarray.c b/batman-adv-kernelland/bitarray.c
index a607827..ac9ae97 100644
--- a/batman-adv-kernelland/bitarray.c
+++ b/batman-adv-kernelland/bitarray.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bitarray.h"
 
diff --git a/batman-adv-kernelland/compat.h b/batman-adv-kernelland/compat.h
index 614d116..e9a0a20 100644
--- a/batman-adv-kernelland/compat.h
+++ b/batman-adv-kernelland/compat.h
@@ -74,6 +74,19 @@ static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
 
 #endif /* < KERNEL_VERSION(2, 6, 23) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_err(fmt, ...) \
+	printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+	printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+
+#endif /* < KERNEL_VERSION(2, 6, 24) */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
 
 #define strict_strtoul(cp, base, res) \
@@ -244,3 +257,22 @@ static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
 }
 
 #endif /* < KERNEL_VERSION(2, 6, 29) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+
+static inline const char *netdev_name(const struct net_device *dev)
+{
+	if (dev->reg_state != NETREG_REGISTERED)
+		return "(unregistered net_device)";
+	return dev->name;
+}
+
+#define netdev_printk(level, netdev, format, args...)		\
+	dev_printk(level, (netdev)->dev.parent,			\
+		   "%s: " format,				\
+		   netdev_name(netdev), ##args)
+
+#define netdev_info(dev, format, args...)			\
+	netdev_printk(KERN_INFO, dev, format, ##args)
+
+#endif /* < KERNEL_VERSION(2, 6, 34) */
diff --git a/batman-adv-kernelland/gateway_client.c b/batman-adv-kernelland/gateway_client.c
index 552ef6f..d975d15 100644
--- a/batman-adv-kernelland/gateway_client.c
+++ b/batman-adv-kernelland/gateway_client.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "gateway_client.h"
 #include "gateway_common.h"
diff --git a/batman-adv-kernelland/gateway_common.c b/batman-adv-kernelland/gateway_common.c
index d542306..90ff9ce 100644
--- a/batman-adv-kernelland/gateway_common.c
+++ b/batman-adv-kernelland/gateway_common.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "gateway_common.h"
 #include "gateway_client.h"
@@ -87,16 +89,14 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 	case GW_MODE_CLIENT:
 		ret = strict_strtoul(tokptr, 10, gw_class_tmp);
 		if (ret) {
-			printk(KERN_ERR "batman-adv: "
-			       "Client class of gateway mode invalid: %s\n",
+			pr_err("Client class of gateway mode invalid: %s\n",
 			       tokptr);
 			return false;
 		}
 
 		if (*gw_class_tmp > TQ_MAX_VALUE) {
-			printk(KERN_ERR "batman-adv: Client class of gateway "
-					"mode greater than %i: %ld\n",
-					TQ_MAX_VALUE, *gw_class_tmp);
+			pr_err("Client class of gateway mode greater than "
+			       "%i: %ld\n", TQ_MAX_VALUE, *gw_class_tmp);
 			return false;
 		}
 
@@ -121,8 +121,7 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 
 		ret = strict_strtoul(tokptr, 10, down);
 		if (ret) {
-			printk(KERN_ERR "batman-adv: "
-			       "Download speed of gateway mode invalid: %s\n",
+			pr_err("Download speed of gateway mode invalid: %s\n",
 			       tokptr);
 			return false;
 		}
@@ -147,9 +146,8 @@ static bool parse_gw_mode_tok(char *tokptr, long *gw_mode_tmp,
 
 			ret = strict_strtoul(slash_ptr + 1, 10, up);
 			if (ret) {
-				printk(KERN_ERR "batman-adv: Upload speed of "
-				       "gateway mode invalid: %s\n",
-				       slash_ptr + 1);
+				pr_err("Upload speed of gateway mode invalid: "
+				       "%s\n", slash_ptr + 1);
 				return false;
 			}
 
@@ -217,11 +215,10 @@ next:
 	}
 
 	if (!gw_mode_tmp_str) {
-		printk(KERN_INFO "batman-adv: "
-		       "Gateway mode can only be set to: '%s', '%s' or '%s' - "
-		       "given value: %s\n",
-		       GW_MODE_OFF_NAME, GW_MODE_CLIENT_NAME,
-		       GW_MODE_SERVER_NAME, buff);
+		pr_info("Gateway mode can only be set to: '%s', '%s' or '%s' - "
+			"given value: %s\n",
+			GW_MODE_OFF_NAME, GW_MODE_CLIENT_NAME,
+			GW_MODE_SERVER_NAME, buff);
 		goto end;
 	}
 
@@ -242,10 +239,9 @@ next:
 		if ((gw_mode_tmp == GW_MODE_CLIENT) && (!gw_class_tmp))
 			gw_class_tmp = 20;
 
-		printk(KERN_INFO "batman-adv: "
-		       "Changing gateway mode from: '%s' to: '%s' "
-		       "(gw_class: %ld)\n",
-		       gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp);
+		pr_info("Changing gateway mode from: '%s' to: '%s' "
+			"(gw_class: %ld)\n",
+			gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp);
 		break;
 	case GW_MODE_SERVER:
 		if (!down)
@@ -265,19 +261,17 @@ next:
 				     (int *)&down, (int *)&up);
 
 		gw_deselect();
-		printk(KERN_INFO
-		       "batman-adv: Changing gateway mode from: '%s' to: '%s' "
-		       "(gw_class: %ld -> propagating: %ld%s/%ld%s)\n",
-		       gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp,
-		       (down > 2048 ? down / 1024 : down),
-		       (down > 2048 ? "MBit" : "KBit"),
-		       (up > 2048 ? up / 1024 : up),
-		       (up > 2048 ? "MBit" : "KBit"));
+		pr_info("Changing gateway mode from: '%s' to: '%s' "
+			"(gw_class: %ld -> propagating: %ld%s/%ld%s)\n",
+			gw_mode_curr_str, gw_mode_tmp_str, gw_class_tmp,
+			(down > 2048 ? down / 1024 : down),
+			(down > 2048 ? "MBit" : "KBit"),
+			(up > 2048 ? up / 1024 : up),
+			(up > 2048 ? "MBit" : "KBit"));
 		break;
 	default:
-		printk(KERN_INFO "batman-adv: "
-			  "Changing gateway mode from: '%s' to: '%s'\n",
-			  gw_mode_curr_str, gw_mode_tmp_str);
+		pr_info("Changing gateway mode from: '%s' to: '%s'\n",
+			gw_mode_curr_str, gw_mode_tmp_str);
 		break;
 	}
 
diff --git a/batman-adv-kernelland/hard-interface.c b/batman-adv-kernelland/hard-interface.c
index ad2e496..9c637b0 100644
--- a/batman-adv-kernelland/hard-interface.c
+++ b/batman-adv-kernelland/hard-interface.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "hard-interface.h"
 #include "soft-interface.h"
@@ -152,12 +154,9 @@ static void check_known_mac_addr(uint8_t *addr)
 		if (!compare_orig(batman_if->net_dev->dev_addr, addr))
 			continue;
 
-		printk(KERN_WARNING "batman-adv:"
-		    "The newly added mac address (%pM) already exists on: %s\n",
-		    addr, batman_if->dev);
-		printk(KERN_WARNING "batman-adv:"
-		    "It is strongly recommended to keep mac addresses unique"
-		    "to avoid problems!\n");
+		pr_warning("The newly added mac address (%pM) already exists on: %s\n",
+			   addr, batman_if->dev);
+		pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
 	}
 	rcu_read_unlock();
 }
@@ -209,8 +208,7 @@ static void hardif_activate_interface(struct bat_priv *bat_priv,
 	if (!bat_priv->primary_if)
 		set_primary_if(bat_priv, batman_if);
 
-	printk(KERN_INFO "batman-adv:Interface activated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface activated: %s\n", batman_if->dev);
 
 	if (atomic_read(&module_state) == MODULE_INACTIVE)
 		activate_module();
@@ -229,8 +227,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	batman_if->if_status = IF_INACTIVE;
 
-	printk(KERN_INFO "batman-adv:Interface deactivated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface deactivated: %s\n", batman_if->dev);
 
 	update_min_mtu();
 }
@@ -248,8 +245,7 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	batman_if->packet_buff = kmalloc(batman_if->packet_len, GFP_ATOMIC);
 
 	if (!batman_if->packet_buff) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface packet (%s): out of memory\n",
+		pr_err("Can't add interface packet (%s): out of memory\n",
 		       batman_if->dev);
 		goto err;
 	}
@@ -268,14 +264,12 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	orig_hash_add_if(batman_if, bat_priv->num_ifaces);
 
 	atomic_set(&batman_if->seqno, 1);
-	printk(KERN_INFO "batman-adv:Adding interface: %s\n", batman_if->dev);
+	pr_info("Adding interface: %s\n", batman_if->dev);
 
 	if (hardif_is_iface_up(batman_if))
 		hardif_activate_interface(bat_priv, batman_if);
 	else
-		printk(KERN_ERR "batman-adv:"
-		       "Not using interface %s "
-		       "(retrying later): interface not active\n",
+		pr_err("Not using interface %s (retrying later): interface not active\n",
 		       batman_if->dev);
 
 	/* begin scheduling originator messages on that interface */
@@ -299,7 +293,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 	if (batman_if->if_status != IF_INACTIVE)
 		return;
 
-	printk(KERN_INFO "batman-adv:Removing interface: %s\n", batman_if->dev);
+	pr_info("Removing interface: %s\n", batman_if->dev);
 	bat_priv->num_ifaces--;
 	orig_hash_del_if(batman_if, bat_priv->num_ifaces);
 
@@ -326,8 +320,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
 
 	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
 	if (!batman_if) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface (%s): out of memory\n",
+		pr_err("Can't add interface (%s): out of memory\n",
 		       net_dev->name);
 		goto out;
 	}
diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c
index bad87fd..4f4c7f9 100644
--- a/batman-adv-kernelland/icmp_socket.c
+++ b/batman-adv-kernelland/icmp_socket.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 #include <linux/slab.h>
 #include "main.h"
@@ -60,8 +62,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
 	}
 
 	if (i == ARRAY_SIZE(socket_client_hash)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Error - can't add another packet client: "
+		pr_err("Error - can't add another packet client: "
 		       "maximum number of clients reached\n");
 		kfree(socket_client);
 		return -EXFULL;
@@ -166,7 +167,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 	unsigned long flags;
 
 	if (len < sizeof(struct icmp_packet)) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"invalid packet size\n");
 		return -EINVAL;
@@ -182,14 +183,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 		return -EFAULT;
 
 	if (icmp_packet.packet_type != BAT_ICMP) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus packet type (expected: BAT_ICMP)\n");
 		return -EINVAL;
 	}
 
 	if (icmp_packet.msg_type != ECHO_REQUEST) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus message type (expected: ECHO_REQUEST)\n");
 		return -EINVAL;
diff --git a/batman-adv-kernelland/main.c b/batman-adv-kernelland/main.c
index 20a0d54..0b14f07 100644
--- a/batman-adv-kernelland/main.c
+++ b/batman-adv-kernelland/main.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "bat_debugfs.h"
@@ -94,16 +96,14 @@ int init_module(void)
 				   interface_setup);
 
 	if (!soft_device) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to allocate the batman interface\n");
+		pr_err("Unable to allocate the batman interface\n");
 		goto end;
 	}
 
 	retval = register_netdev(soft_device);
 
 	if (retval < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to register the batman interface: %i\n", retval);
+		pr_err("Unable to register the batman interface: %i\n", retval);
 		goto free_soft_device;
 	}
 
@@ -120,9 +120,8 @@ int init_module(void)
 	register_netdevice_notifier(&hard_if_notifier);
 	dev_add_pack(&batman_adv_packet_type);
 
-	printk(KERN_INFO "batman-adv:"
-	       "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
-	       SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+	pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
+		SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
 
 	return 0;
 
@@ -182,9 +181,7 @@ void activate_module(void)
 	goto end;
 
 err:
-	printk(KERN_ERR "batman-adv:"
-	       "Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
+	pr_err("Unable to allocate memory for mesh information structures: out of mem ?\n");
 	deactivate_module();
 end:
 	return;
diff --git a/batman-adv-kernelland/main.h b/batman-adv-kernelland/main.h
index 4d7cc2a..cac8434 100644
--- a/batman-adv-kernelland/main.h
+++ b/batman-adv-kernelland/main.h
@@ -92,15 +92,17 @@
 extern int debug;
 
 extern int bat_debug_type(int type);
-#define bat_dbg(type, fmt, arg...) do {					\
-		if (bat_debug_type(type))				\
-			printk(KERN_DEBUG "batman-adv:" fmt, ## arg);	\
-	}								\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (bat_debug_type(type))				\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-#define bat_dbg(type, fmt, arg...) do {		\
-	}					\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (0)							\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #endif
 
 /*
diff --git a/batman-adv-kernelland/originator.c b/batman-adv-kernelland/originator.c
index 28e35b6..c86a92d 100644
--- a/batman-adv-kernelland/originator.c
+++ b/batman-adv-kernelland/originator.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /* increase the reference counter for this originator */
 
 #include "main.h"
@@ -165,8 +167,7 @@ struct orig_node *get_orig_node(uint8_t *addr)
 		swaphash = hash_resize(orig_hash, orig_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR
-			       "batman-adv:Couldn't resize orig hash table\n");
+			pr_err("Couldn't resize orig hash table\n");
 		else
 			orig_hash = swaphash;
 	}
@@ -360,8 +361,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	data_ptr = kmalloc(max_if_num * sizeof(TYPE_OF_WORD) * NUM_WORDS,
 			   GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -372,8 +372,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -422,8 +421,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
 	chunk_size = sizeof(TYPE_OF_WORD) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -444,8 +442,7 @@ free_bcast_own:
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
diff --git a/batman-adv-kernelland/routing.c b/batman-adv-kernelland/routing.c
index b906f79..aef5fcc 100644
--- a/batman-adv-kernelland/routing.c
+++ b/batman-adv-kernelland/routing.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "routing.h"
 #include "send.h"
@@ -857,10 +859,8 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb, size_t icmp_len)
 
 	/* send TTL exceeded if packet is an echo request (traceroute) */
 	if (icmp_packet->msg_type != ECHO_REQUEST) {
-		printk(KERN_WARNING "batman-adv:"
-		       "Warning - can't forward icmp packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       icmp_packet->orig, icmp_packet->dst);
+		pr_warning("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
+			   icmp_packet->orig, icmp_packet->dst);
 		return NET_RX_DROP;
 	}
 
@@ -1132,10 +1132,8 @@ int recv_unicast_packet(struct sk_buff *skb, struct batman_if *recv_if)
 
 	/* TTL exceeded */
 	if (unicast_packet->ttl < 2) {
-		printk(KERN_WARNING "batman-adv:Warning - "
-		       "can't forward unicast packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       ethhdr->h_source, unicast_packet->dest);
+		pr_warning("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
+			   ethhdr->h_source, unicast_packet->dest);
 		return NET_RX_DROP;
 	}
 
diff --git a/batman-adv-kernelland/send.c b/batman-adv-kernelland/send.c
index 8df44a6..fcfa639 100644
--- a/batman-adv-kernelland/send.c
+++ b/batman-adv-kernelland/send.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "routing.h"
@@ -68,10 +70,8 @@ int send_skb_packet(struct sk_buff *skb,
 		goto send_skb_err;
 
 	if (!(batman_if->net_dev->flags & IFF_UP)) {
-		printk(KERN_WARNING
-		       "batman-adv:Interface %s "
-		       "is not up - can't send packet via that interface!\n",
-		       batman_if->dev);
+		pr_warning("Interface %s is not up - can't send packet via that interface!\n",
+			   batman_if->dev);
 		goto send_skb_err;
 	}
 
@@ -186,8 +186,7 @@ static void send_packet(struct forw_packet *forw_packet)
 	unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0);
 
 	if (!forw_packet->if_incoming) {
-		printk(KERN_ERR "batman-adv: Error - can't forward packet: "
-		       "incoming iface not specified\n");
+		pr_err("Error - can't forward packet: incoming iface not specified\n");
 		return;
 	}
 
diff --git a/batman-adv-kernelland/translation-table.c b/batman-adv-kernelland/translation-table.c
index 8edc175..e4c5055 100644
--- a/batman-adv-kernelland/translation-table.c
+++ b/batman-adv-kernelland/translation-table.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "translation-table.h"
 #include "soft-interface.h"
@@ -112,8 +114,7 @@ void hna_local_add(uint8_t *addr)
 				       hna_local_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize local hna hash table\n");
+			pr_err("Couldn't resize local hna hash table\n");
 		else
 			hna_local_hash = swaphash;
 	}
@@ -365,8 +366,7 @@ void hna_global_add_orig(struct orig_node *orig_node,
 				       hna_global_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize global hna hash table\n");
+			pr_err("Couldn't resize global hna hash table\n");
 		else
 			hna_global_hash = swaphash;
 	}
diff --git a/batman-adv-kernelland/vis.c b/batman-adv-kernelland/vis.c
index 68ee903..8308ce2 100644
--- a/batman-adv-kernelland/vis.c
+++ b/batman-adv-kernelland/vis.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "translation-table.h"
@@ -679,7 +681,7 @@ static void send_vis_packet(struct vis_info *info)
 	int packet_length;
 
 	if (info->packet.ttl < 2) {
-		printk(KERN_WARNING "batman-adv: Error - can't send vis packet: ttl exceeded\n");
+		pr_warning("Error - can't send vis packet: ttl exceeded\n");
 		return;
 	}
 
@@ -741,13 +743,13 @@ int vis_init(void)
 
 	vis_hash = hash_new(256, vis_info_cmp, vis_info_choose);
 	if (!vis_hash) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis_hash\n");
+		pr_err("Can't initialize vis_hash\n");
 		goto err;
 	}
 
 	my_vis_info = kmalloc(1000, GFP_ATOMIC);
 	if (!my_vis_info) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis packet\n");
+		pr_err("Can't initialize vis packet\n");
 		goto err;
 	}
 
@@ -768,8 +770,7 @@ int vis_init(void)
 	memcpy(my_vis_info->packet.sender_orig, mainIfAddr, ETH_ALEN);
 
 	if (hash_add(vis_hash, my_vis_info) < 0) {
-		printk(KERN_ERR
-		       "batman-adv:Can't add own vis packet into hash\n");
+		pr_err("Can't add own vis packet into hash\n");
 		/* not in hash, need to remove it manually. */
 		kref_put(&my_vis_info->refcount, free_info);
 		goto err;
-- 
1.7.1


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

* [B.A.T.M.A.N.] [PATCHv2-maint] batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-04 14:21     ` Sven Eckelmann
@ 2010-06-04 14:25       ` Sven Eckelmann
  0 siblings, 0 replies; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-04 14:25 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Joe Perches

From: Joe Perches <joe@perches.com>

Compile tested only

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove "batman-adv:" from format strings
Use pr_<level>
Use netdev_<level>

Signed-off-by: Joe Perches <joe@perches.com>
[sven.eckelmann@gmx.de: Adapted for current batman-adv version]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 Marek, can you please test it with 2.6.21?
 This patch depends on batman-adv: "Convert MAC_FMT to %pM"

 aggregation.c       |    2 +
 bat_debugfs.c       |    6 +++-
 bat_sysfs.c         |   59 ++++++++++++++++++++++++++++++--------------------
 bitarray.c          |    2 +
 compat.h            |   32 +++++++++++++++++++++++++++
 hard-interface.c    |   31 ++++++++++----------------
 icmp_socket.c       |   11 +++++----
 main.c              |   17 ++++++--------
 main.h              |   18 ++++++++-------
 originator.c        |   17 ++++++--------
 routing.c           |   14 +++++-------
 send.c              |   11 ++++-----
 translation-table.c |    8 +++---
 vis.c               |   11 +++++----
 14 files changed, 138 insertions(+), 101 deletions(-)

diff --git a/aggregation.c b/aggregation.c
index ce8b8a6..66ee09e 100644
--- a/aggregation.c
+++ b/aggregation.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "aggregation.h"
 #include "send.h"
diff --git a/bat_debugfs.c b/bat_debugfs.c
index 18dd040..2b0f66c 100644
--- a/bat_debugfs.c
+++ b/bat_debugfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 
 #include "main.h"
@@ -120,8 +122,8 @@ int debugfs_add_meshif(struct net_device *dev)
 					  bat_priv->debug_dir,
 					  dev, &(*bat_debug)->fops);
 		if (!file) {
-			printk(KERN_ERR "batman-adv:Can't add debugfs file: "
-			       "%s/%s\n", dev->name, ((*bat_debug)->attr).name);
+			pr_err("Can't add debugfs file: %s/%s\n",
+			       dev->name, ((*bat_debug)->attr).name);
 			goto rem_attr;
 		}
 	}
diff --git a/bat_sysfs.c b/bat_sysfs.c
index 502d5e9..746e9b3 100644
--- a/bat_sysfs.c
+++ b/bat_sysfs.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "translation-table.h"
@@ -68,18 +70,20 @@ static ssize_t store_aggr_ogms(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'aggregate OGM' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'aggregate OGM' setting on"
+			    " mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->aggregation_enabled) == aggr_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing aggregation from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->aggregation_enabled) == 1 ?
-	       "enabled" : "disabled", aggr_tmp == 1 ? "enabled" : "disabled",
-	       net_dev->name);
+	netdev_info(net_dev, "Changing aggregation from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->aggregation_enabled) == 1 ?
+		    "enabled" : "disabled",
+		    aggr_tmp == 1 ? "enabled" : "disabled");
 
 	atomic_set(&bat_priv->aggregation_enabled, (unsigned)aggr_tmp);
 	return count;
@@ -121,18 +125,20 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting"
+			    " on mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
-	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
-	       "client" : "server", net_dev->name);
+	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
+		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server",
+		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
+		    "client" : "server");
 
 	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
 	return count;
@@ -159,23 +165,27 @@ static ssize_t store_orig_interval(struct kobject *kobj, struct attribute *attr,
 
 	ret = strict_strtoul(buff, 10, &orig_interval_tmp);
 	if (ret) {
-		printk(KERN_INFO "batman-adv:Invalid parameter for 'orig_interval' setting on mesh %s received: %s\n",
-		       net_dev->name, buff);
+		netdev_info(net_dev,
+			    "Invalid parameter for 'orig_interval' setting on "
+			    "mesh received: %s\n",
+			    buff);
 		return -EINVAL;
 	}
 
 	if (orig_interval_tmp <= JITTER * 2) {
-		printk(KERN_INFO "batman-adv:New originator interval too small: %li (min: %i)\n",
-		       orig_interval_tmp, JITTER * 2);
+		netdev_info(net_dev, "New originator interval too small: %li"
+			    " (min: %i)\n",
+			    orig_interval_tmp, JITTER * 2);
 		return -EINVAL;
 	}
 
 	if (atomic_read(&bat_priv->orig_interval) == orig_interval_tmp)
 		return count;
 
-	printk(KERN_INFO "batman-adv:Changing originator interval from: %i to: %li on mesh: %s\n",
-	       atomic_read(&bat_priv->orig_interval),
-	       orig_interval_tmp, net_dev->name);
+	netdev_info(net_dev,
+		    "Changing originator interval from: %i to: %li"" on mesh\n",
+		    atomic_read(&bat_priv->orig_interval),
+		    orig_interval_tmp);
 
 	atomic_set(&bat_priv->orig_interval, orig_interval_tmp);
 	return count;
@@ -212,7 +222,7 @@ int sysfs_add_meshif(struct net_device *dev)
 	bat_priv->mesh_obj = kobject_create_and_add(SYSFS_IF_MESH_SUBDIR,
 						    batif_kobject);
 	if (!bat_priv->mesh_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_MESH_SUBDIR);
 		goto out;
 	}
@@ -221,7 +231,7 @@ int sysfs_add_meshif(struct net_device *dev)
 		err = sysfs_create_file(bat_priv->mesh_obj,
 					&((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_MESH_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
@@ -288,7 +298,8 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
 		if (buff[count - 1] == '\n')
 			buff[count - 1] = '\0';
 
-		printk(KERN_ERR "batman-adv:Invalid parameter for 'mesh_iface' setting received: %s\n",
+		pr_err("Invalid parameter for 'mesh_iface' setting received: "
+		       "%s\n",
 		       buff);
 		return -EINVAL;
 	}
@@ -351,7 +362,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 						    hardif_kobject);
 
 	if (!*hardif_obj) {
-		printk(KERN_ERR "batman-adv:Can't add sysfs directory: %s/%s\n",
+		pr_err("Can't add sysfs directory: %s/%s\n",
 		       dev->name, SYSFS_IF_BAT_SUBDIR);
 		goto out;
 	}
@@ -359,7 +370,7 @@ int sysfs_add_hardif(struct kobject **hardif_obj, struct net_device *dev)
 	for (bat_attr = batman_attrs; *bat_attr; ++bat_attr) {
 		err = sysfs_create_file(*hardif_obj, &((*bat_attr)->attr));
 		if (err) {
-			printk(KERN_ERR "batman-adv:Can't add sysfs file: %s/%s/%s\n",
+			pr_err("Can't add sysfs file: %s/%s/%s\n",
 			       dev->name, SYSFS_IF_BAT_SUBDIR,
 			       ((*bat_attr)->attr).name);
 			goto rem_attr;
diff --git a/bitarray.c b/bitarray.c
index 2fef6e3..d493625 100644
--- a/bitarray.c
+++ b/bitarray.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bitarray.h"
 
diff --git a/compat.h b/compat.h
index 144e25a..80db785 100644
--- a/compat.h
+++ b/compat.h
@@ -70,6 +70,19 @@ static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len)
 
 #endif /* < KERNEL_VERSION(2, 6, 23) */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
+
+#ifndef pr_fmt
+#define pr_fmt(fmt) fmt
+#endif
+
+#define pr_err(fmt, ...) \
+	printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+#define pr_warning(fmt, ...) \
+	printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
+
+#endif /* < KERNEL_VERSION(2, 6, 24) */
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
 
 #define strict_strtoul(cp, base, res) \
@@ -240,3 +253,22 @@ static inline struct net_device_stats *dev_get_stats(struct net_device *dev)
 }
 
 #endif /* < KERNEL_VERSION(2, 6, 29) */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
+
+static inline const char *netdev_name(const struct net_device *dev)
+{
+	if (dev->reg_state != NETREG_REGISTERED)
+		return "(unregistered net_device)";
+	return dev->name;
+}
+
+#define netdev_printk(level, netdev, format, args...)		\
+	dev_printk(level, (netdev)->dev.parent,			\
+		   "%s: " format,				\
+		   netdev_name(netdev), ##args)
+
+#define netdev_info(dev, format, args...)			\
+	netdev_printk(KERN_INFO, dev, format, ##args)
+
+#endif /* < KERNEL_VERSION(2, 6, 34) */
diff --git a/hard-interface.c b/hard-interface.c
index 55a8da8..99b2375 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "hard-interface.h"
 #include "soft-interface.h"
@@ -152,12 +154,9 @@ static void check_known_mac_addr(uint8_t *addr)
 		if (!compare_orig(batman_if->net_dev->dev_addr, addr))
 			continue;
 
-		printk(KERN_WARNING "batman-adv:"
-		    "The newly added mac address (%pM) already exists on: %s\n",
-		    addr, batman_if->dev);
-		printk(KERN_WARNING "batman-adv:"
-		    "It is strongly recommended to keep mac addresses unique"
-		    "to avoid problems!\n");
+		pr_warning("The newly added mac address (%pM) already exists on: %s\n",
+			   addr, batman_if->dev);
+		pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n");
 	}
 	rcu_read_unlock();
 }
@@ -209,8 +208,7 @@ static void hardif_activate_interface(struct bat_priv *bat_priv,
 	if (!bat_priv->primary_if)
 		set_primary_if(bat_priv, batman_if);
 
-	printk(KERN_INFO "batman-adv:Interface activated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface activated: %s\n", batman_if->dev);
 
 	if (atomic_read(&module_state) == MODULE_INACTIVE)
 		activate_module();
@@ -229,8 +227,7 @@ static void hardif_deactivate_interface(struct batman_if *batman_if)
 
 	batman_if->if_status = IF_INACTIVE;
 
-	printk(KERN_INFO "batman-adv:Interface deactivated: %s\n",
-	       batman_if->dev);
+	pr_info("Interface deactivated: %s\n", batman_if->dev);
 
 	update_min_mtu();
 }
@@ -248,8 +245,7 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	batman_if->packet_buff = kmalloc(batman_if->packet_len, GFP_ATOMIC);
 
 	if (!batman_if->packet_buff) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface packet (%s): out of memory\n",
+		pr_err("Can't add interface packet (%s): out of memory\n",
 		       batman_if->dev);
 		goto err;
 	}
@@ -268,14 +264,12 @@ int hardif_enable_interface(struct batman_if *batman_if)
 	orig_hash_add_if(batman_if, bat_priv->num_ifaces);
 
 	atomic_set(&batman_if->seqno, 1);
-	printk(KERN_INFO "batman-adv:Adding interface: %s\n", batman_if->dev);
+	pr_info("Adding interface: %s\n", batman_if->dev);
 
 	if (hardif_is_iface_up(batman_if))
 		hardif_activate_interface(bat_priv, batman_if);
 	else
-		printk(KERN_ERR "batman-adv:"
-		       "Not using interface %s "
-		       "(retrying later): interface not active\n",
+		pr_err("Not using interface %s (retrying later): interface not active\n",
 		       batman_if->dev);
 
 	/* begin scheduling originator messages on that interface */
@@ -299,7 +293,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 	if (batman_if->if_status != IF_INACTIVE)
 		return;
 
-	printk(KERN_INFO "batman-adv:Removing interface: %s\n", batman_if->dev);
+	pr_info("Removing interface: %s\n", batman_if->dev);
 	bat_priv->num_ifaces--;
 	orig_hash_del_if(batman_if, bat_priv->num_ifaces);
 
@@ -326,8 +320,7 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev)
 
 	batman_if = kmalloc(sizeof(struct batman_if), GFP_ATOMIC);
 	if (!batman_if) {
-		printk(KERN_ERR "batman-adv:"
-		       "Can't add interface (%s): out of memory\n",
+		pr_err("Can't add interface (%s): out of memory\n",
 		       net_dev->name);
 		goto out;
 	}
diff --git a/icmp_socket.c b/icmp_socket.c
index ca82b15..97fa3af 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/debugfs.h>
 #include <linux/slab.h>
 #include "main.h"
@@ -59,8 +61,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)
 	}
 
 	if (i == ARRAY_SIZE(socket_client_hash)) {
-		printk(KERN_ERR "batman-adv:"
-		       "Error - can't add another packet client: "
+		pr_err("Error - can't add another packet client: "
 		       "maximum number of clients reached\n");
 		kfree(socket_client);
 		return -EXFULL;
@@ -162,7 +163,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 	unsigned long flags;
 
 	if (len < sizeof(struct icmp_packet)) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"invalid packet size\n");
 		return -EINVAL;
@@ -175,14 +176,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
 		return -EFAULT;
 
 	if (icmp_packet.packet_type != BAT_ICMP) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus packet type (expected: BAT_ICMP)\n");
 		return -EINVAL;
 	}
 
 	if (icmp_packet.msg_type != ECHO_REQUEST) {
-		bat_dbg(DBG_BATMAN, "batman-adv:"
+		bat_dbg(DBG_BATMAN,
 			"Error - can't send packet from char device: "
 			"got bogus message type (expected: ECHO_REQUEST)\n");
 		return -EINVAL;
diff --git a/main.c b/main.c
index 05744e7..cdf3991 100644
--- a/main.c
+++ b/main.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "bat_sysfs.h"
 #include "bat_debugfs.h"
@@ -99,16 +101,14 @@ int init_module(void)
 				   interface_setup);
 
 	if (!soft_device) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to allocate the batman interface\n");
+		pr_err("Unable to allocate the batman interface\n");
 		goto end;
 	}
 
 	retval = register_netdev(soft_device);
 
 	if (retval < 0) {
-		printk(KERN_ERR "batman-adv:"
-		       "Unable to register the batman interface: %i\n", retval);
+		pr_err("Unable to register the batman interface: %i\n", retval);
 		goto free_soft_device;
 	}
 
@@ -125,9 +125,8 @@ int init_module(void)
 	register_netdevice_notifier(&hard_if_notifier);
 	dev_add_pack(&batman_adv_packet_type);
 
-	printk(KERN_INFO "batman-adv:"
-	       "B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
-	       SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
+	pr_info("B.A.T.M.A.N. advanced %s%s (compatibility version %i) loaded\n",
+		SOURCE_VERSION, REVISION_VERSION_STR, COMPAT_VERSION);
 
 	return 0;
 
@@ -187,9 +186,7 @@ void activate_module(void)
 	goto end;
 
 err:
-	printk(KERN_ERR "batman-adv:"
-	       "Unable to allocate memory for mesh information structures: "
-	       "out of mem ?\n");
+	pr_err("Unable to allocate memory for mesh information structures: out of mem ?\n");
 	deactivate_module();
 end:
 	return;
diff --git a/main.h b/main.h
index 7cb0b18..e338cbb 100644
--- a/main.h
+++ b/main.h
@@ -87,15 +87,17 @@
 extern int debug;
 
 extern int bat_debug_type(int type);
-#define bat_dbg(type, fmt, arg...) do {					\
-		if (bat_debug_type(type))				\
-			printk(KERN_DEBUG "batman-adv:" fmt, ## arg);	\
-	}								\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (bat_debug_type(type))				\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #else /* !CONFIG_BATMAN_ADV_DEBUG */
-#define bat_dbg(type, fmt, arg...) do {		\
-	}					\
-	while (0)
+#define bat_dbg(type, fmt, arg...)				\
+do {								\
+	if (0)							\
+		printk(KERN_DEBUG pr_fmt(fmt), ##arg);		\
+} while (0)
 #endif
 
 /*
diff --git a/originator.c b/originator.c
index 183b7a1..fc36d88 100644
--- a/originator.c
+++ b/originator.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /* increase the reference counter for this originator */
 
 #include "main.h"
@@ -164,8 +166,7 @@ struct orig_node *get_orig_node(uint8_t *addr)
 		swaphash = hash_resize(orig_hash, orig_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR
-			       "batman-adv:Couldn't resize orig hash table\n");
+			pr_err("Couldn't resize orig hash table\n");
 		else
 			orig_hash = swaphash;
 	}
@@ -348,8 +349,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 	data_ptr = kmalloc(max_if_num * sizeof(TYPE_OF_WORD) * NUM_WORDS,
 			   GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -360,8 +360,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -410,8 +409,7 @@ static int orig_node_del_if(struct orig_node *orig_node,
 	chunk_size = sizeof(TYPE_OF_WORD) * NUM_WORDS;
 	data_ptr = kmalloc(max_if_num * chunk_size, GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
@@ -432,8 +430,7 @@ free_bcast_own:
 
 	data_ptr = kmalloc(max_if_num * sizeof(uint8_t), GFP_ATOMIC);
 	if (!data_ptr) {
-		printk(KERN_ERR
-		       "batman-adv:Can't resize orig: out of memory\n");
+		pr_err("Can't resize orig: out of memory\n");
 		return -1;
 	}
 
diff --git a/routing.c b/routing.c
index e9b0377..5bacbf6 100644
--- a/routing.c
+++ b/routing.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "routing.h"
 #include "send.h"
@@ -732,10 +734,8 @@ static int recv_icmp_ttl_exceeded(struct sk_buff *skb)
 
 	/* send TTL exceeded if packet is an echo request (traceroute) */
 	if (icmp_packet->msg_type != ECHO_REQUEST) {
-		printk(KERN_WARNING "batman-adv:"
-		       "Warning - can't forward icmp packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       icmp_packet->orig, icmp_packet->dst);
+		pr_warning("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n",
+			   icmp_packet->orig, icmp_packet->dst);
 		return NET_RX_DROP;
 	}
 
@@ -900,10 +900,8 @@ int recv_unicast_packet(struct sk_buff *skb)
 
 	/* TTL exceeded */
 	if (unicast_packet->ttl < 2) {
-		printk(KERN_WARNING "batman-adv:Warning - "
-		       "can't forward unicast packet from %pM to %pM: "
-		       "ttl exceeded\n",
-		       ethhdr->h_source, unicast_packet->dest);
+		pr_warning("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n",
+			   ethhdr->h_source, unicast_packet->dest);
 		return NET_RX_DROP;
 	}
 
diff --git a/send.c b/send.c
index 197fce1..c5e5efd 100644
--- a/send.c
+++ b/send.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "routing.h"
@@ -68,10 +70,8 @@ int send_skb_packet(struct sk_buff *skb,
 		goto send_skb_err;
 
 	if (!(batman_if->net_dev->flags & IFF_UP)) {
-		printk(KERN_WARNING
-		       "batman-adv:Interface %s "
-		       "is not up - can't send packet via that interface!\n",
-		       batman_if->dev);
+		pr_warning("Interface %s is not up - can't send packet via that interface!\n",
+			   batman_if->dev);
 		goto send_skb_err;
 	}
 
@@ -186,8 +186,7 @@ static void send_packet(struct forw_packet *forw_packet)
 	unsigned char directlink = (batman_packet->flags & DIRECTLINK ? 1 : 0);
 
 	if (!forw_packet->if_incoming) {
-		printk(KERN_ERR "batman-adv: Error - can't forward packet: "
-		       "incoming iface not specified\n");
+		pr_err("Error - can't forward packet: incoming iface not specified\n");
 		return;
 	}
 
diff --git a/translation-table.c b/translation-table.c
index 8edc175..e4c5055 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "translation-table.h"
 #include "soft-interface.h"
@@ -112,8 +114,7 @@ void hna_local_add(uint8_t *addr)
 				       hna_local_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize local hna hash table\n");
+			pr_err("Couldn't resize local hna hash table\n");
 		else
 			hna_local_hash = swaphash;
 	}
@@ -365,8 +366,7 @@ void hna_global_add_orig(struct orig_node *orig_node,
 				       hna_global_hash->size * 2);
 
 		if (swaphash == NULL)
-			printk(KERN_ERR "batman-adv:"
-			       "Couldn't resize global hna hash table\n");
+			pr_err("Couldn't resize global hna hash table\n");
 		else
 			hna_global_hash = swaphash;
 	}
diff --git a/vis.c b/vis.c
index ba9a055..8c14fff 100644
--- a/vis.c
+++ b/vis.c
@@ -19,6 +19,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "main.h"
 #include "send.h"
 #include "translation-table.h"
@@ -678,7 +680,7 @@ static void send_vis_packet(struct vis_info *info)
 	int packet_length;
 
 	if (info->packet.ttl < 2) {
-		printk(KERN_WARNING "batman-adv: Error - can't send vis packet: ttl exceeded\n");
+		pr_warning("Error - can't send vis packet: ttl exceeded\n");
 		return;
 	}
 
@@ -740,13 +742,13 @@ int vis_init(void)
 
 	vis_hash = hash_new(256, vis_info_cmp, vis_info_choose);
 	if (!vis_hash) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis_hash\n");
+		pr_err("Can't initialize vis_hash\n");
 		goto err;
 	}
 
 	my_vis_info = kmalloc(1000, GFP_ATOMIC);
 	if (!my_vis_info) {
-		printk(KERN_ERR "batman-adv:Can't initialize vis packet\n");
+		pr_err("Can't initialize vis packet\n");
 		goto err;
 	}
 
@@ -767,8 +769,7 @@ int vis_init(void)
 	memcpy(my_vis_info->packet.sender_orig, mainIfAddr, ETH_ALEN);
 
 	if (hash_add(vis_hash, my_vis_info) < 0) {
-		printk(KERN_ERR
-		       "batman-adv:Can't add own vis packet into hash\n");
+		pr_err("Can't add own vis packet into hash\n");
 		/* not in hash, need to remove it manually. */
 		kref_put(&my_vis_info->refcount, free_info);
 		goto err;
-- 
1.7.1


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

* Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-02 20:11   ` Joe Perches
@ 2010-06-15 22:23     ` Sven Eckelmann
  -1 siblings, 0 replies; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-15 22:23 UTC (permalink / raw)
  To: b.a.t.m.a.n
  Cc: devel, b.a.t.m.a.n, Greg Kroah-Hartman, linux-kernel,
	Simon Wunderlich, Joe Perches, Marek Lindner

[-- Attachment #1: Type: Text/Plain, Size: 2261 bytes --]

Joe Perches wrote:
> Compile tested only
> 
> Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> Remove "batman-adv:" from format strings
> Use pr_<level>
> Use netdev_<level>
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---

Found some time to play a little bit around with your patch and noticed that
it crashes the kernel. I did my tests using following "interesting" part:

[....]
> @@ -152,18 +155,18 @@ static ssize_t store_vis_mode(struct kobject *kobj,
> struct attribute *attr, if (buff[count - 1] == '\n')
>  			buff[count - 1] = '\0';
> 
> -		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
> -		       net_dev->name, buff);
> +		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting on mesh received: %s\n",
> +			    buff);
>  		return -EINVAL;
>  	}
> 
>  	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
>  		return count;
> 
> -	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
> -	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
> -	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
> -	       "client" : "server", net_dev->name);
> +	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
> +		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
> +		    "client" : "server",
> +		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ? "client" : "server");
> 
>  	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
>  	return count;
[...]

I compiled the module and loaded it using `insmod batman-adv.ko`. This will
create some files in /sys. Just changed the vis mode to server using:

echo 0 > /sys/class/net/bat0/mesh/vis_mode

And then it will crash at that netdev_info call.

The problem seems to be that dev_printk is used by netdev_printk (which is
used by netdev_info). netdev_printk will add (netdev)->dev.parent as second
parameter of dev_printk (and parent is NULL in our case). This macro will now
call dev_driver_string with NULL as parameter and just dereference this null pointer.

Maybe it is related to something else, but at least I think that this could be
the cause of the crash.

Best regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
@ 2010-06-15 22:23     ` Sven Eckelmann
  0 siblings, 0 replies; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-15 22:23 UTC (permalink / raw)
  To: b.a.t.m.a.n
  Cc: Joe Perches, Marek Lindner, Simon Wunderlich, Andrew Lunn,
	Greg Kroah-Hartman, devel, b.a.t.m.a.n, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 2261 bytes --]

Joe Perches wrote:
> Compile tested only
> 
> Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> Remove "batman-adv:" from format strings
> Use pr_<level>
> Use netdev_<level>
> 
> Signed-off-by: Joe Perches <joe@perches.com>
> ---

Found some time to play a little bit around with your patch and noticed that
it crashes the kernel. I did my tests using following "interesting" part:

[....]
> @@ -152,18 +155,18 @@ static ssize_t store_vis_mode(struct kobject *kobj,
> struct attribute *attr, if (buff[count - 1] == '\n')
>  			buff[count - 1] = '\0';
> 
> -		printk(KERN_INFO "batman-adv:Invalid parameter for 'vis mode' setting on mesh %s received: %s\n",
> -		       net_dev->name, buff);
> +		netdev_info(net_dev, "Invalid parameter for 'vis mode' setting on mesh received: %s\n",
> +			    buff);
>  		return -EINVAL;
>  	}
> 
>  	if (atomic_read(&bat_priv->vis_mode) == vis_mode_tmp)
>  		return count;
> 
> -	printk(KERN_INFO "batman-adv:Changing vis mode from: %s to: %s on mesh: %s\n",
> -	       atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
> -	       "client" : "server", vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ?
> -	       "client" : "server", net_dev->name);
> +	netdev_info(net_dev, "Changing vis mode from: %s to: %s on mesh\n",
> +		    atomic_read(&bat_priv->vis_mode) == VIS_TYPE_CLIENT_UPDATE ?
> +		    "client" : "server",
> +		    vis_mode_tmp == VIS_TYPE_CLIENT_UPDATE ? "client" : "server");
> 
>  	atomic_set(&bat_priv->vis_mode, (unsigned)vis_mode_tmp);
>  	return count;
[...]

I compiled the module and loaded it using `insmod batman-adv.ko`. This will
create some files in /sys. Just changed the vis mode to server using:

echo 0 > /sys/class/net/bat0/mesh/vis_mode

And then it will crash at that netdev_info call.

The problem seems to be that dev_printk is used by netdev_printk (which is
used by netdev_info). netdev_printk will add (netdev)->dev.parent as second
parameter of dev_printk (and parent is NULL in our case). This macro will now
call dev_driver_string with NULL as parameter and just dereference this null pointer.

Maybe it is related to something else, but at least I think that this could be
the cause of the crash.

Best regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-15 22:23     ` Sven Eckelmann
  (?)
@ 2010-06-15 22:37     ` Sven Eckelmann
  2010-06-15 22:58         ` [B.A.T.M.A.N.] " Joe Perches
  -1 siblings, 1 reply; 20+ messages in thread
From: Sven Eckelmann @ 2010-06-15 22:37 UTC (permalink / raw)
  To: b.a.t.m.a.n
  Cc: devel, b.a.t.m.a.n, Greg Kroah-Hartman, linux-kernel,
	Simon Wunderlich, Joe Perches, Marek Lindner

[-- Attachment #1: Type: Text/Plain, Size: 1351 bytes --]

Sven Eckelmann wrote:
[...]
> Found some time to play a little bit around with your patch and noticed
> that it crashes the kernel. I did my tests using following "interesting"
> part:
> 
[...]
> 
> I compiled the module and loaded it using `insmod batman-adv.ko`. This will
> create some files in /sys. Just changed the vis mode to server using:
> 
> echo 0 > /sys/class/net/bat0/mesh/vis_mode
> 
> And then it will crash at that netdev_info call.
> 
> The problem seems to be that dev_printk is used by netdev_printk (which is
> used by netdev_info). netdev_printk will add (netdev)->dev.parent as second
> parameter of dev_printk (and parent is NULL in our case). This macro will
> now call dev_driver_string with NULL as parameter and just dereference
> this null pointer.
> 
> Maybe it is related to something else, but at least I think that this could
> be the cause of the crash.

Something i forgot to say:

As far as I understand, the netdev_* stuff is made to be used by real drivers 
with more or less physical hardware. batman-adv is a virtual bridge used for 
mesh networks. Like net/bridge/ it has no physical parent device and only 
other net_devices are used inside of it - which may have real physical network 
devices as parents.

Please correct me if my assumption is wrong.

Best regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
  2010-06-15 22:37     ` Sven Eckelmann
  2010-06-15 22:58         ` [B.A.T.M.A.N.] " Joe Perches
@ 2010-06-15 22:58         ` Joe Perches
  0 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-15 22:58 UTC (permalink / raw)
  To: Sven Eckelmann, netdev
  Cc: devel, Greg Kroah-Hartman, b.a.t.m.a.n, b.a.t.m.a.n, linux-kernel,
	Simon Wunderlich, Marek Lindner

On Wed, 2010-06-16 at 00:37 +0200, Sven Eckelmann wrote:
> Sven Eckelmann wrote:

Hi Sven.

> > The problem seems to be that dev_printk is used by netdev_printk (which is
> > used by netdev_info). netdev_printk will add (netdev)->dev.parent as second
> > parameter of dev_printk (and parent is NULL in our case). This macro will
> > now call dev_driver_string with NULL as parameter and just dereference
> > this null pointer.
> > 
> > Maybe it is related to something else, but at least I think that this could
> > be the cause of the crash.

Nope, I think that's exactly correct.

> As far as I understand, the netdev_* stuff is made to be used by real drivers 
> with more or less physical hardware. batman-adv is a virtual bridge used for 
> mesh networks. Like net/bridge/ it has no physical parent device and only 
> other net_devices are used inside of it - which may have real physical network 
> devices as parents.

> Please correct me if my assumption is wrong.

No correction necessary...

netdev_printk and netdev_<level> are meant to be used
with parented network devices.

I think that netdev_<level> will eventually do the right
thing when dev->dev.parent is NULL.  Right now, that'd
be a bit of an expensive test as it would be expanded in
place for every use of the macro.

Right now it's:

#define netdev_printk(level, netdev, format, args...)		\
	dev_printk(level, (netdev)->dev.parent,			\
		   "%s: " format,				\
		   netdev_name(netdev), ##args)

It could be something like:

#define netdev_printk(level, netdev, format, args...)		\
do {								\
	if ((netdev)->dev.parent)				\
		dev_printk(level, (netdev)->dev.parent, 	\
			   "%s: " format, 			\
			   netdev_name(netdev), ##args);	\
	else							\
		printk(level "%s: " format,			\
			netdev_name(netdev), ##args);		\
} while (0)

Unfortunately, that just about doubles the format string space,
so I don't really want to do that.

If/when %pV is accepted,

http://lkml.org/lkml/2010/3/4/17
http://lkml.org/lkml/2010/3/4/18

then the netdev_<level> macros will be converted to functions,
so size reduced with an added test for dev.parent == NULL without
the need to double the string space.



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

* Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
@ 2010-06-15 22:58         ` Joe Perches
  0 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-15 22:58 UTC (permalink / raw)
  To: Sven Eckelmann, netdev
  Cc: b.a.t.m.a.n, devel, b.a.t.m.a.n, Greg Kroah-Hartman, linux-kernel,
	Simon Wunderlich, Marek Lindner

On Wed, 2010-06-16 at 00:37 +0200, Sven Eckelmann wrote:
> Sven Eckelmann wrote:

Hi Sven.

> > The problem seems to be that dev_printk is used by netdev_printk (which is
> > used by netdev_info). netdev_printk will add (netdev)->dev.parent as second
> > parameter of dev_printk (and parent is NULL in our case). This macro will
> > now call dev_driver_string with NULL as parameter and just dereference
> > this null pointer.
> > 
> > Maybe it is related to something else, but at least I think that this could
> > be the cause of the crash.

Nope, I think that's exactly correct.

> As far as I understand, the netdev_* stuff is made to be used by real drivers 
> with more or less physical hardware. batman-adv is a virtual bridge used for 
> mesh networks. Like net/bridge/ it has no physical parent device and only 
> other net_devices are used inside of it - which may have real physical network 
> devices as parents.

> Please correct me if my assumption is wrong.

No correction necessary...

netdev_printk and netdev_<level> are meant to be used
with parented network devices.

I think that netdev_<level> will eventually do the right
thing when dev->dev.parent is NULL.  Right now, that'd
be a bit of an expensive test as it would be expanded in
place for every use of the macro.

Right now it's:

#define netdev_printk(level, netdev, format, args...)		\
	dev_printk(level, (netdev)->dev.parent,			\
		   "%s: " format,				\
		   netdev_name(netdev), ##args)

It could be something like:

#define netdev_printk(level, netdev, format, args...)		\
do {								\
	if ((netdev)->dev.parent)				\
		dev_printk(level, (netdev)->dev.parent, 	\
			   "%s: " format, 			\
			   netdev_name(netdev), ##args);	\
	else							\
		printk(level "%s: " format,			\
			netdev_name(netdev), ##args);		\
} while (0)

Unfortunately, that just about doubles the format string space,
so I don't really want to do that.

If/when %pV is accepted,

http://lkml.org/lkml/2010/3/4/17
http://lkml.org/lkml/2010/3/4/18

then the netdev_<level> macros will be converted to functions,
so size reduced with an added test for dev.parent == NULL without
the need to double the string space.



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

* Re: [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers
@ 2010-06-15 22:58         ` Joe Perches
  0 siblings, 0 replies; 20+ messages in thread
From: Joe Perches @ 2010-06-15 22:58 UTC (permalink / raw)
  To: Sven Eckelmann, netdev
  Cc: devel, Greg Kroah-Hartman,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwlltHuzzzSOjJt,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Simon Wunderlich,
	Marek Lindner

On Wed, 2010-06-16 at 00:37 +0200, Sven Eckelmann wrote:
> Sven Eckelmann wrote:

Hi Sven.

> > The problem seems to be that dev_printk is used by netdev_printk (which is
> > used by netdev_info). netdev_printk will add (netdev)->dev.parent as second
> > parameter of dev_printk (and parent is NULL in our case). This macro will
> > now call dev_driver_string with NULL as parameter and just dereference
> > this null pointer.
> > 
> > Maybe it is related to something else, but at least I think that this could
> > be the cause of the crash.

Nope, I think that's exactly correct.

> As far as I understand, the netdev_* stuff is made to be used by real drivers 
> with more or less physical hardware. batman-adv is a virtual bridge used for 
> mesh networks. Like net/bridge/ it has no physical parent device and only 
> other net_devices are used inside of it - which may have real physical network 
> devices as parents.

> Please correct me if my assumption is wrong.

No correction necessary...

netdev_printk and netdev_<level> are meant to be used
with parented network devices.

I think that netdev_<level> will eventually do the right
thing when dev->dev.parent is NULL.  Right now, that'd
be a bit of an expensive test as it would be expanded in
place for every use of the macro.

Right now it's:

#define netdev_printk(level, netdev, format, args...)		\
	dev_printk(level, (netdev)->dev.parent,			\
		   "%s: " format,				\
		   netdev_name(netdev), ##args)

It could be something like:

#define netdev_printk(level, netdev, format, args...)		\
do {								\
	if ((netdev)->dev.parent)				\
		dev_printk(level, (netdev)->dev.parent, 	\
			   "%s: " format, 			\
			   netdev_name(netdev), ##args);	\
	else							\
		printk(level "%s: " format,			\
			netdev_name(netdev), ##args);		\
} while (0)

Unfortunately, that just about doubles the format string space,
so I don't really want to do that.

If/when %pV is accepted,

http://lkml.org/lkml/2010/3/4/17
http://lkml.org/lkml/2010/3/4/18

then the netdev_<level> macros will be converted to functions,
so size reduced with an added test for dev.parent == NULL without
the need to double the string space.

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

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

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 17:10 [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Joe Perches
2010-06-02 18:12 ` [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers Joe Perches
2010-06-02 18:53 ` [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM Greg KH
2010-06-02 20:08   ` [PATCH] MAINTAINERS: Add staging/b.a.t.m.a.n Joe Perches
2010-06-02 20:17     ` Greg KH
2010-06-02 20:19       ` Randy Dunlap
2010-06-02 20:27         ` Joe Perches
2010-06-02 20:11 ` [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers Joe Perches
2010-06-02 20:11   ` Joe Perches
2010-06-03 15:53   ` [B.A.T.M.A.N.] [PATCH-trunk] batman-adv: " Sven Eckelmann
2010-06-03 17:27     ` Sven Eckelmann
2010-06-04 14:20   ` [B.A.T.M.A.N.] [PATCHv2-trunk] " Sven Eckelmann
2010-06-04 14:21     ` Sven Eckelmann
2010-06-04 14:25       ` [B.A.T.M.A.N.] [PATCHv2-maint] " Sven Eckelmann
2010-06-15 22:23   ` [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: " Sven Eckelmann
2010-06-15 22:23     ` Sven Eckelmann
2010-06-15 22:37     ` Sven Eckelmann
2010-06-15 22:58       ` Joe Perches
2010-06-15 22:58         ` Joe Perches
2010-06-15 22:58         ` [B.A.T.M.A.N.] " 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.