|
From: <swg...@us...> - 2008-04-23 09:23:48
|
Revision: 353
http://scst.svn.sourceforge.net/scst/?rev=353&view=rev
Author: swgruszka
Date: 2008-04-23 02:23:43 -0700 (Wed, 23 Apr 2008)
Log Message:
-----------
- Compile time conditinal debug.
- Initialize variable.
Modified Paths:
--------------
trunk/qla_isp/linux/isp_scst.c
Modified: trunk/qla_isp/linux/isp_scst.c
===================================================================
--- trunk/qla_isp/linux/isp_scst.c 2008-04-23 09:15:14 UTC (rev 352)
+++ trunk/qla_isp/linux/isp_scst.c 2008-04-23 09:23:43 UTC (rev 353)
@@ -141,10 +141,17 @@
struct scst_proc_data proc_data;
};
+#define DEBUG 1
+
+#ifdef DEBUG
#define SDprintk if (debug) printk
#define SDprintk2 if (debug > 1) printk
-
static int debug = 0;
+module_param(debug, int, 0);
+#else
+#define SDprintk(fmt, args...)
+#define SDprintk2(fmt, args...)
+#endif
#define Eprintk(fmt, args...) printk(KERN_ERR "isp_scst(%s): " fmt, __FUNCTION__, ##args)
#define Iprintk(fmt, args...) printk(KERN_INFO "isp_scst(%s): " fmt, __FUNCTION__, ##args)
@@ -1144,6 +1151,7 @@
slen = TMD_SENSELEN;
}
memcpy(tmd->cd_sense, sbuf, slen);
+#ifdef DEBUG
if (unlikely(debug > 0)) {
uint8_t key, asc, ascq;
key = (slen >= 2) ? sbuf[2] : 0;
@@ -1151,6 +1159,7 @@
ascq = (slen >= 13) ? sbuf[13] : 0;
SDprintk("sense code: key 0x%02x asc 0x%02x ascq 0x%02x\n", key, asc, ascq);
}
+#endif
}
SDprintk2("%s: TMD[%llx] status %d\n", __FUNCTION__, tmd->cd_tagval, scst_cmd_get_status(scst_cmd));
}
@@ -1546,7 +1555,7 @@
return;
err_free_chan:
- for (bp->h.r_nchannels -1; chan >= 0; chan--) {
+ for (chan = bp->h.r_nchannels -1; chan >= 0; chan--) {
if (bchan[chan].scst_tgt) {
scst_unregister(bchan[chan].scst_tgt);
}
@@ -1643,7 +1652,6 @@
}
EXPORT_SYMBOL(scsi_target_handler);
-module_param(debug, int, 0);
#ifdef MODULE_LICENSE
MODULE_LICENSE("Dual BSD/GPL");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|