[openib-general] [PATCH] ib_smi: Add module names to messages

Hal Rosenstock halr at voltaire.com
Mon Oct 11 11:25:22 PDT 2004


ib_smi: Add modules names to messages

Index: ib_smi_priv.h
===================================================================
--- ib_smi_priv.h	(revision 965)
+++ ib_smi_priv.h	(working copy)
@@ -28,6 +28,8 @@
 
 #include <linux/pci.h>
 
+#define SPFX "ib_sma: "
+
 struct ib_smi_send_wr {
 	struct list_head send_list;
 	struct ib_mad *smp;
Index: ib_smi.c
===================================================================
--- ib_smi.c	(revision 965)
+++ ib_smi.c	(working copy)
@@ -322,7 +322,7 @@
 	}
 	spin_unlock_irqrestore(&ib_smi_port_list_lock, flags);
 	if (!port_priv) {
-		printk(KERN_ERR "smp_send: no matching MAD agent 0x%x\n",
+		printk(KERN_ERR SPFX "smp_send: no matching MAD agent 0x%x\n",
 		       (unsigned int)mad_agent);
 		return;
 	}
@@ -357,7 +357,7 @@
 
 	ah = ib_create_ah(mad_agent->qp->pd, &ah_attr);
 	if (IS_ERR(ah)) {
-		printk(KERN_ERR "No memory for address handle\n");
+		printk(KERN_ERR SPFX "No memory for address handle\n");
 		kfree(smp);
 		return;
 	}
@@ -467,7 +467,7 @@
 	/* Hold lock longer !!! */
 	spin_unlock_irqrestore(&ib_smi_port_list_lock, flags);
 	if (!port_priv) {
-		printk(KERN_ERR "smi_send_handler: no matching MAD agent "
+		printk(KERN_ERR SPFX "smi_send_handler: no matching MAD agent "
 		       "0x%x\n", (unsigned int)mad_agent);
 		return;
 	}
@@ -476,7 +476,7 @@
 	spin_lock_irqsave(&port_priv->send_list_lock, flags);
 	if (list_empty(&port_priv->send_posted_smp_list)) {
 		spin_unlock_irqrestore(&port_priv->send_list_lock, flags);
-		printk(KERN_ERR "Send completion WR ID 0x%Lx but send list "
+		printk(KERN_ERR SPFX "Send completion WR ID 0x%Lx but send list "
 		       "is empty\n", mad_send_wc->wr_id);
 		return;
 	}
@@ -535,7 +535,7 @@
 	}
 	spin_unlock_irqrestore(&ib_smi_port_list_lock, flags);
 	if (port_priv) {
-		printk(KERN_DEBUG "%s port %d already open\n",
+		printk(KERN_DEBUG SPFX "%s port %d already open\n",
 		       device->name, port_num);
 		return 0;
 	}
@@ -543,7 +543,7 @@
 	/* Create new device info */
 	port_priv = kmalloc(sizeof *port_priv, GFP_KERNEL);
 	if (!port_priv) {
-		printk(KERN_ERR "No memory for ib_smi_port_private\n");
+		printk(KERN_ERR SPFX "No memory for ib_smi_port_private\n");
 		ret = -ENOMEM;
 		goto error1;
 	}
@@ -606,7 +606,7 @@
 				      &buf_list, 1,
 				       IB_ACCESS_LOCAL_WRITE, &iova);
 	if (IS_ERR(port_priv->mr)) {
-		printk(KERN_ERR "Couldn't register MR\n");
+		printk(KERN_ERR SPFX "Couldn't register MR\n");
 		ret = PTR_ERR(port_priv->mr);
 		goto error5;
 	} 
@@ -644,7 +644,7 @@
 	}
 
 	if (port_priv == NULL) {
-		printk(KERN_ERR "Port %d not found\n", port_num);
+		printk(KERN_ERR SPFX "Port %d not found\n", port_num);
 		spin_unlock_irqrestore(&ib_smi_port_list_lock, flags);
 		return -ENODEV;
 	}
@@ -668,7 +668,7 @@
 
 	ret = ib_query_device(device, &device_attr);
 	if (ret) {
-		printk(KERN_ERR "Couldn't query device %s\n", device->name);
+		printk(KERN_ERR SPFX "Couldn't query device %s\n", device->name);
 		goto error_device_query;
 	}
 
@@ -683,7 +683,7 @@
 	for (i = 0; i < num_ports; i++, cur_port++) {
 		ret = ib_smi_port_open(device, cur_port);
 		if (ret) {
-			printk(KERN_ERR "Couldn't open %s port %d\n",
+			printk(KERN_ERR SPFX "Couldn't open %s port %d\n",
 			       device->name, cur_port);
 			goto error_device_open;
 		}
@@ -696,7 +696,7 @@
 		cur_port--;
 		ret2 = ib_smi_port_close(device, cur_port);
 		if (ret2) {
-			printk(KERN_ERR "Couldn't close %s port %d\n",
+			printk(KERN_ERR SPFX "Couldn't close %s port %d\n",
 			       device->name, cur_port);
 		}
 		i--;
@@ -713,7 +713,7 @@
 
 	ret = ib_query_device(device, &device_attr);
 	if (ret) {
-		printk(KERN_ERR "Couldn't query device %s\n", device->name);
+		printk(KERN_ERR SPFX "Couldn't query device %s\n", device->name);
 		goto error_device_query;
 	}
 
@@ -727,7 +727,7 @@
 	for (i = 0; i < num_ports; i++, cur_port++) {
 		ret2 = ib_smi_port_close(device, cur_port);
 		if (ret2) {
-			printk(KERN_ERR "Couldn't close %s port %d\n",
+			printk(KERN_ERR SPFX "Couldn't close %s port %d\n",
 			       device->name, cur_port);
 			if (!ret)
 				ret = ret2;
@@ -748,7 +748,7 @@
 {
 	INIT_LIST_HEAD(&ib_smi_port_list);
         if (ib_register_client(&ib_smi_client)) {
-                printk(KERN_ERR "Couldn't register ib_smi client\n");
+                printk(KERN_ERR SPFX "Couldn't register ib_smi
client\n");
                 return -EINVAL;
         }
                                                                                 






More information about the general mailing list