From: <vl...@us...> - 2008-05-22 16:25:18
|
Revision: 386 http://scst.svn.sourceforge.net/scst/?rev=386&view=rev Author: vlnb Date: 2008-05-22 09:13:36 -0700 (Thu, 22 May 2008) Log Message: ----------- Patch from Bart Van Assche <bar...@gm...> with one change ("/* To do */;;" replaced by "/* ToDo */"): The patch below fixes the following checkpatch complaints: - ERROR: else should follow close brace '}' - ERROR: need consistent spacing around '&' (ctx:VxW) - ERROR: open brace '{' following enum go on the same line - ERROR: open brace '{' following struct go on the same line - ERROR: that open brace { should be on the previous line - ERROR: trailing statements should be on next line - ERROR: trailing whitespace - WARNING: braces {} are not necessary for any arm of this statement The patch below has been verified as follows: - Verified the patch below by reading it. - Checked that checkpatch does no longer complain about the above categories of messages on the generated patch. - Checked that the generated kernel patch applies cleanly to the 2.6.25.4 kernel. - Checked that the patched 2.6.25.4 kernel compiles and installs cleanly, and that after reboot it was possible to load the iscsi-scst and ib_srpt kernel modules. Signed-off-by: Bart Van Assche <bar...@gm...> Modified Paths: -------------- trunk/iscsi-scst/include/iscsi_scst.h trunk/iscsi-scst/kernel/event.c trunk/iscsi-scst/kernel/iscsi.c trunk/iscsi-scst/kernel/nthread.c trunk/scst/include/scst.h trunk/scst/include/scst_const.h trunk/scst/include/scst_debug.h trunk/scst/include/scst_user.h trunk/scst/src/dev_handlers/scst_cdrom.c trunk/scst/src/dev_handlers/scst_changer.c trunk/scst/src/dev_handlers/scst_dev_handler.h trunk/scst/src/dev_handlers/scst_disk.c trunk/scst/src/dev_handlers/scst_modisk.c 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 Modified: trunk/iscsi-scst/include/iscsi_scst.h =================================================================== --- trunk/iscsi-scst/include/iscsi_scst.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/iscsi-scst/include/iscsi_scst.h 2008-05-22 16:13:36 UTC (rev 386) @@ -141,8 +141,7 @@ static inline int iscsi_is_key_declarative(int key) { - switch (key) - { + switch (key) { case key_max_xmit_data_length: return 1; default: Modified: trunk/iscsi-scst/kernel/event.c =================================================================== --- trunk/iscsi-scst/kernel/event.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/iscsi-scst/kernel/event.c 2008-05-22 16:13:36 UTC (rev 386) @@ -56,9 +56,9 @@ rlen = NLMSG_ALIGN(nlh->nlmsg_len); if (rlen > skb->len) rlen = skb->len; - if ((err = event_recv_msg(skb, nlh))) { + if ((err = event_recv_msg(skb, nlh))) netlink_ack(skb, nlh, -err); - } else if (nlh->nlmsg_flags & NLM_F_ACK) + else if (nlh->nlmsg_flags & NLM_F_ACK) netlink_ack(skb, nlh, 0); skb_pull(skb, rlen); } Modified: trunk/iscsi-scst/kernel/iscsi.c =================================================================== --- trunk/iscsi-scst/kernel/iscsi.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/iscsi-scst/kernel/iscsi.c 2008-05-22 16:13:36 UTC (rev 386) @@ -24,9 +24,9 @@ #include "digest.h" #ifndef NET_PAGE_CALLBACKS_DEFINED -#warning Patch put_page_callback-<kernel-version>.patch not applied on your \ +#warning "Patch put_page_callback-<kernel-version>.patch not applied on your \ kernel. ISCSI-SCST will run in the performance degraded mode. Refer \ - README file for details. + README file for details." #endif #define ISCSI_INIT_WRITE_WAKE 0x1 @@ -668,7 +668,7 @@ sg = rsp->sg = scst_alloc(PAGE_SIZE, GFP_KERNEL|__GFP_NOFAIL, &rsp->sg_cnt); if (sg == NULL) { - /* ToDo(); */ + /* ToDo */ } rsp->own_sg = 1; sense = (struct iscsi_sense_data *)page_address(sg_page(&sg[0])); @@ -731,7 +731,7 @@ sg = rsp->sg = scst_alloc(PAGE_SIZE, GFP_KERNEL|__GFP_NOFAIL, &rsp->sg_cnt); if (sg == NULL) { - /* ToDo(); */ + /* ToDo */ } rsp->own_sg = 1; addr = page_address(sg_page(&sg[0])); @@ -940,7 +940,7 @@ sg = cmnd->sg = scst_alloc(PAGE_SIZE, GFP_KERNEL|__GFP_NOFAIL, &cmnd->sg_cnt); if (sg == NULL) { - /* ToDo(); */ + /* ToDo */ } cmnd->own_sg = 1; cmnd->bufflen = PAGE_SIZE; @@ -1226,10 +1226,10 @@ cmnd->sg = sg = scst_alloc(size, GFP_KERNEL|__GFP_NOFAIL, &cmnd->sg_cnt); if (sg == NULL) { - /* ToDo(); */ + /* ToDo */ } if (cmnd->sg_cnt > ISCSI_CONN_IOV_MAX) { - /* ToDo(); */ + /* ToDo */ } cmnd->own_sg = 1; cmnd->bufflen = size; @@ -2516,9 +2516,8 @@ int rc = 1; while (test_write_ready(conn)) { rc = iscsi_send(conn); - if ((rc <= 0) || single_only) { + if ((rc <= 0) || single_only) break; - } } spin_lock_bh(&iscsi_wr_lock); @@ -2881,9 +2880,8 @@ list_for_each_entry_safe(t, tmp, &iscsi_threads_list, threads_list_entry) { int rc = kthread_stop(t->thr); - if (rc < 0) { + if (rc < 0) TRACE_MGMT_DBG("kthread_stop() failed: %d", rc); - } list_del(&t->threads_list_entry); kfree(t); } Modified: trunk/iscsi-scst/kernel/nthread.c =================================================================== --- trunk/iscsi-scst/kernel/nthread.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/iscsi-scst/kernel/nthread.c 2008-05-22 16:13:36 UTC (rev 386) @@ -253,18 +253,18 @@ 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)); - + /* * 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; @@ -976,46 +976,51 @@ iop = conn->write_iop; count = conn->write_iop_used; - if (iop) while (1) { - loff_t off = 0; - int rest; + if (iop) { + while (1) { + loff_t off = 0; + int rest; - sBUG_ON(count > sizeof(conn->write_iov)/sizeof(conn->write_iov[0])); -retry: - oldfs = get_fs(); - set_fs(KERNEL_DS); - res = vfs_writev(file, (struct iovec __user *)iop, count, &off); - set_fs(oldfs); - TRACE_WRITE("%#Lx:%u: %d(%ld)", conn->session->sid, conn->cid, - res, (long)iop->iov_len); - if (unlikely(res <= 0)) { - if (res == -EAGAIN) { - conn->write_iop = iop; - conn->write_iop_used = count; + sBUG_ON(count > sizeof(conn->write_iov) + / sizeof(conn->write_iov[0])); + retry: + oldfs = get_fs(); + set_fs(KERNEL_DS); + res = vfs_writev(file, (struct iovec __user *)iop, + count, &off); + set_fs(oldfs); + TRACE_WRITE("%#Lx:%u: %d(%ld)", conn->session->sid, + conn->cid, + res, (long)iop->iov_len); + if (unlikely(res <= 0)) { + if (res == -EAGAIN) { + conn->write_iop = iop; + conn->write_iop_used = count; + goto out_iov; + } else if (res == -EINTR) + goto retry; + goto out_err; + } + + rest = res; + size -= res; + while (iop->iov_len <= rest && rest) { + rest -= iop->iov_len; + iop++; + count--; + } + if (count == 0) { + conn->write_iop = NULL; + conn->write_iop_used = 0; + if (size) + break; goto out_iov; - } else if (res == -EINTR) - goto retry; - goto out_err; + } + sBUG_ON(iop > conn->write_iov + sizeof(conn->write_iov) + /sizeof(conn->write_iov[0])); + iop->iov_base += rest; + iop->iov_len -= rest; } - - rest = res; - size -= res; - while (iop->iov_len <= rest && rest) { - rest -= iop->iov_len; - iop++; - count--; - } - if (count == 0) { - conn->write_iop = NULL; - conn->write_iop_used = 0; - if (size) - break; - goto out_iov; - } - sBUG_ON(iop > conn->write_iov + - sizeof(conn->write_iov)/sizeof(conn->write_iov[0])); - iop->iov_base += rest; - iop->iov_len -= rest; } sg = write_cmnd->sg; Modified: trunk/scst/include/scst.h =================================================================== --- trunk/scst/include/scst.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/include/scst.h 2008-05-22 16:13:36 UTC (rev 386) @@ -411,8 +411,7 @@ typedef enum dma_data_direction scst_data_direction; -enum scst_cdb_flags -{ +enum scst_cdb_flags { SCST_TRANSFER_LEN_TYPE_FIXED = 0x01, /* must be equviv 1 (FIXED_BIT in cdb) */ SCST_SMALL_TIMEOUT = 0x02, SCST_LONG_TIMEOUT = 0x04, @@ -438,8 +437,7 @@ * SCST_TGT_RES_NEED_THREAD_CTX, and it will be recalled in the thread context, * where sleeping is allowed. */ -struct scst_tgt_template -{ +struct scst_tgt_template { /* public: */ /* @@ -683,8 +681,7 @@ int proc_dev_num; }; -struct scst_dev_type -{ +struct scst_dev_type { /* SCSI type of the supported device. MUST HAVE */ int type; @@ -843,8 +840,7 @@ struct proc_dir_entry *proc_dev_type_root; }; -struct scst_tgt -{ +struct scst_tgt { /* List of remote sessions per target, protected by scst_mutex */ struct list_head sess_list; @@ -889,8 +885,7 @@ #define TGT_DEV_HASH_SIZE (1<<TGT_DEV_HASH_SHIFT) #define HASH_VAL(_val) (_val & (TGT_DEV_HASH_SIZE - 1)) -struct scst_session -{ +struct scst_session { /* * Initialization phase, one of SCST_SESS_IPH_* constants, protected by * sess_list_lock @@ -975,16 +970,14 @@ #endif }; -struct scst_cmd_lists -{ +struct scst_cmd_lists { spinlock_t cmd_list_lock; struct list_head active_cmd_list; wait_queue_head_t cmd_list_waitQ; struct list_head lists_list_entry; }; -struct scst_cmd -{ +struct scst_cmd { /* List entry for below *_cmd_lists */ struct list_head cmd_list_entry; @@ -1246,8 +1239,7 @@ #endif }; -struct scst_rx_mgmt_params -{ +struct scst_rx_mgmt_params { int fn; uint64_t tag; const uint8_t *lun; @@ -1260,16 +1252,14 @@ unsigned char cmd_sn_set; }; -struct scst_mgmt_cmd_stub -{ +struct scst_mgmt_cmd_stub { struct scst_mgmt_cmd *mcmd; /* List entry in cmd->mgmt_cmd_list */ struct list_head cmd_mgmt_cmd_list_entry; }; -struct scst_mgmt_cmd -{ +struct scst_mgmt_cmd { /* List entry for *_mgmt_cmd_list */ struct list_head mgmt_cmd_list_entry; @@ -1321,8 +1311,7 @@ void *tgt_priv; }; -struct scst_device -{ +struct scst_device { struct scst_dev_type *handler; /* corresponding dev handler */ /* Pointer to lists of commands with the lock */ @@ -1437,8 +1426,7 @@ /* * Used to store threads local tgt_dev specific data */ -struct scst_thr_data_hdr -{ +struct scst_thr_data_hdr { /* List entry in tgt_dev->thr_data_list */ struct list_head thr_data_list_entry; pid_t pid; /* PID of the owner thread */ @@ -1450,8 +1438,7 @@ /* * Used to store per-session specific device information */ -struct scst_tgt_dev -{ +struct scst_tgt_dev { /* List entry in sess->sess_tgt_dev_list_hash */ struct list_head sess_tgt_dev_list_entry; @@ -1518,8 +1505,7 @@ /* * Used to store ACG-specific device information, like LUN */ -struct scst_acg_dev -{ +struct scst_acg_dev { struct scst_device *dev; /* corresponding device */ lun_t lun; /* device's LUN in this acg */ unsigned int rd_only_flag:1; /* if != 0, then read only */ @@ -1536,8 +1522,7 @@ * ACG - access control group. Used to store group related * control information. */ -struct scst_acg -{ +struct scst_acg { /* List of acg_dev's in this acg, protected by scst_mutex */ struct list_head acg_dev_list; @@ -1561,8 +1546,7 @@ * ACN - access control name. Used to store names, by which * incoming sessions will be assigned to appropriate ACG. */ -struct scst_acn -{ +struct scst_acn { /* Initiator's name */ const char *name; /* List entry in acg->acn_list */ @@ -1572,8 +1556,7 @@ /* * Used to store per-session UNIT ATTENTIONs */ -struct scst_tgt_dev_UA -{ +struct scst_tgt_dev_UA { /* List entry in tgt_dev->UA_list */ struct list_head UA_list_entry; /* Unit Attention sense */ Modified: trunk/scst/include/scst_const.h =================================================================== --- trunk/scst/include/scst_const.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/include/scst_const.h 2008-05-22 16:13:36 UTC (rev 386) @@ -92,8 +92,7 @@ /************************************************************* ** SCSI task attribute queue types *************************************************************/ -enum scst_cmd_queue_type -{ +enum scst_cmd_queue_type { SCST_CMD_QUEUE_UNTAGGED = 0, SCST_CMD_QUEUE_SIMPLE, SCST_CMD_QUEUE_ORDERED, Modified: trunk/scst/include/scst_debug.h =================================================================== --- trunk/scst/include/scst_debug.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/include/scst_debug.h 2008-05-22 16:13:36 UTC (rev 386) @@ -148,12 +148,10 @@ #define TRACE(trace, format, args...) \ do { \ - if (___unlikely(trace_flag & (trace))) \ - { \ + if (___unlikely(trace_flag & (trace))) { \ char *__tflag = LOG_FLAG; \ if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ - __FUNCTION__, __LINE__) > 0) \ - { \ + __FUNCTION__, __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s" format, __tflag, args); \ @@ -168,12 +166,10 @@ #define PRINT_BUFF_FLAG(flag, message, buff, len) \ do { \ - if (___unlikely(trace_flag & (flag))) \ - { \ + if (___unlikely(trace_flag & (flag))) { \ char *__tflag = INFO_FLAG; \ if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\ - __LINE__) > 0) \ - { \ + __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s%s:", __tflag, message); \ @@ -193,12 +189,10 @@ #define __TRACE(trace, format, args...) \ do { \ - if (trace_flag & (trace)) \ - { \ + if (trace_flag & (trace)) { \ char *__tflag = LOG_FLAG; \ if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__,\ - __LINE__) > 0) \ - { \ + __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s" format, __tflag, args); \ @@ -214,12 +208,10 @@ #define TRACE_BUFFER(message, buff, len) \ do { \ - if (trace_flag & TRACE_BUFF) \ - { \ + if (trace_flag & TRACE_BUFF) { \ char *__tflag = LOG_FLAG; \ if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ - __LINE__) > 0) \ - { \ + __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s%s:", __tflag, message); \ @@ -229,12 +221,10 @@ #define TRACE_BUFF_FLAG(flag, message, buff, len) \ do { \ - if (trace_flag & (flag)) \ - { \ + if (trace_flag & (flag)) { \ char *__tflag = LOG_FLAG; \ if (debug_print_prefix(trace_flag, __tflag, NULL, __FUNCTION__, \ - __LINE__) > 0) \ - { \ + __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s%s:", __tflag, message); \ @@ -246,8 +236,7 @@ do { \ char *__tflag = log_flag; \ if (debug_print_prefix(trace_flag, __tflag, __LOG_PREFIX, \ - __FUNCTION__, __LINE__) > 0) \ - { \ + __FUNCTION__, __LINE__) > 0) { \ __tflag = NO_FLAG; \ } \ PRINT(NO_FLAG, "%s" format, __tflag, args); \ @@ -255,8 +244,7 @@ #define PRINT_ERROR(format, args...) \ do { \ - if (strcmp(ERROR_FLAG, LOG_FLAG)) \ - { \ + if (strcmp(ERROR_FLAG, LOG_FLAG)) { \ PRINT_LOG_FLAG(LOG_FLAG, "***ERROR*** " format, args); \ } \ PRINT_LOG_FLAG(ERROR_FLAG, "***ERROR*** " format, args); \ @@ -273,8 +261,7 @@ #define PRINT_INFO(format, args...) \ do { \ - if (strcmp(INFO_FLAG, LOG_FLAG)) \ - { \ + if (strcmp(INFO_FLAG, LOG_FLAG)) { \ PRINT_LOG_FLAG(LOG_FLAG, format, args); \ } \ PRINT_LOG_FLAG(INFO_FLAG, format, args); \ @@ -282,14 +269,12 @@ #define TRACE_ENTRY() \ do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ + if (trace_flag & TRACE_ENTRYEXIT) { \ + if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: ENTRY %s", current->pid, \ __FUNCTION__); \ } \ - else \ + else { \ { \ PRINT(LOG_FLAG, "ENTRY %s", __FUNCTION__); \ } \ @@ -298,15 +283,12 @@ #define TRACE_EXIT() \ do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ + if (trace_flag & TRACE_ENTRYEXIT) { \ + if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: EXIT %s", current->pid, \ __FUNCTION__); \ } \ - else \ - { \ + else { \ PRINT(LOG_FLAG, "EXIT %s", __FUNCTION__); \ } \ } \ @@ -314,15 +296,12 @@ #define TRACE_EXIT_RES(res) \ do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ + if (trace_flag & TRACE_ENTRYEXIT) { \ + if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: EXIT %s: %ld", current->pid, \ __FUNCTION__, (long)(res)); \ } \ - else \ - { \ + else { \ PRINT(LOG_FLAG, "EXIT %s: %ld", __FUNCTION__, (long)(res)); \ } \ } \ @@ -330,15 +309,12 @@ #define TRACE_EXIT_HRES(res) \ do { \ - if (trace_flag & TRACE_ENTRYEXIT) \ - { \ - if (trace_flag & TRACE_PID) \ - { \ + if (trace_flag & TRACE_ENTRYEXIT) { \ + if (trace_flag & TRACE_PID) { \ PRINT(LOG_FLAG, "[%d]: EXIT %s: 0x%lx", current->pid, \ __FUNCTION__, (long)(res)); \ } \ - else \ - { \ + else { \ PRINT(LOG_FLAG, "EXIT %s: %lx", __FUNCTION__, (long)(res)); \ } \ } \ Modified: trunk/scst/include/scst_user.h =================================================================== --- trunk/scst/include/scst_user.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/include/scst_user.h 2008-05-22 16:13:36 UTC (rev 386) @@ -86,8 +86,7 @@ UCMD_STATE_RECV_MASK | \ UCMD_STATE_JAMMED_MASK) -struct scst_user_opt -{ +struct scst_user_opt { uint8_t parse_type; uint8_t on_free_cmd_type; uint8_t memory_reuse_type; @@ -104,8 +103,7 @@ uint8_t has_own_order_mgmt; }; -struct scst_user_dev_desc -{ +struct scst_user_dev_desc { aligned_u64 version_str; uint8_t type; struct scst_user_opt opt; @@ -113,8 +111,7 @@ char name[SCST_MAX_NAME]; }; -struct scst_user_sess -{ +struct scst_user_sess { aligned_u64 sess_h; aligned_u64 lun; uint16_t threads_num; @@ -122,8 +119,7 @@ char initiator_name[SCST_MAX_NAME]; }; -struct scst_user_scsi_cmd_parse -{ +struct scst_user_scsi_cmd_parse { aligned_u64 sess_h; uint8_t cdb[SCST_MAX_CDB_SIZE]; @@ -142,8 +138,7 @@ uint32_t sn; }; -struct scst_user_scsi_cmd_alloc_mem -{ +struct scst_user_scsi_cmd_alloc_mem { aligned_u64 sess_h; uint8_t cdb[SCST_MAX_CDB_SIZE]; @@ -157,8 +152,7 @@ uint32_t sn; }; -struct scst_user_scsi_cmd_exec -{ +struct scst_user_scsi_cmd_exec { aligned_u64 sess_h; uint8_t cdb[SCST_MAX_CDB_SIZE]; @@ -180,8 +174,7 @@ uint32_t partial_offset; }; -struct scst_user_scsi_on_free_cmd -{ +struct scst_user_scsi_on_free_cmd { aligned_u64 pbuf; int32_t resp_data_len; uint8_t buffer_cached; @@ -190,13 +183,11 @@ uint8_t delivery_status; }; -struct scst_user_on_cached_mem_free -{ +struct scst_user_on_cached_mem_free { aligned_u64 pbuf; }; -struct scst_user_tm -{ +struct scst_user_tm { aligned_u64 sess_h; uint32_t fn; uint32_t cmd_h_to_abort; @@ -204,8 +195,7 @@ uint8_t cmd_sn_set; }; -struct scst_user_get_cmd -{ +struct scst_user_get_cmd { aligned_u64 preply; uint32_t cmd_h; uint32_t subcode; @@ -220,21 +210,18 @@ }; }; -struct scst_user_scsi_cmd_reply_parse -{ +struct scst_user_scsi_cmd_reply_parse { uint8_t queue_type; uint8_t data_direction; int32_t data_len; int32_t bufflen; }; -struct scst_user_scsi_cmd_reply_alloc_mem -{ +struct scst_user_scsi_cmd_reply_alloc_mem { aligned_u64 pbuf; }; -struct scst_user_scsi_cmd_reply_exec -{ +struct scst_user_scsi_cmd_reply_exec { int32_t resp_data_len; aligned_u64 pbuf; @@ -247,8 +234,7 @@ aligned_u64 psense_buffer; }; -struct scst_user_reply_cmd -{ +struct scst_user_reply_cmd { uint32_t cmd_h; uint32_t subcode; union { Modified: trunk/scst/src/dev_handlers/scst_cdrom.c =================================================================== --- trunk/scst/src/dev_handlers/scst_cdrom.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_cdrom.c 2008-05-22 16:13:36 UTC (rev 386) @@ -44,8 +44,7 @@ #define CDROM_DEF_BLOCK_SHIFT 11 -struct cdrom_params -{ +struct cdrom_params { int block_shift; }; Modified: trunk/scst/src/dev_handlers/scst_changer.c =================================================================== --- trunk/scst/src/dev_handlers/scst_changer.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_changer.c 2008-05-22 16:13:36 UTC (rev 386) @@ -76,8 +76,7 @@ * If the device is offline, don't try to read capacity or any * of the other stuff */ - if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) - { + if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) { TRACE_DBG("%s", "Device is offline"); res = -ENODEV; goto out; @@ -150,11 +149,10 @@ cmd->retries = SCST_PASSTHROUGH_RETRIES; - if (cmd->op_flags & SCST_LONG_TIMEOUT) { + if (cmd->op_flags & SCST_LONG_TIMEOUT) cmd->timeout = CHANGER_LONG_TIMEOUT; - } else { + else cmd->timeout = CHANGER_TIMEOUT; - } return res; } Modified: trunk/scst/src/dev_handlers/scst_dev_handler.h =================================================================== --- trunk/scst/src/dev_handlers/scst_dev_handler.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_dev_handler.h 2008-05-22 16:13:36 UTC (rev 386) @@ -96,9 +96,8 @@ TRACE_ENTRY(); root = scst_proc_get_dev_type_root(dev_type); - if (root) { + if (root) remove_proc_entry(DEV_HANDLER_LOG_ENTRY_NAME, root); - } TRACE_EXIT(); #endif Modified: trunk/scst/src/dev_handlers/scst_disk.c =================================================================== --- trunk/scst/src/dev_handlers/scst_disk.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_disk.c 2008-05-22 16:13:36 UTC (rev 386) @@ -63,8 +63,7 @@ #define DISK_DEF_BLOCK_SHIFT 9 -struct disk_params -{ +struct disk_params { int block_shift; }; @@ -196,9 +195,7 @@ TRACE_DBG("READ_CAPACITY done: %x", res); if (!res || (sbuff[12] != 0x28 && sbuff[12] != 0x29)) - { break; - } if (!--retries) { PRINT_ERROR("UA not clear after %d retries", SCST_DEV_UA_RETRIES); Modified: trunk/scst/src/dev_handlers/scst_modisk.c =================================================================== --- trunk/scst/src/dev_handlers/scst_modisk.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_modisk.c 2008-05-22 16:13:36 UTC (rev 386) @@ -63,8 +63,7 @@ #define MODISK_DEF_BLOCK_SHIFT 10 -struct modisk_params -{ +struct modisk_params { int block_shift; }; @@ -175,8 +174,7 @@ * If the device is offline, don't try to read capacity or any * of the other stuff */ - if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) - { + if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) { TRACE_DBG("%s", "Device is offline"); res = -ENODEV; goto out_free_params; Modified: trunk/scst/src/dev_handlers/scst_processor.c =================================================================== --- trunk/scst/src/dev_handlers/scst_processor.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_processor.c 2008-05-22 16:13:36 UTC (rev 386) @@ -76,8 +76,7 @@ * If the device is offline, don't try to read capacity or any * of the other stuff */ - if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) - { + if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) { TRACE_DBG("%s", "Device is offline"); res = -ENODEV; goto out; @@ -150,11 +149,10 @@ cmd->retries = SCST_PASSTHROUGH_RETRIES; - if (cmd->op_flags & SCST_LONG_TIMEOUT) { + if (cmd->op_flags & SCST_LONG_TIMEOUT) cmd->timeout = PROCESSOR_LONG_TIMEOUT; - } else { + else cmd->timeout = PROCESSOR_TIMEOUT; - } return res; } Modified: trunk/scst/src/dev_handlers/scst_raid.c =================================================================== --- trunk/scst/src/dev_handlers/scst_raid.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_raid.c 2008-05-22 16:13:36 UTC (rev 386) @@ -76,8 +76,7 @@ * If the device is offline, don't try to read capacity or any * of the other stuff */ - if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) - { + if (dev->scsi_dev->sdev_state == SDEV_OFFLINE) { TRACE_DBG("%s", "Device is offline"); res = -ENODEV; goto out; @@ -150,11 +149,10 @@ cmd->retries = SCST_PASSTHROUGH_RETRIES; - if (cmd->op_flags & SCST_LONG_TIMEOUT) { + if (cmd->op_flags & SCST_LONG_TIMEOUT) cmd->timeout = RAID_LONG_TIMEOUT; - } else { + else cmd->timeout = RAID_TIMEOUT; - } return res; } Modified: trunk/scst/src/dev_handlers/scst_tape.c =================================================================== --- trunk/scst/src/dev_handlers/scst_tape.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_tape.c 2008-05-22 16:13:36 UTC (rev 386) @@ -68,8 +68,7 @@ /* The fixed bit in READ/WRITE/VERIFY */ #define SILI_BIT 2 -struct tape_params -{ +struct tape_params { int block_size; }; @@ -342,19 +341,18 @@ TRACE_ENTRY(); - if ((status == SAM_STAT_GOOD) || (status == SAM_STAT_CONDITION_MET)) { + if ((status == SAM_STAT_GOOD) || (status == SAM_STAT_CONDITION_MET)) res = scst_tape_generic_dev_done(cmd, tape_set_block_size); - } else if ((status == SAM_STAT_CHECK_CONDITION) && - SCST_SENSE_VALID(cmd->sense)) - { + else if ((status == SAM_STAT_CHECK_CONDITION) && + SCST_SENSE_VALID(cmd->sense)) { struct tape_params *params; TRACE_DBG("%s", "Extended sense"); if (opcode == READ_6 && !(cmd->cdb[1] & SILI_BIT) && - (cmd->sense[2] & 0xe0)) { /* EOF, EOM, or ILI */ + (cmd->sense[2] & 0xe0)) { + /* EOF, EOM, or ILI */ int TransferLength, Residue = 0; - if ((cmd->sense[2] & 0x0f) == BLANK_CHECK) { + if ((cmd->sense[2] & 0x0f) == BLANK_CHECK) cmd->sense[2] &= 0xcf; /* No need for EOM in this case */ - } TransferLength = ((cmd->cdb[2] << 16) | (cmd->cdb[3] << 8) | cmd->cdb[4]); /* Compute the residual count */ Modified: trunk/scst/src/dev_handlers/scst_user.c =================================================================== --- trunk/scst/src/dev_handlers/scst_user.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_user.c 2008-05-22 16:13:36 UTC (rev 386) @@ -40,8 +40,7 @@ #define DEV_USER_DETACH_TIMEOUT (5*HZ) #define DEV_USER_PRE_UNREG_POLL_TIME (HZ/10) -struct scst_user_dev -{ +struct scst_user_dev { struct rw_semaphore dev_rwsem; struct scst_cmd_lists cmd_lists; @@ -101,8 +100,7 @@ struct completion cleanup_cmpl; }; -struct scst_user_pre_unreg_sess_obj -{ +struct scst_user_pre_unreg_sess_obj { struct scst_tgt_dev *tgt_dev; unsigned int active:1; unsigned int exit:1; @@ -115,8 +113,7 @@ }; /* Most fields are unprotected, since only one thread at time can access them */ -struct scst_user_cmd -{ +struct scst_user_cmd { struct scst_cmd *cmd; struct scst_user_dev *dev; @@ -444,9 +441,9 @@ ((ucmd->cmd->data_direction == SCST_DATA_READ) && (mem_reuse_type == SCST_USER_MEM_REUSE_READ)) || ((ucmd->cmd->data_direction == SCST_DATA_WRITE) && - (mem_reuse_type == SCST_USER_MEM_REUSE_WRITE))) { + (mem_reuse_type == SCST_USER_MEM_REUSE_WRITE))) return 1; - } else + else return 0; } @@ -3175,9 +3172,8 @@ TRACE_ENTRY(); rc = kthread_stop(cleanup_thread); - if (rc < 0) { + if (rc < 0) TRACE_MGMT_DBG("kthread_stop() failed: %d", rc); - } unregister_chrdev(DEV_USER_MAJOR, DEV_USER_NAME); class_device_destroy(dev_user_sysfs_class, MKDEV(DEV_USER_MAJOR, 0)); Modified: trunk/scst/src/dev_handlers/scst_vdisk.c =================================================================== --- trunk/scst/src/dev_handlers/scst_vdisk.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/dev_handlers/scst_vdisk.c 2008-05-22 16:13:36 UTC (rev 386) @@ -1125,13 +1125,15 @@ len = scnprintf(dev_id_str, 6, "%d", dev_id_num); TRACE_DBG("num %d, str <%s>, len %d", dev_id_num, dev_id_str, len); - if (0 == cmd->cdb[2]) { /* supported vital product data pages */ + if (0 == cmd->cdb[2]) { + /* supported vital product data pages */ buf[3] = 3; buf[4] = 0x0; /* this page */ buf[5] = 0x80; /* unit serial number */ buf[6] = 0x83; /* device identification */ resp_len = buf[3] + 4; - } else if (0x80 == cmd->cdb[2]) { /* unit serial number */ + } else if (0x80 == cmd->cdb[2]) { + /* unit serial number */ buf[1] = 0x80; if (virt_dev->usn == NULL) { buf[3] = MAX_USN_LEN; @@ -1147,7 +1149,8 @@ strncpy(&buf[4], virt_dev->usn, usn_len); } resp_len = buf[3] + 4; - } else if (0x83 == cmd->cdb[2]) { /* device identification */ + } else if (0x83 == cmd->cdb[2]) { + /* device identification */ int num = 4; buf[1] = 0x83; @@ -1439,7 +1442,8 @@ offset = 8; } - if (0 != subpcode) { /* TODO: Control Extension page */ + if (0 != subpcode) { + /* TODO: Control Extension page */ TRACE_DBG("%s", "MODE SENSE: Only subpage 0 is supported"); scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_invalid_field_in_cdb)); @@ -1583,11 +1587,10 @@ goto out_put; } - if (mselect_6) { + if (mselect_6) offset = 4; - } else { + else offset = 8; - } if (address[offset - 1] == 8) { offset += 8; @@ -1606,7 +1609,8 @@ scst_sense_invalid_field_in_parm_list)); goto out_put; } - if ((address[offset] & 0x3f) == 0x8) { /* Caching page */ + if ((address[offset] & 0x3f) == 0x8) { + /* Caching page */ if (address[offset + 1] != 18) { PRINT_ERROR("%s", "MODE SELECT: Invalid " "caching page request"); @@ -1625,7 +1629,8 @@ * It's too early to implement it, since we can't control the backstorage * device parameters. ToDo */ - } else if ((address[offset] & 0x3f) == 0xA) { /* Control page */ + } else if ((address[offset] & 0x3f) == 0xA) { + /* Control page */ if (address[offset + 1] != 0xA) { PRINT_ERROR("%s", "MODE SELECT: Invalid " "control page request"); @@ -1742,7 +1747,7 @@ buffer[4] = (nblocks >> 24) & 0xFF; buffer[5] = (nblocks >> 16) & 0xFF; buffer[6] = (nblocks >> 8) & 0xFF; - buffer[7] = nblocks& 0xFF; + buffer[7] = nblocks & 0xFF; buffer[8] = (blocksize >> (BYTE * 3)) & 0xFF; buffer[9] = (blocksize >> (BYTE * 2)) & 0xFF; @@ -1822,16 +1827,14 @@ buffer[2] = 0x01; /* First Track/Session */ buffer[3] = 0x01; /* Last Track/Session */ off = 4; - if (cmd->cdb[6] <= 1) - { + if (cmd->cdb[6] <= 1) { /* Fistr TOC Track Descriptor */ buffer[off+1] = 0x14; /* ADDR 0x10 - Q Sub-channel encodes current position data CONTROL 0x04 - Data track, recoreded uninterrupted */ buffer[off+2] = 0x01; /* Track Number */ off += 8; } - if (!(cmd->cdb[2] & 0x01)) - { + if (!(cmd->cdb[2] & 0x01)) { /* Lead-out area TOC Track Descriptor */ buffer[off+1] = 0x14; buffer[off+2] = 0xAA; /* Track Number */ @@ -2021,11 +2024,10 @@ err = full_len; else { /* SEEK */ - if (fd->f_op->llseek) { + if (fd->f_op->llseek) err = fd->f_op->llseek(fd, loff, 0/*SEEK_SET*/); - } else { + else err = default_llseek(fd, loff, 0/*SEEK_SET*/); - } if (err != loff) { PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err, (uint64_t)loff); @@ -2112,11 +2114,10 @@ err = full_len; else { /* SEEK */ - if (fd->f_op->llseek) { + if (fd->f_op->llseek) err = fd->f_op->llseek(fd, loff, 0 /*SEEK_SET */); - } else { + else err = default_llseek(fd, loff, 0 /*SEEK_SET */); - } if (err != loff) { PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err, (uint64_t)loff); @@ -2404,11 +2405,10 @@ set_fs(get_ds()); if (!virt_dev->nullio) { - if (fd->f_op->llseek) { + if (fd->f_op->llseek) err = fd->f_op->llseek(fd, loff, 0/*SEEK_SET*/); - } else { + else err = default_llseek(fd, loff, 0/*SEEK_SET*/); - } if (err != loff) { PRINT_ERROR("lseek trouble %Ld != %Ld", (uint64_t)err, (uint64_t)loff); @@ -2658,9 +2658,8 @@ } p = buffer; - if (p[strlen(p) - 1] == '\n') { + if (p[strlen(p) - 1] == '\n') p[strlen(p) - 1] = '\0'; - } if (!strncmp("close ", p, 6)) { p += 6; action = 0; @@ -2690,7 +2689,8 @@ goto out_up; } - if (action) { /* open */ + if (action) { + /* open */ virt_dev = NULL; list_for_each_entry(vv, &vdisk_dev_list, vdisk_dev_list_entry) @@ -3089,11 +3089,10 @@ /* seek to end */ old_fs = get_fs(); set_fs(get_ds()); - if (fd->f_op->llseek) { + if (fd->f_op->llseek) err = fd->f_op->llseek(fd, 0, 2/*SEEK_END*/); - } else { + else err = default_llseek(fd, 0, 2/*SEEK_END*/); - } set_fs(old_fs); filp_close(fd, NULL); if (err < 0) { @@ -3207,9 +3206,8 @@ } p = buffer; - if (p[strlen(p) - 1] == '\n') { + if (p[strlen(p) - 1] == '\n') p[strlen(p) - 1] = '\0'; - } if (!strncmp("close ", p, 6)) { p += 6; action = 0; @@ -3242,15 +3240,18 @@ goto out_up; } - if (action == 2) { /* open */ + if (action == 2) { + /* open */ res = vcdrom_open(p, name); if (res != 0) goto out_up; - } else if (action == 1) { /* change */ + } else if (action == 1) { + /* change */ res = vcdrom_change(p, name); if (res != 0) goto out_up; - } else { /* close */ + } else { + /* close */ res = vcdrom_close(name); if (res != 0) goto out_up; Modified: trunk/scst/src/scst_cdbprobe.h =================================================================== --- trunk/scst/src/scst_cdbprobe.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_cdbprobe.h 2008-05-22 16:13:36 UTC (rev 386) @@ -54,8 +54,7 @@ #define SCST_CDB_RESERVED 'R' /* reserved */ #define SCST_CDB_NOTSUPP ' ' /* don't use */ -struct scst_sdbops -{ +struct scst_sdbops { uint8_t ops; /* SCSI-2 op codes */ uint8_t devkey[16]; /* Key for every device type M,O,V,R * type_disk devkey[0] Modified: trunk/scst/src/scst_debug.c =================================================================== --- trunk/scst/src/scst_debug.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_debug.c 2008-05-22 16:13:36 UTC (rev 386) @@ -109,11 +109,10 @@ trace_buf[i++] = '.'; } trace_buf[i] = '\0'; - if (f) { - PRINT(log_level, "%s", trace_buf) - } else { + if (f) + PRINT(log_level, "%s", trace_buf); + else PRINT(NO_FLAG, "%s", trace_buf); - } spin_unlock_irqrestore(&trace_buf_lock, flags); return; Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_lib.c 2008-05-22 16:13:36 UTC (rev 386) @@ -438,9 +438,8 @@ tgt_dev->max_sg_cnt = min(ini_sg, sess->tgt->sg_tablesize); if ((sess->tgt->tgtt->use_clustering || ini_use_clustering) && - !sess->tgt->tgtt->no_clustering) { + !sess->tgt->tgtt->no_clustering) scst_sgv_pool_use_norm_clust(tgt_dev); - } if (sess->tgt->tgtt->unchecked_isa_dma || ini_unchecked_isa_dma) { scst_sgv_pool_use_dma(tgt_dev); @@ -455,8 +454,7 @@ "SCST lun=%Ld", dev->scsi_dev->host->host_no, dev->scsi_dev->channel, dev->scsi_dev->id, dev->scsi_dev->lun, (uint64_t)tgt_dev->lun); - } - else { + } else { TRACE_MGMT_DBG("Virtual device %s on SCST lun=%Ld", dev->virt_name, (uint64_t)tgt_dev->lun); } @@ -834,9 +832,8 @@ list_add_tail(&n->acn_list_entry, &acg->acn_list); out: - if (res == 0) { + if (res == 0) PRINT_INFO("Added name %s to group %s", name, acg->acg_name); - } TRACE_EXIT_RES(res); return res; @@ -1424,8 +1421,7 @@ */ atomic_inc(&tgt->finished_cmds); smp_mb__after_atomic_inc(); - if (unlikely(tgt->retry_cmds > 0)) - { + if (unlikely(tgt->retry_cmds > 0)) { struct scst_cmd *c, *tc; unsigned long flags; @@ -2729,9 +2725,8 @@ list_del(&cmd->sn_cmd_list_entry); spin_unlock_irq(&tgt_dev->sn_lock); if (test_and_set_bit(SCST_CMD_CAN_BE_DESTROYED, - &cmd->cmd_flags)) { + &cmd->cmd_flags)) scst_destroy_put_cmd(cmd); - } scst_inc_expected_sn(tgt_dev, slot); expected_sn = tgt_dev->expected_sn; spin_lock_irq(&tgt_dev->sn_lock); @@ -3163,7 +3158,8 @@ hi = rv / 127773; lo = rv % 127773; rv = 16807 * lo - 2836 * hi; - if (rv <= 0) rv += 2147483647; + if (rv <= 0) + rv += 2147483647; RandomValue = rv; spin_unlock_irqrestore(&lock, flags); return rv; @@ -3182,8 +3178,7 @@ static spinlock_t scst_tm_dbg_lock = SPIN_LOCK_UNLOCKED; /* All serialized by scst_tm_dbg_lock */ -struct -{ +struct { unsigned int tm_dbg_release:1; unsigned int tm_dbg_blocked:1; } tm_dbg_flags; Modified: trunk/scst/src/scst_main.c =================================================================== --- trunk/scst/src/scst_main.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_main.c 2008-05-22 16:13:36 UTC (rev 386) @@ -147,8 +147,7 @@ MODULE_PARM_DESC(scst_max_cmd_mem, "Maximum memory allowed to be consumed by " "the SCST commands at any given time in MB"); -struct scst_dev_type scst_null_devtype = -{ +struct scst_dev_type scst_null_devtype = { .name = "none", }; @@ -542,8 +541,7 @@ "scsi%d, channel %d, id %d, lun %d, type %d", scsidp->host->host_no, scsidp->channel, scsidp->id, scsidp->lun, scsidp->type); - } - else { + } else { PRINT_ERROR("Failed to attach SCSI target mid-level " "at scsi%d, channel %d, id %d, lun %d, type %d", scsidp->host->host_no, scsidp->channel, scsidp->id, @@ -696,8 +694,7 @@ if (res > 0) { PRINT_INFO("Attached SCSI target mid-level to virtual " "device %s (id %d)", dev_name, dev->virt_id); - } - else { + } else { PRINT_INFO("Failed to attach SCSI target mid-level to " "virtual device %s", dev_name); } @@ -807,9 +804,8 @@ goto out_up; res = scst_build_proc_dev_handler_dir_entries(dev_type); - if (res < 0) { + if (res < 0) goto out_up; - } list_add_tail(&dev_type->dev_type_list_entry, &scst_dev_type_list); @@ -1033,9 +1029,8 @@ list_for_each_entry_safe(ct, tmp, &dev->threads_list, thread_list_entry) { int rc = kthread_stop(ct->cmd_thread); - if (rc < 0) { + if (rc < 0) TRACE_MGMT_DBG("kthread_stop() failed: %d", rc); - } list_del(&ct->thread_list_entry); kfree(ct); if ((num > 0) && (++i >= num)) @@ -1204,9 +1199,8 @@ int res; res = kthread_stop(ct->cmd_thread); - if (res < 0) { + if (res < 0) TRACE_MGMT_DBG("kthread_stop() failed: %d", res); - } list_del(&ct->thread_list_entry); kfree(ct); scst_threads_info.nr_cmd_threads--; @@ -1553,7 +1547,10 @@ p = KMEM_CACHE(s, SCST_SLAB_FLAGS); \ TRACE_MEM("Slab create: %s at %p size %zd", #s, p, \ sizeof(struct s)); \ - if (p == NULL) { res = -ENOMEM; goto o; } \ + if (p == NULL) { \ + res = -ENOMEM; \ + goto o; \ + } \ } while (0) INIT_CACHEP(scst_mgmt_cachep, scst_mgmt_cmd, out); Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_mem.c 2008-05-22 16:13:36 UTC (rev 386) @@ -809,9 +809,8 @@ static void sgv_pool_cached_init(struct sgv_pool *pool) { int i; - for (i = 0; i < SGV_POOL_ELEMENTS; i++) { + for (i = 0; i < SGV_POOL_ELEMENTS; i++) INIT_LIST_HEAD(&pool->recycling_lists[i]); - } } int sgv_pool_init(struct sgv_pool *pool, const char *name, int clustered) Modified: trunk/scst/src/scst_mem.h =================================================================== --- trunk/scst/src/scst_mem.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_mem.h 2008-05-22 16:13:36 UTC (rev 386) @@ -30,8 +30,7 @@ unsigned short pg_count; }; -struct sgv_pool_obj -{ +struct sgv_pool_obj { int order; struct { @@ -50,30 +49,26 @@ struct scatterlist sg_entries_data[0]; }; -struct sgv_pool_acc -{ +struct sgv_pool_acc { u32 cached_pages, cached_entries; atomic_t big_alloc, other_alloc; atomic_t big_pages, other_pages; atomic_t big_merged, other_merged; }; -struct sgv_pool_cache_acc -{ +struct sgv_pool_cache_acc { atomic_t total_alloc, hit_alloc; atomic_t merged; }; -struct sgv_pool_alloc_fns -{ +struct sgv_pool_alloc_fns { struct page *(*alloc_pages_fn)(struct scatterlist *sg, gfp_t gfp_mask, void *priv); void (*free_pages_fn)(struct scatterlist *sg, int sg_count, void *priv); }; -struct sgv_pool -{ +struct sgv_pool { unsigned int clustered; struct sgv_pool_alloc_fns alloc_fns; /* 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 */ @@ -89,8 +84,7 @@ struct list_head sgv_pool_list_entry; }; -struct scst_sgv_pools_manager -{ +struct scst_sgv_pools_manager { struct { struct sgv_pool norm_clust, norm; struct sgv_pool dma; Modified: trunk/scst/src/scst_priv.h =================================================================== --- trunk/scst/src/scst_priv.h 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_priv.h 2008-05-22 16:13:36 UTC (rev 386) @@ -181,8 +181,7 @@ extern struct list_head scst_delayed_mgmt_cmd_list; extern wait_queue_head_t scst_mgmt_cmd_list_waitQ; -struct scst_tasklet -{ +struct scst_tasklet { spinlock_t tasklet_lock; struct list_head tasklet_cmd_list; struct tasklet_struct tasklet; Modified: trunk/scst/src/scst_proc.c =================================================================== --- trunk/scst/src/scst_proc.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_proc.c 2008-05-22 16:13:36 UTC (rev 386) @@ -268,9 +268,8 @@ p += 6; action = SCST_PROC_ACTION_VALUE; } else { - if (p[strlen(p) - 1] == '\n') { + if (p[strlen(p) - 1] == '\n') p[strlen(p) - 1] = '\0'; - } PRINT_ERROR("Unknown action \"%s\"", p); res = -EINVAL; goto out_free; @@ -289,13 +288,11 @@ case SCST_PROC_ACTION_SET: case SCST_PROC_ACTION_ADD: case SCST_PROC_ACTION_DEL: - while (isspace(*p) && *p != '\0') { + while (isspace(*p) && *p != '\0') p++; - } e = p; - while (!isspace(*e) && *e != '\0') { + while (!isspace(*e) && *e != '\0') e++; - } *e = 0; if (tbl) { t = tbl; @@ -324,9 +321,8 @@ } break; case SCST_PROC_ACTION_VALUE: - while (isspace(*p) && *p != '\0') { + while (isspace(*p) && *p != '\0') p++; - } level = simple_strtoul(p, NULL, 0); break; } @@ -802,17 +798,14 @@ goto out_remove4; } - if (scst_proc_init_module_log() < 0) { + if (scst_proc_init_module_log() < 0) goto out_remove5; - } - if (scst_proc_init_groups() < 0) { + if (scst_proc_init_groups() < 0) goto out_remove6; - } - if (scst_proc_init_sgv() < 0) { + if (scst_proc_init_sgv() < 0) goto out_remove7; - } out: TRACE_EXIT_RES(res); @@ -1251,9 +1244,8 @@ * or echo "assign H:C:I:L HANDLER_NAME" >/proc/scsi_tgt/scsi_tgt */ p = buffer; - if (p[strlen(p) - 1] == '\n') { + if (p[strlen(p) - 1] == '\n') p[strlen(p) - 1] = '\0'; - } if (!strncasecmp("assign ", p, 7)) { p += 7; action = SCST_PROC_ACTION_ASSIGN; @@ -1345,9 +1337,8 @@ TRACE_ENTRY(); - while (isspace(*p) && *p != '\0') { + while (isspace(*p) && *p != '\0') p++; - } host = simple_strtoul(p, &p, 0); if ((host == ULONG_MAX) || (*p != ':')) @@ -1367,13 +1358,11 @@ e = p; e++; - while (isspace(*e) && *e != '\0') { + while (isspace(*e) && *e != '\0') e++; - } ee = e; - while (!isspace(*ee) && *ee != '\0') { + while (!isspace(*ee) && *ee != '\0') ee++; - } *ee = '\0'; TRACE_DBG("Dev %ld:%ld:%ld:%ld, handler %s", host, channel, id, lun, e); @@ -1383,8 +1372,7 @@ d->scsi_dev->host->host_no == host && d->scsi_dev->channel == channel && d->scsi_dev->id == id && - d->scsi_dev->lun == lun) - { + d->scsi_dev->lun == lun) { dev = d; TRACE_DBG("Dev %p (%ld:%ld:%ld:%ld) found", dev, host, channel, id, lun); @@ -1476,9 +1464,8 @@ * or echo "clear" >/proc/scsi_tgt/groups/GROUP/devices */ p = buffer; - if (p[strlen(p) - 1] == '\n') { + if (p[strlen(p) - 1] == '\n') p[strlen(p) - 1] = '\0'; - } if (!strncasecmp("clear", p, 5)) { action = SCST_PROC_ACTION_CLEAR; } else if (!strncasecmp("add ", p, 4)) { @@ -1503,9 +1490,8 @@ switch (action) { case SCST_PROC_ACTION_ADD: case SCST_PROC_ACTION_DEL: - while (isspace(*p) && *p != '\0') { + while (isspace(*p) && *p != '\0') p++; - } e = p; /* save p */ host = simple_strtoul(p, &p, 0); if (*p == ':') { @@ -1516,9 +1502,8 @@ } else { virt++; p = e; /* restore p */ - while (!isspace(*e) && *e != '\0') { + while (!isspace(*e) && *e != '\0') e++; - } *e = 0; } @@ -1561,17 +1546,14 @@ switch (action) { case SCST_PROC_ACTION_ADD: e++; - while (isspace(*e) && *e != '\0') { + while (isspace(*e) && *e != '\0') e++; - } virt_lun = simple_strtoul(e, &e, 0); - while (isspace(*e) && *e != '\0') { + while (isspace(*e) && *e != '\0') e++; - } - if (!strncasecmp("READ_ONLY", e, 9)) { + if (!strncasecmp("READ_ONLY", e, 9)) read_only = 1; - } list_for_each_entry(acg_dev_tmp, &acg->acg_dev_list, acg_dev_list_entry) { @@ -1667,9 +1649,8 @@ * or echo "clear" >/proc/scsi_tgt/groups/GROUP/names */ p = buffer; - if (p[strlen(p) - 1] == '\n') { + if (p[strlen(p) - 1] == '\n') p[strlen(p) - 1] = '\0'; - } if (!strncasecmp("clear", p, 5)) { action = SCST_PROC_ACTION_CLEAR; } else if (!strncasecmp("add ", p, 4)) { @@ -1687,13 +1668,11 @@ switch (action) { case SCST_PROC_ACTION_ADD: case SCST_PROC_ACTION_DEL: - while (isspace(*p) && *p != '\0') { + while (isspace(*p) && *p != '\0') p++; - } e = p; - while (!isspace(*e) && *e != '\0') { + while (!isspace(*e) && *e != '\0') e++; - } *e = 0; break; } @@ -1976,9 +1955,8 @@ scst_proc_read_tlb(scst_proc_trace_tbl, seq, log_level, &first); - if (tbl) { + if (tbl) scst_proc_read_tlb(tbl, seq, log_level, &first); - } seq_printf(seq, "%s\n", first ? "none" : ""); Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2008-05-22 15:55:23 UTC (rev 385) +++ trunk/scst/src/scst_targ.c 2008-05-22 16:13:36 UTC (rev 386) @@ -201,8 +201,7 @@ #ifdef EXTRACHECKS if (unlikely(in_irq()) && ((pref_context == SCST_CONTEXT_DIRECT) || - (pref_context == SCST_CONTEXT_DIRECT_ATOMIC))) - { + (pref_context == SCST_CONTEXT_DIRECT_ATOMIC))) { PRINT_ERROR("Wrong context %d in IRQ from target %s, use " "SCST_CONTEXT_TASKLET instead\n", pref_context, cmd->tgtt->name); @@ -962,8 +961,7 @@ #ifdef EXTRACHECKS if (in_irq() && ((pref_context == SCST_CONTEXT_DIRECT) || - (pref_context == SCST_CONTEXT_DIRECT_ATOMIC))) - { + (pref_context == SCST_CONTEXT_DIRECT_ATOMIC))) { PRINT_ERROR("Wrong context %d in IRQ from target %s, use " "SCST_CONTEXT_TASKLET instead\n", pref_context, cmd->tgtt->name); @@ -1228,8 +1226,7 @@ #ifdef EXTRACHECKS if ((next_state != SCST_CMD_STATE_PRE_DEV_DONE) && (next_state != SCST_CMD_STATE_PRE_XMIT_RESP) && - (next_state != SCST_CMD_STATE_FINISHED)) - { + (next_state != SCST_CMD_STATE_FINISHED)) { PRINT_ERROR("scst_cmd_done_local() received invalid cmd " "state %d (opcode %d)", next_state, cmd->cdb[0]); scst_set_cmd_error(cmd, @@ -2390,8 +2387,7 @@ state = SCST_CMD_STATE_PRE_XMIT_RESP; if (likely(!scst_is_cmd_local(cmd)) && - likely(cmd->dev->handler->dev_done != NULL)) - { + likely(cmd->dev->handler->dev_done != NULL)) { int rc; TRACE_DBG("Calling dev handler %s dev_done(%p)", cmd->dev->handler->name, cmd); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |