From: <vl...@us...> - 2008-05-21 11:56:19
|
Revision: 381 http://scst.svn.sourceforge.net/scst/?rev=381&view=rev Author: vlnb Date: 2008-05-21 04:56:09 -0700 (Wed, 21 May 2008) Log Message: ----------- Patch from Bart Van Assche <bar...@gm...>: The patch below implements the following changes: - Fixes the remaining warnings reported by checkpatch.pl with regard to the use of whitespace in C code. - Adds double qoutes around some #warning messages, such that checkpatch.pl does no longer try to interprete the text behind the #warning preprocessor directive. - Adds an extra conversion to the generate-kernel-patch script that removes the single space from before goto-labels while generating the kernel patch. This patch has been tested as follows: - Verified that svn diff -x -w only shows changes in the #warning preprocessor directives. - Verified the output of svn diff by reading it. - Verified that checkpatch.pl does no longer complain on the use of whitespace (searched through the checkpatch.pl output for the text ' space'). - Verified that the patch generated by the generate-kernel-patch script still applies cleanly to the 2.6.24 kernel, and that the patched kernel still compiles cleanly. Please let me know if I have to resubmit parts of this patch to other SCST authors. Signed-off-by: Bart Van Assche <bar...@gm...> Modified Paths: -------------- trunk/iscsi-scst/include/iscsi_scst.h trunk/iscsi-scst/kernel/conn.c trunk/iscsi-scst/kernel/event.c trunk/iscsi-scst/kernel/iscsi.c trunk/iscsi-scst/kernel/nthread.c trunk/iscsi-scst/kernel/session.c trunk/iscsi-scst/kernel/target.c trunk/mpt/mpt_scst.c trunk/mpt/mpt_scst.h trunk/qla2x00t/ql2400.c trunk/qla2x00t/qla2x00-target/qla2x00t.c trunk/qla2x00t/qla_attr.c trunk/qla2x00t/qla_dbg.h trunk/qla2x00t/qla_def.h trunk/qla2x00t/qla_gbl.h trunk/qla2x00t/qla_init.c trunk/qla2x00t/qla_inline.h trunk/qla2x00t/qla_isr.c trunk/qla2x00t/qla_os.c trunk/qla_isp/common/isp.c trunk/qla_isp/common/isp_target.c trunk/qla_isp/linux/isp_cb_ops.c trunk/qla_isp/linux/isp_linux.c trunk/qla_isp/linux/isp_linux.h trunk/qla_isp/linux/isp_pci.c trunk/qla_isp/linux/isp_scst.c trunk/qla_isp/linux/scsi_target.c trunk/scripts/generate-kernel-patch trunk/scst/include/scst.h trunk/scst/include/scst_debug.h trunk/scst/src/dev_handlers/scst_changer.c trunk/scst/src/dev_handlers/scst_dev_handler.h trunk/scst/src/dev_handlers/scst_processor.c trunk/scst/src/dev_handlers/scst_raid.c trunk/scst/src/dev_handlers/scst_tape.c trunk/scst/src/dev_handlers/scst_user.c trunk/scst/src/dev_handlers/scst_vdisk.c trunk/scst/src/scst_cdbprobe.h trunk/scst/src/scst_debug.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_main.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_mem.h trunk/scst/src/scst_priv.h trunk/scst/src/scst_proc.c trunk/scst/src/scst_targ.c trunk/srpt/src/ib_srpt.c Modified: trunk/iscsi-scst/include/iscsi_scst.h =================================================================== --- trunk/iscsi-scst/include/iscsi_scst.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/iscsi-scst/include/iscsi_scst.h 2008-05-21 11:56:09 UTC (rev 381) @@ -141,7 +141,7 @@ static inline int iscsi_is_key_declarative(int key) { - switch(key) + switch (key) { case key_max_xmit_data_length: return 1; Modified: trunk/iscsi-scst/kernel/conn.c =================================================================== --- trunk/iscsi-scst/kernel/conn.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/iscsi-scst/kernel/conn.c 2008-05-21 11:56:09 UTC (rev 381) @@ -30,7 +30,7 @@ return; } - switch(conn->rd_state) { + switch (conn->rd_state) { case ISCSI_CONN_RD_STATE_PROCESSING: snprintf(p, size, "%s", "read_processing "); printed = 1; @@ -41,7 +41,7 @@ break; } - switch(conn->wr_state) { + switch (conn->wr_state) { case ISCSI_CONN_WR_STATE_PROCESSING: snprintf(p, size, "%s", "write_processing "); printed = 1; @@ -452,7 +452,7 @@ if (unlikely(current != conn->rd_task)) { printk(KERN_EMERG "conn %p rd_task != current %p (pid %d)\n", conn, current, current->pid); - while(in_softirq()) + while (in_softirq()) local_bh_enable(); printk(KERN_EMERG "rd_state %x\n", conn->rd_state); printk(KERN_EMERG "rd_task %p\n", conn->rd_task); @@ -466,7 +466,7 @@ if (unlikely(current != conn->wr_task)) { printk(KERN_EMERG "conn %p wr_task != current %p (pid %d)\n", conn, current, current->pid); - while(in_softirq()) + while (in_softirq()) local_bh_enable(); printk(KERN_EMERG "wr_state %x\n", conn->wr_state); printk(KERN_EMERG "wr_task %p\n", conn->wr_task); Modified: trunk/iscsi-scst/kernel/event.c =================================================================== --- trunk/iscsi-scst/kernel/event.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/iscsi-scst/kernel/event.c 2008-05-21 11:56:09 UTC (rev 381) @@ -39,7 +39,7 @@ return 0; } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) static int event_recv_skb(struct sk_buff *skb) #else static void event_recv_skb(struct sk_buff *skb) @@ -64,14 +64,14 @@ } out: -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) return 0; #else return; #endif } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) static void event_recv(struct sock *sk, int length) { struct sk_buff *skb; @@ -118,17 +118,17 @@ int __init event_init(void) { -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) nl = netlink_kernel_create(NETLINK_ISCSI_SCST, 1, event_recv, THIS_MODULE); #else - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)) - nl = netlink_kernel_create(NETLINK_ISCSI_SCST, 1, event_recv, NULL, - THIS_MODULE); - #else +# if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) + nl = netlink_kernel_create(NETLINK_ISCSI_SCST, 1, event_recv, NULL, + THIS_MODULE); +# else nl = netlink_kernel_create(&init_net, NETLINK_ISCSI_SCST, 1, - event_recv_skb, NULL, THIS_MODULE); - #endif + event_recv_skb, NULL, THIS_MODULE); +# endif #endif if (!nl) { PRINT_ERROR("%s", "netlink_kernel_create() failed"); Modified: trunk/iscsi-scst/kernel/iscsi.c =================================================================== --- trunk/iscsi-scst/kernel/iscsi.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/iscsi-scst/kernel/iscsi.c 2008-05-21 11:56:09 UTC (rev 381) @@ -130,7 +130,7 @@ struct iscsi_cmnd *cmnd; /* ToDo: __GFP_NOFAIL?? */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) cmnd = kmem_cache_alloc(iscsi_cmnd_cache, GFP_KERNEL|__GFP_NOFAIL); memset(cmnd, 0, sizeof(*cmnd)); #else @@ -236,7 +236,7 @@ /* Order between above and below code is important! */ if (cmnd->scst_cmd) { - switch(cmnd->scst_state) { + switch (cmnd->scst_state) { case ISCSI_CMD_STATE_PROCESSED: TRACE_DBG("cmd %p PROCESSED", cmnd); scst_tgt_cmd_done(cmnd->scst_cmd); @@ -254,7 +254,7 @@ } default: PRINT_CRIT_ERROR("Unexpected cmnd scst state %d", - cmnd->scst_state); + cmnd->scst_state); sBUG(); break; } @@ -572,7 +572,7 @@ u8 *p = (u8*)page_address(sg_page(&cmnd->sg[idx])) + (last_off & ~PAGE_MASK); int i = 4 - (size & 3); - while(i--) + while (i--) *p++ = 0; } } @@ -593,7 +593,7 @@ offset = 0; sn = 0; - while(1) { + while (1) { rsp = iscsi_cmnd_create_rsp_cmnd(req); TRACE_DBG("rsp %p", rsp); rsp->sg = req->sg; @@ -681,7 +681,7 @@ u8 *p = (u8 *)sense + i; while (i < rsp->bufflen) { - *p ++ = 0; + *p++ = 0; i++; } } @@ -1126,7 +1126,7 @@ if (++req->outstanding_r2t >= session->sess_param.max_outstanding_r2t) break; - } while(req->r2t_length != 0); + } while (req->r2t_length != 0); iscsi_cmnds_init_write(&send, ISCSI_INIT_WRITE_WAKE); @@ -1322,7 +1322,7 @@ dir = SCST_DATA_NONE; scst_cmd_set_expected(scst_cmd, dir, be32_to_cpu(req_hdr->data_length)); - switch(req_hdr->flags & ISCSI_CMD_ATTR_MASK) { + switch (req_hdr->flags & ISCSI_CMD_ATTR_MASK) { case ISCSI_CMD_SIMPLE: scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE; break; @@ -1621,8 +1621,8 @@ if (req_hdr->lun != hdr->lun) { PRINT_ERROR("ABORT TASK: LUN mismatch: req LUN " - "%Lx, cmd LUN %Lx, rtt %u", req_hdr->lun, - hdr->lun, req_hdr->rtt); + "%Lx, cmd LUN %Lx, rtt %u", req_hdr->lun, + hdr->lun, req_hdr->rtt); err = ISCSI_RESPONSE_FUNCTION_REJECTED; goto out_put; } @@ -2494,7 +2494,7 @@ TRACE_ENTRY(); spin_lock_bh(&iscsi_wr_lock); - switch(conn->wr_state) { + switch (conn->wr_state) { case ISCSI_CONN_WR_STATE_IN_LIST: list_del(&conn->wr_list_entry); /* go through */ @@ -2514,7 +2514,7 @@ if (local) { int rc = 1; - while(test_write_ready(conn)) { + while (test_write_ready(conn)) { rc = iscsi_send(conn); if ((rc <= 0) || single_only) { break; @@ -2581,7 +2581,7 @@ create_status_rsp(req, status, sense, sense_len); - switch(old_state) { + switch (old_state) { case ISCSI_CMD_STATE_RX_CMD: case ISCSI_CMD_STATE_AFTER_PREPROC: break; @@ -2681,7 +2681,7 @@ /* This should be checked for immediate TM commands as well */ - switch(function) { + switch (function) { default: if (before(sess->exp_cmd_sn, req_hdr->cmd_sn)) res = 1; @@ -2781,7 +2781,7 @@ static inline int iscsi_get_mgmt_response(int status) { - switch(status) { + switch (status) { case SCST_MGMT_STATUS_SUCCESS: return ISCSI_RESPONSE_FUNCTION_COMPLETE; Modified: trunk/iscsi-scst/kernel/nthread.c =================================================================== --- trunk/iscsi-scst/kernel/nthread.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/iscsi-scst/kernel/nthread.c 2008-05-21 11:56:09 UTC (rev 381) @@ -95,7 +95,7 @@ if (cmnd_get_check(cmnd)) continue; - for(i = 0; i < cmnd->sg_cnt; i++) { + for (i = 0; i < cmnd->sg_cnt; i++) { struct page *page = sg_page(&cmnd->sg[i]); TRACE_CONN_CLOSE_DBG("page %p, net_priv %p, " "_count %d", page, page->net_priv, @@ -106,7 +106,7 @@ spin_unlock_bh(&conn->cmd_list_lock); restart = 1; } - while(page->net_priv != NULL) + while (page->net_priv != NULL) iscsi_put_page_callback(page); } } @@ -128,7 +128,7 @@ if (cmnd_get_check(rsp)) continue; - for(i = 0; i < rsp->sg_cnt; i++) { + for (i = 0; i < rsp->sg_cnt; i++) { struct page *page = sg_page(&rsp->sg[i]); TRACE_CONN_CLOSE_DBG(" page %p, net_priv %p, " "_count %d", page, page->net_priv, @@ -140,7 +140,7 @@ spin_unlock_bh(&conn->cmd_list_lock); restart = 1; } - while(page->net_priv != NULL) + while (page->net_priv != NULL) iscsi_put_page_callback(page); } } @@ -229,7 +229,7 @@ conn_abort(conn); /* ToDo: not the best way to wait */ - while(atomic_read(&conn->conn_ref_cnt) != 0) { + while (atomic_read(&conn->conn_ref_cnt) != 0) { struct iscsi_cmnd *cmnd; mutex_lock(&target->target_mutex); @@ -252,19 +252,19 @@ if (!list_empty(&session->pending_list)) { struct list_head *pending_list = &session->pending_list; - int req_freed; - - TRACE_CONN_CLOSE_DBG("Disposing pending commands on " - "connection %p (conn_ref_cnt=%d)", conn, - atomic_read(&conn->conn_ref_cnt)); - + int req_freed; + + TRACE_CONN_CLOSE_DBG("Disposing pending commands on " + "connection %p (conn_ref_cnt=%d)", conn, + atomic_read(&conn->conn_ref_cnt)); + /* * Such complicated approach currently isn't necessary, * but it will be necessary for MC/S, if we won't want * to reestablish the whole session on a connection * failure. */ - + spin_lock(&session->sn_lock); do { req_freed = 0; @@ -293,7 +293,7 @@ break; } } - } while(req_freed); + } while (req_freed); spin_unlock(&session->sn_lock); if (time_after(jiffies, start_waiting + CONN_PENDING_TIMEOUT)) { @@ -329,7 +329,7 @@ break; } } - } while(req_freed); + } while (req_freed); spin_unlock(&session->sn_lock); } } @@ -389,7 +389,7 @@ atomic_read(&cmnd->net_ref_cnt), cmnd->sg); if (cmnd->sg != NULL) { int i; - for(i = 0; i < cmnd->sg_cnt; i++) { + for (i = 0; i < cmnd->sg_cnt; i++) { struct page *page = sg_page(&cmnd->sg[i]); TRACE_CONN_CLOSE_DBG("page %p, net_priv %p, _count %d", page, page->net_priv, @@ -406,7 +406,7 @@ atomic_read(&rsp->net_ref_cnt), rsp->sg); if ((rsp->sg != cmnd->sg) && (rsp->sg != NULL)) { int i; - for(i = 0; i < rsp->sg_cnt; i++) { + for (i = 0; i < rsp->sg_cnt; i++) { TRACE_CONN_CLOSE_DBG(" page %p, net_priv %p, " "_count %d", sg_page(&rsp->sg[i]), sg_page(&rsp->sg[i])->net_priv, @@ -429,7 +429,7 @@ conn->sock->sk->sk_write_space = conn->old_write_space; write_unlock_bh(&conn->sock->sk->sk_callback_lock); - while(1) { + while (1) { bool t; spin_lock_bh(&iscsi_wr_lock); @@ -577,8 +577,8 @@ if (res >= first_len) { int done = 1 + ((res - first_len) >> PAGE_SHIFT); conn->read_msg.msg_iov += done; - conn->read_msg.msg_iovlen -= done; - } + conn->read_msg.msg_iovlen -= done; + } } else conn->read_state = state; } @@ -756,7 +756,7 @@ *closed = 1; break; } - } while(res > 0); + } while (res > 0); TRACE_EXIT_RES(res); return res; @@ -772,7 +772,7 @@ /* We delete/add to tail connections to maintain fairness between them */ - while(!list_empty(&iscsi_rd_list)) { + while (!list_empty(&iscsi_rd_list)) { int rc, closed = 0; struct iscsi_conn *conn = list_entry(iscsi_rd_list.next, typeof(*conn), rd_list_entry); @@ -824,7 +824,7 @@ current->flags |= PF_NOFREEZE; spin_lock_bh(&iscsi_rd_lock); - while(!kthread_should_stop()) { + while (!kthread_should_stop()) { wait_queue_t wait; init_waitqueue_entry(&wait, current); @@ -889,7 +889,7 @@ if (atomic_dec_and_test(&cmd->net_ref_cnt)) { int i, sg_cnt = cmd->sg_cnt; - for(i = 0; i < sg_cnt; i++) { + for (i = 0; i < sg_cnt; i++) { struct page *page = sg_page(&cmd->sg[i]); TRACE_NET_PAGE("Clearing page %p", page); if (page->net_priv == cmd) @@ -1356,7 +1356,7 @@ /* We delete/add to tail connections to maintain fairness between them */ - while(!list_empty(&iscsi_wr_list)) { + while (!list_empty(&iscsi_wr_list)) { int rc; struct iscsi_conn *conn = list_entry(iscsi_wr_list.next, typeof(*conn), wr_list_entry); @@ -1419,7 +1419,7 @@ current->flags |= PF_NOFREEZE; spin_lock_bh(&iscsi_wr_lock); - while(!kthread_should_stop()) { + while (!kthread_should_stop()) { wait_queue_t wait; init_waitqueue_entry(&wait, current); Modified: trunk/iscsi-scst/kernel/session.c =================================================================== --- trunk/iscsi-scst/kernel/session.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/iscsi-scst/kernel/session.c 2008-05-21 11:56:09 UTC (rev 381) @@ -57,7 +57,7 @@ name = kmalloc(strlen(info->user_name) + strlen(info->initiator_name) + 1, GFP_KERNEL); - if (name == NULL){ + if (name == NULL) { err = -ENOMEM; goto err; } Modified: trunk/iscsi-scst/kernel/target.c =================================================================== --- trunk/iscsi-scst/kernel/target.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/iscsi-scst/kernel/target.c 2008-05-21 11:56:09 UTC (rev 381) @@ -155,7 +155,7 @@ do { if (!++next_target_id) ++next_target_id; - } while(target_lookup_by_id(next_target_id)); + } while (target_lookup_by_id(next_target_id)); tid = next_target_id; } @@ -219,7 +219,7 @@ TRACE_MGMT_DBG("%s", "Deleting all targets"); /* Complete brain damage, ToDo */ - while(1) { + while (1) { mutex_lock(&target_mgmt_mutex); if (list_empty(&target_list)) Modified: trunk/mpt/mpt_scst.c =================================================================== --- trunk/mpt/mpt_scst.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/mpt/mpt_scst.c 2008-05-21 11:56:09 UTC (rev 381) @@ -32,7 +32,7 @@ #include <linux/seq_file.h> #include <scsi/scsi_host.h> -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0) #include <linux/pci.h> #endif @@ -155,7 +155,7 @@ ioc->prod_name, tgt->target_enable ? "True" : "False"); -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)) +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15)) if (ioc->bus_type == SCSI) { #else if (ioc->bus_type == SPI) { Modified: trunk/mpt/mpt_scst.h =================================================================== --- trunk/mpt/mpt_scst.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/mpt/mpt_scst.h 2008-05-21 11:56:09 UTC (rev 381) @@ -2,7 +2,7 @@ #define __MPT_SCST_H #if defined(MODULE) && !defined(__GENKSYMS__) -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)) #include <linux/config.h> #else #include <linux/autoconf.h> Modified: trunk/qla2x00t/ql2400.c =================================================================== --- trunk/qla2x00t/ql2400.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/ql2400.c 2008-05-21 11:56:09 UTC (rev 381) @@ -78,7 +78,7 @@ .subdevice = PCI_ANY_ID, .driver_data = (unsigned long)&qla_board_tbl[1], }, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) { .vendor = PCI_VENDOR_ID_QLOGIC, .device = PCI_DEVICE_ID_QLOGIC_ISP5422, Modified: trunk/qla2x00t/qla2x00-target/qla2x00t.c =================================================================== --- trunk/qla2x00t/qla2x00-target/qla2x00t.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla2x00-target/qla2x00t.c 2008-05-21 11:56:09 UTC (rev 381) @@ -1240,7 +1240,7 @@ scst_cmd_set_expected(cmd->scst_cmd, dir, le32_to_cpu(cmd->atio.data_length)); - switch(cmd->atio.task_codes) { + switch (cmd->atio.task_codes) { case ATIO_SIMPLE_QUEUE: cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE; break; @@ -1388,7 +1388,7 @@ goto out; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) cmd = kmem_cache_alloc(q2t_cmd_cachep, GFP_ATOMIC); #else cmd = kmem_cache_zalloc(q2t_cmd_cachep, GFP_ATOMIC); @@ -1398,7 +1398,7 @@ res = -ENOMEM; goto out; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) memset(cmd, 0, sizeof(*cmd)); #endif Modified: trunk/qla2x00t/qla_attr.c =================================================================== --- trunk/qla2x00t/qla_attr.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_attr.c 2008-05-21 11:56:09 UTC (rev 381) @@ -321,7 +321,7 @@ qla2x00_update_portdb); #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_read_fw_dump(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -346,7 +346,7 @@ return (count); } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_write_fw_dump(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -431,7 +431,7 @@ .write = qla2x00_sysfs_write_fw_dump, }; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_read_nvram(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -457,7 +457,7 @@ return ha->nvram_size; } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_write_nvram(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -517,7 +517,7 @@ .write = qla2x00_sysfs_write_nvram, }; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_read_optrom(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -542,7 +542,7 @@ return count; } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_write_optrom(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -578,7 +578,7 @@ .write = qla2x00_sysfs_write_optrom, }; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -664,7 +664,7 @@ .write = qla2x00_sysfs_write_optrom_ctl, }; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_read_vpd(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -692,7 +692,7 @@ return ha->vpd_size; } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) static ssize_t qla2x00_sysfs_write_vpd(struct kobject *kobj, char *buf, loff_t off, size_t count) @@ -1239,7 +1239,7 @@ .set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo, .show_rport_dev_loss_tmo = 1, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15) .issue_fc_host_lip = qla2x00_issue_lip, .get_fc_host_stats = qla2x00_get_fc_host_stats, #endif Modified: trunk/qla2x00t/qla_dbg.h =================================================================== --- trunk/qla2x00t/qla_dbg.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_dbg.h 2008-05-21 11:56:09 UTC (rev 381) @@ -126,26 +126,26 @@ #endif #if defined(QL_DEBUG_LEVEL_11) -#define DEBUG11(x) do{x;} while(0); +#define DEBUG11(x) do{x;} while (0); #if !defined(DEBUG2_11) -#define DEBUG2_11(x) do{x;} while(0); +#define DEBUG2_11(x) do{x;} while (0); #endif #if !defined(DEBUG2_3_11) -#define DEBUG2_3_11(x) do{x;} while(0); +#define DEBUG2_3_11(x) do{x;} while (0); #endif #if !defined(DEBUG3_11) -#define DEBUG3_11(x) do{x;} while(0); +#define DEBUG3_11(x) do{x;} while (0); #endif #else -#define DEBUG11(x) do{} while(0); +#define DEBUG11(x) do{} while (0); #if !defined(QL_DEBUG_LEVEL_2) - #define DEBUG2_11(x) do{} while(0); + #define DEBUG2_11(x) do{} while (0); #if !defined(QL_DEBUG_LEVEL_3) - #define DEBUG2_3_11(x) do{} while(0); + #define DEBUG2_3_11(x) do{} while (0); #endif #endif #if !defined(QL_DEBUG_LEVEL_3) - #define DEBUG3_11(x) do{} while(0); + #define DEBUG3_11(x) do{} while (0); #endif #endif @@ -158,12 +158,12 @@ #if defined(QL_DEBUG_LEVEL_13) #define DEBUG13(x) do {x;} while (0) #if !defined(DEBUG2_13) -#define DEBUG2_13(x) do {x;} while(0) +#define DEBUG2_13(x) do {x;} while (0) #endif #else #define DEBUG13(x) do {} while (0) #if !defined(QL_DEBUG_LEVEL_2) -#define DEBUG2_13(x) do {} while(0) +#define DEBUG2_13(x) do {} while (0) #endif #endif Modified: trunk/qla2x00t/qla_def.h =================================================================== --- trunk/qla2x00t/qla_def.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_def.h 2008-05-21 11:56:09 UTC (rev 381) @@ -2124,7 +2124,7 @@ char * (*pci_info_str) (struct scsi_qla_host *, char *); char * (*fw_version_str) (struct scsi_qla_host *, char *); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) irqreturn_t (*intr_handler) (int, void *, struct pt_regs *); #else irq_handler_t intr_handler; Modified: trunk/qla2x00t/qla_gbl.h =================================================================== --- trunk/qla2x00t/qla_gbl.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_gbl.h 2008-05-21 11:56:09 UTC (rev 381) @@ -213,7 +213,7 @@ /* * Global Function Prototypes in qla_isr.c source file. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) extern irqreturn_t qla2100_intr_handler(int, void *, struct pt_regs *); extern irqreturn_t qla2300_intr_handler(int, void *, struct pt_regs *); extern irqreturn_t qla24xx_intr_handler(int, void *, struct pt_regs *); @@ -320,7 +320,7 @@ extern void qla2x00_alloc_sysfs_attr(scsi_qla_host_t *); extern void qla2x00_free_sysfs_attr(scsi_qla_host_t *); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid) { cmd->resid = resid; Modified: trunk/qla2x00t/qla_init.c =================================================================== --- trunk/qla2x00t/qla_init.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_init.c 2008-05-21 11:56:09 UTC (rev 381) @@ -1725,13 +1725,13 @@ } static void -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) qla2x00_rport_add(void *data) #else qla2x00_rport_add(struct work_struct *work) #endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) fc_port_t *fcport = data; #else fc_port_t *fcport = container_of(work, struct fc_port, rport_add_work); @@ -1741,13 +1741,13 @@ } static void -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) qla2x00_rport_del(void *data) #else qla2x00_rport_del(struct work_struct *work) #endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) fc_port_t *fcport = data; #else fc_port_t *fcport = container_of(work, struct fc_port, rport_del_work); @@ -1790,7 +1790,7 @@ fcport->flags = FCF_RLC_SUPPORT; fcport->supported_classes = FC_COS_UNSPECIFIED; spin_lock_init(&fcport->rport_lock); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) INIT_WORK(&fcport->rport_add_work, qla2x00_rport_add, fcport); INIT_WORK(&fcport->rport_del_work, qla2x00_rport_del, fcport); #else @@ -2137,7 +2137,7 @@ unsigned long flags; if (fcport->drport) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) qla2x00_rport_del(fcport); #else qla2x00_rport_del(&fcport->rport_del_work); @@ -3056,7 +3056,7 @@ /* Go with deferred removal of rport references. */ list_for_each_entry(fcport, &ha->fcports, list) if (fcport->drport) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) qla2x00_rport_del(fcport); #else qla2x00_rport_del(&fcport->rport_del_work); Modified: trunk/qla2x00t/qla_inline.h =================================================================== --- trunk/qla2x00t/qla_inline.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_inline.h 2008-05-21 11:56:09 UTC (rev 381) @@ -104,7 +104,7 @@ static inline void qla2x00_poll(scsi_qla_host_t *ha) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) ha->isp_ops.intr_handler(0, ha, NULL); #else ha->isp_ops.intr_handler(0, ha); Modified: trunk/qla2x00t/qla_isr.c =================================================================== --- trunk/qla2x00t/qla_isr.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_isr.c 2008-05-21 11:56:09 UTC (rev 381) @@ -32,7 +32,7 @@ * * Returns handled flag. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) irqreturn_t qla2100_intr_handler(int irq, void *dev_id, struct pt_regs *regs) #else @@ -117,7 +117,7 @@ * * Returns handled flag. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) irqreturn_t qla2300_intr_handler(int irq, void *dev_id, struct pt_regs *regs) #else @@ -1581,7 +1581,7 @@ * * Returns handled flag. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) irqreturn_t qla24xx_intr_handler(int irq, void *dev_id, struct pt_regs *regs) #else Modified: trunk/qla2x00t/qla_os.c =================================================================== --- trunk/qla2x00t/qla_os.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla2x00t/qla_os.c 2008-05-21 11:56:09 UTC (rev 381) @@ -1198,7 +1198,7 @@ ha->device_type |= DT_ISP2432; ha->device_type |= DT_ZIO_SUPPORTED; break; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) case PCI_DEVICE_ID_QLOGIC_ISP5422: ha->device_type |= DT_ISP5422; break; @@ -2181,7 +2181,7 @@ int rval; rval = QLA_SUCCESS; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) ha->srb_mempool = mempool_create_slab_pool(SRB_MIN_REQ, srb_cachep); #else ha->srb_mempool = mempool_create(SRB_MIN_REQ, mempool_alloc_slab, @@ -2402,7 +2402,7 @@ ha->isp_ops.beacon_blink(ha); ha->dpc_active = 0; - } /* End of while(1) */ + } /* End of while (1) */ DEBUG(printk("scsi(%ld): DPC handler exiting\n", ha->host_no)); @@ -2719,7 +2719,7 @@ PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432, PCI_ANY_ID, PCI_ANY_ID, }, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422, PCI_ANY_ID, PCI_ANY_ID, }, { PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432, @@ -2776,7 +2776,7 @@ /* Allocate cache for SRBs. */ srb_cachep = kmem_cache_create("qla2xxx_srbs", sizeof(srb_t), 0, SLAB_HWCACHE_ALIGN, NULL -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) , NULL); #else ); Modified: trunk/qla_isp/common/isp.c =================================================================== --- trunk/qla_isp/common/isp.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/common/isp.c 2008-05-21 11:56:09 UTC (rev 381) @@ -381,7 +381,7 @@ sdp = SDPARAM(isp, 1); l = ISP_READ(isp, SXP_PINS_DIFF|SXP_BANK1_SELECT); l &= ISP1080_MODE_MASK; - switch(l) { + switch (l) { case ISP1080_LVD_MODE: sdp->isp_lvdmode = 1; isp_prt(isp, ISP_LOGCONFIG, m, 1, "LVD"); @@ -1648,7 +1648,7 @@ /* * Prefer or force Point-To-Point instead Loop? */ - switch(isp->isp_confopts & ISP_CFG_PORT_PREF) { + switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { case ISP_CFG_NPORT: icbp->icb_xfwoptions |= ICBXOPT_PTP_2_LOOP; break; @@ -1921,7 +1921,7 @@ icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS; icbp->icb_fwoptions2 = fcp->isp_xfwoptions; - switch(isp->isp_confopts & ISP_CFG_PORT_PREF) { + switch (isp->isp_confopts & ISP_CFG_PORT_PREF) { #if 0 case ISP_CFG_NPORT: /* @@ -2901,7 +2901,7 @@ static const char * ispfc_fw_statename(int state) { - switch(state) { + switch (state) { case FW_CONFIG_WAIT: return "Config Wait"; case FW_WAIT_AL_PA: return "Waiting for AL_PA"; case FW_WAIT_LOGIN: return "Wait Login"; Modified: trunk/qla_isp/common/isp_target.c =================================================================== --- trunk/qla_isp/common/isp_target.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/common/isp_target.c 2008-05-21 11:56:09 UTC (rev 381) @@ -200,7 +200,7 @@ ISP_TDQE(isp, "isp_target_notify", (int) *optrp, vptr); - switch(type) { + switch (type) { case RQSTYPE_ATIO: if (IS_24XX(isp)) { int len; @@ -1182,7 +1182,7 @@ * about this so it's ignored. */ - switch(aep->at_status & ~QLTM_SVALID) { + switch (aep->at_status & ~QLTM_SVALID) { case AT_PATH_INVALID: /* * ATIO rejected by the firmware due to disabled lun. @@ -1275,7 +1275,7 @@ * about this so it's ignored. */ - switch(aep->at_status & ~QLTM_SVALID) { + switch (aep->at_status & ~QLTM_SVALID) { case AT_PATH_INVALID: /* * ATIO rejected by the firmware due to disabled lun. @@ -1351,7 +1351,7 @@ xs = NULL; } - switch(ct->ct_status & ~QLTM_SVALID) { + switch (ct->ct_status & ~QLTM_SVALID) { case CT_OK: /* * There are generally 3 possibilities as to why we'd get @@ -1512,7 +1512,7 @@ xs = NULL; } - switch(ct->ct_status & ~QLTM_SVALID) { + switch (ct->ct_status & ~QLTM_SVALID) { case CT_BUS_ERROR: isp_prt(isp, ISP_LOGERR, "PCI DMA Bus Error"); /* FALL Through */ @@ -1674,7 +1674,7 @@ xs = NULL; } - switch(ct->ct_nphdl) { + switch (ct->ct_nphdl) { case CT7_BUS_ERROR: isp_prt(isp, ISP_LOGERR, "PCI DMA Bus Error"); /* FALL Through */ Modified: trunk/qla_isp/linux/isp_cb_ops.c =================================================================== --- trunk/qla_isp/linux/isp_cb_ops.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/linux/isp_cb_ops.c 2008-05-21 11:56:09 UTC (rev 381) @@ -843,7 +843,7 @@ unsigned int i; ext.Instance = 0; - for(i = 0; i < MAX_ISP; i++) { + for (i = 0; i < MAX_ISP; i++) { if (isplist[i] && IS_FC(isplist[i])) { ext.Instance++; } Modified: trunk/qla_isp/linux/isp_linux.c =================================================================== --- trunk/qla_isp/linux/isp_linux.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/linux/isp_linux.c 2008-05-21 11:56:09 UTC (rev 381) @@ -3973,7 +3973,7 @@ ISP_IUNLK_SOFTC(isp); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) #define PTARG , struct pt_regs *pt #else #define PTARG Modified: trunk/qla_isp/linux/isp_linux.h =================================================================== --- trunk/qla_isp/linux/isp_linux.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/linux/isp_linux.h 2008-05-21 11:56:09 UTC (rev 381) @@ -80,7 +80,7 @@ #define KERNEL_VERSION(v,p,s) (((v)<<16)+(p<<8)+s) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,7,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 7, 0) #error "Only Linux 2.5/2.6 kernels are supported with this driver" #endif @@ -122,7 +122,7 @@ #include <scsi/scsi_device.h> #include <linux/cdev.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 13) #include <linux/devfs_fs_kernel.h> #define ISP_CLASS struct class_simple #define CREATE_ISP_CLASS class_simple_create @@ -197,7 +197,7 @@ #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) #define sg_page(_sg) ((_sg)->page) #define sg_assign_page(_sg, _pg) ((_sg)->page = (_pg)) #endif @@ -395,8 +395,8 @@ #define ISP_IUNLK_SOFTC ISP_UNLK_SOFTC #define ISP_IGET_LK_SOFTC(isp) spin_lock_irq(&isp->isp_osinfo.slock) #define ISP_DROP_LK_SOFTC(isp) spin_unlock_irq(&isp->isp_osinfo.slock) -#define ISP_LOCK_SCSI_DONE(isp) do { } while(0) -#define ISP_UNLK_SCSI_DONE(isp) do { } while(0) +#define ISP_LOCK_SCSI_DONE(isp) do { } while (0) +#define ISP_UNLK_SCSI_DONE(isp) do { } while (0) #define ISP_LOCKU_SOFTC ISP_ILOCK_SOFTC #define ISP_UNLKU_SOFTC ISP_IUNLK_SOFTC #define ISP_TLOCK_INIT(isp) spin_lock_init(&isp->isp_osinfo.tlock) @@ -628,7 +628,7 @@ */ void isplinux_timer(unsigned long); void isplinux_mbtimer(unsigned long); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) irqreturn_t isplinux_intr(int, void *, struct pt_regs *); #else irqreturn_t isplinux_intr(int, void *); Modified: trunk/qla_isp/linux/isp_pci.c =================================================================== --- trunk/qla_isp/linux/isp_pci.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/linux/isp_pci.c 2008-05-21 11:56:09 UTC (rev 381) @@ -87,7 +87,7 @@ static int isp_pci_dmasetup(ispsoftc_t *, XS_T *, ispreq_t *, uint32_t *, uint32_t); static void isp_pci_dmateardown(ispsoftc_t *, XS_T *, uint32_t); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,6) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 6) #define DMA_64BIT_MASK 0xffffffffffffffffULL #define DMA_32BIT_MASK 0x00000000ffffffffULL #endif @@ -99,7 +99,7 @@ #define SAME_4G(addr, cnt) (FOURG_SEG(addr) == FOURG_SEG(addr + cnt - 1)) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) #define ISP_IRQ_FLAGS SA_INTERRUPT | SA_SHIRQ #else #define ISP_IRQ_FLAGS IRQF_SHARED @@ -365,11 +365,11 @@ msix_enabled : 2, msi_enabled : 1; }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8) #define pci_enable_msi(x) -ENXIO #define pci_enable_msix(x) -ENXIO -#define pci_disable_msi(x) do { ; } while(0) -#define pci_disable_msix(x) do { ; } while(0) +#define pci_disable_msi(x) do { ; } while (0) +#define pci_disable_msix(x) do { ; } while (0) #endif /* @@ -506,7 +506,7 @@ } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,7) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 7) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) /** * pci_intx - enables/disables PCI INTx for device dev * @pdev: the PCI device to operate on @@ -619,7 +619,7 @@ return (1); } -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,7) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 7) if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432) { struct msix_entry isp_msix[3]; int reg; @@ -669,7 +669,7 @@ pci_write_config_word(pdev, reg + PCI_EXP_DEVCTL, pectl); } } else -#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) +#elif LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0) if (pci_enable_msi(pdev) == 0) { isp_pci->msi_enabled = 1; } @@ -3479,7 +3479,7 @@ static struct pci_driver isplinux_pci_driver = { .name = ISP_NAME, -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9) +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 9) .driver = { .owner = THIS_MODULE, }, Modified: trunk/qla_isp/linux/isp_scst.c =================================================================== --- trunk/qla_isp/linux/isp_scst.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/linux/isp_scst.c 2008-05-21 11:56:09 UTC (rev 381) @@ -1245,7 +1245,7 @@ * Many procfs things is taken from scst/src/scst_proc.c */ -#if !defined(CONFIG_PPC) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)) +#if !defined(CONFIG_PPC) && (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) static int strncasecmp(const char *s1, const char *s2, size_t n) { Modified: trunk/qla_isp/linux/scsi_target.c =================================================================== --- trunk/qla_isp/linux/scsi_target.c 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/qla_isp/linux/scsi_target.c 2008-05-21 11:56:09 UTC (rev 381) @@ -79,7 +79,7 @@ #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) #define sg_page(_sg) ((_sg)->page) #define sg_assign_page(_sg, _pg) ((_sg)->page = (_pg)) #endif @@ -482,7 +482,7 @@ { int rv = 0; - switch(cmd) { + switch (cmd) { case SC_ENABLE_LUN: case SC_DISABLE_LUN: { Modified: trunk/scripts/generate-kernel-patch =================================================================== --- trunk/scripts/generate-kernel-patch 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/scripts/generate-kernel-patch 2008-05-21 11:56:09 UTC (rev 381) @@ -60,7 +60,7 @@ @@ -0,0 +1,$(wc -l "$1" | { read a b; echo $a; }) @@ EOF if [ "${2%.[ch]}" != "$2" ]; then - sed -e 's/^/+/' -e 's/[ ]*$//g' < "$1" + sed -e 's/^ \([^ ]*:\)$/\1/' -e 's/^/+/' < "$1" else sed -e 's/^/+/' < "$1" fi Modified: trunk/scst/include/scst.h =================================================================== --- trunk/scst/include/scst.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/scst/include/scst.h 2008-05-21 11:56:09 UTC (rev 381) @@ -40,7 +40,7 @@ #define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name, 0) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) typedef _Bool bool; #define true 1 #define false 0 @@ -48,7 +48,7 @@ /* Version numbers, the same as for the kernel */ #define SCST_VERSION_CODE 0x00090601 -#define SCST_VERSION(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + d) +#define SCST_VERSION(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + d) #define SCST_VERSION_STRING "0.9.6-rc1" #define SCST_INTERFACE_VERSION SCST_VERSION_STRING "$Revision$" SCST_CONST_VERSION @@ -1146,7 +1146,7 @@ unsigned long start_time; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) struct scsi_request *scsi_req; /* SCSI request */ #endif @@ -2335,7 +2335,7 @@ return mcmd->fn; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) static inline struct page *sg_page(struct scatterlist *sg) { @@ -2365,7 +2365,7 @@ sg->length = len; } -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) */ +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) */ static inline void sg_clear(struct scatterlist *sg) { @@ -2549,7 +2549,7 @@ int scst_single_seq_open(struct inode *inode, struct file *file); struct proc_dir_entry *scst_create_proc_entry(struct proc_dir_entry * root, - const char *name, struct scst_proc_data *pdata); + const char *name, struct scst_proc_data *pdata); #define SCST_DEF_RW_SEQ_OP(x) \ .seq_op = { \ Modified: trunk/scst/include/scst_debug.h =================================================================== --- trunk/scst/include/scst_debug.h 2008-05-21 00:11:38 UTC (rev 380) +++ trunk/scst/include/scst_debug.h 2008-05-21 11:56:09 UTC (rev 381) @@ -146,40 +146,40 @@ extern void debug_print_buffer(const char *log_level, const void *data, int len); -#define TRACE(trace, format, args...) \ -do { \ - if (___unlikely(trace_flag & (trace))) \ - { \ - char *__tflag = LOG_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ - __FUNCTION__, __LINE__) > 0) \ - { \ - __tflag = NO_FLAG; \ - } \ - PRINT(NO_FLAG, "%s" format, __tflag, args); \ - } \ -} while(0) +#define TRACE(trace, format, args...) \ +do { \ + if (___unlikely(trace_flag & (trace))) \ + { \ + char *__tflag = LOG_FLAG; \ + if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ + __FUNCTION__, __LINE__) > 0) \ + { \ + __tflag = NO_FLAG; \ + } \ + PRINT(NO_FLAG, "%s" format, __tflag, args); \ + } \ +} while (0) #define PRINT_BUFFER(message, buff, len) \ do { \ - PRINT(NO_FLAG, "%s:", message); \ - debug_print_buffer(INFO_FLAG, buff, len); \ -} while(0) + PRINT(NO_FLAG, "%s:", message); \ + debug_print_buffer(INFO_FLAG, buff, len); \ +} while (0) -#define PRINT_BUFF_FLAG(flag, message, buff, len) \ -do { \ - if (___unlikely(trace_flag & (flag))) \ - { \ - char *__tflag = INFO_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ - __LINE__) > 0) \ - { \ - __tflag = NO_FLAG; \ - } \ - PRINT(NO_FLAG, "%s%s:", __tflag, message); \ - debug_print_buffer(INFO_FLAG, buff, len); \ - } \ -} while(0) +#define PRINT_BUFF_FLAG(flag, message, buff, len) \ +do { \ + if (___unlikely(trace_flag & (flag))) \ + { \ + char *__tflag = INFO_FLAG; \ + if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\ + __LINE__) > 0) \ + { \ + __tflag = NO_FLAG; \ + } \ + PRINT(NO_FLAG, "%s%s:", __tflag, message); \ + debug_print_buffer(INFO_FLAG, buff, len); \ + } \ +} while (0) #else /* DEBUG || TRACING */ @@ -191,19 +191,19 @@ #ifdef DEBUG -#define __TRACE(trace, format, args...) \ -do { \ - if (trace_flag & (trace)) \ - { \ - char *__tflag = LOG_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ - __LINE__) > 0) \ - { \ - __tflag = NO_FLAG; \ - } \ - PRINT(NO_FLAG, "%s" format, __tflag, args); \ - } \ -} while(0) +#define __TRACE(trace, format, args...) \ +do { \ + if (trace_flag & (trace)) \ + { \ + char *__tflag = LOG_FLAG; \ + if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\ + __LINE__) > 0) \ + { \ + __tflag = NO_FLAG; \ + } \ + PRINT(NO_FLAG, "%s" format, __tflag, args); \ + } \ +} while (0) #define TRACE_MEM(args...) __TRACE(TRACE_MEMORY, args) #define TRACE_SG(args...) __TRACE(TRACE_SG_OP, args) @@ -212,137 +212,137 @@ #define TRACE_MGMT_DBG(args...) __TRACE(TRACE_MGMT_DEBUG, args) #define TRACE_MGMT_DBG_SPECIAL(args...) __TRACE(TRACE_MGMT_DEBUG|TRACE_SPECIAL, args) -#define TRACE_BUFFER(message, buff, len) \ -do { \ - if (trace_flag & TRACE_BUFF) \ - { \ - char *__tflag = LOG_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ - __LINE__) > 0) \ - { \ - __tflag = NO_FLAG; \ - } \ - PRINT(NO_FLAG, "%s%s:", __tflag, message); \ - debug_print_buffer(LOG_FLAG, buff, len); \ - } \ -} while(0) +#define TRACE_BUFFER(message, buff, len) \ +do { \ + if (trace_flag & TRACE_BUFF) \ + { \ + char *__tflag = LOG_FLAG; \ + if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ + __LINE__) > 0) \ + { \ + __tflag = NO_FLAG; \ + } \ + PRINT(NO_FLAG, "%s%s:", __tflag, message); \ + debug_print_buffer(LOG_FLAG, buff, len); \ + } \ +} while (0) -#define TRACE_BUFF_FLAG(flag, message, buff, len) \ -do { \ - if (trace_flag & (flag)) \ - { \ - char *__tflag = LOG_FLAG; \ - if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ - __LINE__) > 0) \ - { \ - __tflag = NO_FLAG; \ - } \ - PRINT(NO_FLAG, "%s%s:", __tflag, message); \ - debug_print_buffer(LOG_FLAG, buff, len); \ - } \ -} while(0) +#define TRACE_BUFF_FLAG(flag, message, buff, len) \ +do { \ + if (trace_flag & (flag)) \ + { \ + char *__tflag = LOG_FLAG; \ + if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ + __LINE__) > 0) \ + { \ + __tflag = NO_FLAG; \ + } \ + PRINT(NO_FLAG, "%s%s:", __tflag, message); \ + debug_print_buffer(LOG_FLAG, buff, len); \ + } \ +} while (0) -#define PRINT_LOG_FLAG(log_flag, format, args...) \ -do { \ - char *__tflag = log_flag; \ - if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ - __FUNCTION__, __LINE__) > 0) \ - { \ - __tflag = NO_FLAG; \ - } \ - PRINT(NO_FLAG, "%s" format, __tflag, args); \ -} while(0) +#define PRINT_LOG_FLAG(log_flag, format, args...) \ +do { \ + char *__tflag = log_flag; \ + if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ + __FUNCTION__, __LINE__) > 0) \ + { \ + __tflag = NO_FLAG; \ + } \ + PRINT(NO_FLAG, "%s" format, __tflag, args); \ +} while (0) -#define PRINT_ERROR(format, args...) \ -do { \ - if (strcmp(ERROR_FLAG, LOG_FLAG)) \ - { \ - PRINT_LOG_FLAG(LOG_FLAG, "***ERROR*** " format, args); \ - } \ - PRINT_LOG_FLAG(ERROR_FLAG, "***ERROR*** " format, args); \ -} while(0) +#define PRINT_ERROR(format, args...) \ +do { \ + if (strcmp(ERROR_FLAG, LOG_FLAG)) \ + { \ + PRINT_LOG_FLAG(LOG_FLAG, "***ERROR*** " format, args); \ + } \ + PRINT_LOG_FLAG(ERROR_FLAG, "***ERROR*** " format, args); \ +} while (0) -#define PRINT_CRIT_ERROR(format, args...) \ -do { \ -/* if (strcmp(CRIT_FLAG, LOG_FLAG)) \ - { \ - PRINT_LOG_FLAG(LOG_FLAG, "***CRITICAL ERROR*** " format, args); \ - }*/ \ - PRINT_LOG_FLAG(CRIT_FLAG, "***CRITICAL ERROR*** " format, args); \ -} while(0) +#define PRINT_CRIT_ERROR(format, args...) \ +do { \ + /* if (strcmp(CRIT_FLAG, LOG_FLAG)) \ + { \ + PRINT_LOG_FLAG(LOG_FLAG, "***CRITICAL ERROR*** " format, args); \ + }*/ \ + PRINT_LOG_FLAG(CRIT_FLAG, "***CRITICAL ERROR*** " format, args); \ +} while (0) -#define PRINT_INFO(format, args...) \ -do { \ - if (strcmp(INFO_FLAG, LOG_FLAG)) \ - { \ - PRINT_LOG_FLAG(LOG_FLAG, format, args); \ - } \ - PRINT_LOG_FLAG(INFO_FLAG, format, args); \ -} while(0) +#define PRINT_INFO(format, args...) \ +do { \ + if (strcmp(INFO_FLAG, LOG_FLAG)) \ + { \ + PRINT_LOG_FLAG(LOG_FLAG, format, args); \ + } \ + PRINT_LOG_FLAG(INFO_FLAG, format, args); \ +} while (0) -#define TRACE_ENTRY() \ -do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ - PRINT(LOG_FLAG, "[%d]: ENTRY %s", current->pid, \ - __FUNCTION__); \ - } \ - else \ - { \ - PRINT(LOG_FLAG, "ENTRY %s", __FUNCTION__); \ - } \ - } \ -} while(0) +#define TRACE_ENTRY() \ +do { \ + if (trace_flag & TRACE_ENTRYEXIT) \ + { \ + if (trace_flag & TRACE_PID) \ + { \ + PRINT(LOG_FLAG, "[%d]: ENTRY %s", current->pid, \ + __FUNCTION__); \ + } \ + else \ + { \ + PRINT(LOG_FLAG, "ENTRY %s", __FUNCTION__); \ + } \ + } \ +} while (0) -#define TRACE_EXIT() \ -do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ - PRINT(LOG_FLAG, "[%d]: EXIT %s", current->pid, \ - __FUNCTION__); \ - } \ - else \ - { \ - PRINT(LOG_FLAG, "EXIT %s", __FUNCTION__); \ - } \ - } \ -} while(0) +#define TRACE_EXIT() \ +do { \ + if (trace_flag & TRACE_ENTRYEXIT) \ + { \ + if (trace_flag & TRACE_PID) \ + { \ + PRINT(LOG_FLAG, "[%d]: EXIT %s", current->pid, \ + __FUNCTION__); \ + } \ + else \ + { \ + PRINT(LOG_FLAG, "EXIT %s", __FUNCTION__); \ + } \ + } \ +} while (0) -#define TRACE_EXIT_RES(res) \ -do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ - PRINT(LOG_FLAG, "[%d]: EXIT %s: %ld", current->pid, \ - __FUNCTION__, (long)(res)); \ - } \ - else \ - { \ - PRINT(LOG_FLAG, "EXIT %s: %ld", __FUNCTION__, (long)(res)); \ - } \ - } \ -} while(0) +#define TRACE_EXIT_RES(res) \ +do { \ + if (trace_flag & TRACE_ENTRYEXIT) \ + { \ + if (trace_flag & TRACE_PID) \ + { \ + PRINT(LOG_FLAG, "[%d]: EXIT %s: %ld", current->pid, \ + __FUNCTION__, (long)(res)); \ + } \ + else \ + { \ + PRINT(LOG_FLAG, "EXIT %s: %ld", __FUNCTION__, (long)(res)); \ + } \ + } \ +} while (0) -#define TRACE_EXIT_HRES(res) \ -do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ - PRINT(LOG_FLAG, "[%d]: EXIT %s: 0x%lx", current->pid, \ - __FUNCTION__, (long)(res)); \ - } \ - else \ - { \ - PRINT(LOG_FLAG, "EXIT %s: %lx", __FUNCTION__, (long)(res)); \ - } \ - } \ -} while(0) +#define TRACE_EXIT_HRES(res) \ +do { \ + if (trace_flag & TRACE_ENTRYEXIT) \ + { \ + if (trace_flag & TRACE_PID) \ + { \ + PRINT(LOG_FLAG, "[%d]: EXIT %s: 0x%lx", current->pid, \ + __FUNCTION__, (long)(res)); \ + } \ + else \ + { \ + PRINT(LOG_FLAG, "EXIT %s: %lx", __FUNCTION__, (long)(res)); \ + } \ + } \ +} while (0) #else /* DEBUG */ @@ -361,48 +361,48 @@ #ifdef LOG_PREFIX -#define PRINT_INFO(format, args...) \ -do { \ - PRINT(INFO_FLAG, "%s: " format, LOG_PREFIX, args); \ -} while(0) +#define PRINT_INFO(format, args...) \ +do { \ + PRINT(INFO_FLAG, "%s: " format, LOG_PREFIX, args); \ +} while (0) #define PRINT_ERROR(format, args...) \ do { \ - PRINT(ERROR_FLAG, "%s: ***ERROR*** " \ - format, LOG_PREFIX, args); \ -} while(0) + PRINT(ERROR_FLAG, "%s: ***ERROR*** " \ + format, LOG_PREFIX, args); \ +} while (0) #define PRINT_CRIT_ERROR(format, args...) \ do { \ - PRINT(CRIT_FLAG, "%s: ***CRITICAL ERROR*** " \ - format, LOG_PREFIX, args); \ -} while(0) + PRINT(CRIT_FLAG, "%s: ***CRITICAL ERROR*** " \ + format, LOG_PREFIX, args); \ +} while (0) #else #define PRINT_INFO(format, args...) \ do { \ - PRINT(INFO_FLAG, format, args); \ -} while(0) + PRINT(INFO_FLAG, format, args); \ +} while (0) #define PRINT_ERROR(format, args...) \ do { \ - PRINT(ERROR_FLAG, "***ERROR*** " \ - format, args); \ -} while(0) + PRINT(ERROR_FLAG, "***ERROR*** " \ + format, args); \ +} while (0) -#define PRINT_CRIT_ERROR(format, args...) \ -do { \ - PRINT(CRIT_FLAG, "***CRITICAL ERROR*** " \ - format, args); \ -} while(0) +#define PRINT_CRIT_ERROR(format, args...) \ +do { \ + PRINT(CRIT_FLAG, "***CRITICAL ERROR*** " \ + format, args); \ +} while (0) #endif /* LOG_PREFIX */ #endif /* DEBUG */ #if defined(DEBUG) && defined(CONFIG_DEBUG_SLAB) -#define SCST_SLAB_FLAGS ( SLAB_RED_ZONE | SLAB_POISON ) +#define SCST_SLAB_FLAGS (SLAB_RED_ZONE | SLAB_POISON) #else #define SCST_SLAB_FLAGS 0L #endif Modified: trunk/scst/src/dev_handlers/scst_changer.c =... [truncated message content] |