From: <vl...@us...> - 2007-06-27 16:19:45
|
Revision: 138 http://svn.sourceforge.net/scst/?rev=138&view=rev Author: vlnb Date: 2007-06-27 09:19:38 -0700 (Wed, 27 Jun 2007) Log Message: ----------- Patch from Alessandro Premoli fixes all the warnings of scst on 64-bit platforms Modified Paths: -------------- trunk/scst/README trunk/scst/include/scst_debug.h trunk/scst/src/dev_handlers/scst_dev_handler.h trunk/scst/src/dev_handlers/scst_user.c trunk/scst/src/scst.c trunk/scst/src/scst_lib.c trunk/scst/src/scst_mem.c trunk/scst/src/scst_proc.c trunk/scst/src/scst_targ.c Modified: trunk/scst/README =================================================================== --- trunk/scst/README 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/README 2007-06-27 16:19:38 UTC (rev 138) @@ -621,4 +621,6 @@ * Michael G. Byrnes <mic...@hp...> for fixes. + * Alessandro Premoli <a.p...@an...> for fixes + Vladislav Bolkhovitin <vs...@vl...>, http://scst.sourceforge.net Modified: trunk/scst/include/scst_debug.h =================================================================== --- trunk/scst/include/scst_debug.h 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/include/scst_debug.h 2007-06-27 16:19:38 UTC (rev 138) @@ -21,6 +21,7 @@ #define __SCST_DEBUG_H #include <linux/autoconf.h> /* for CONFIG_* */ +#include <asm/bug.h> /* for WARN_ON_ONCE */ #if !defined(EXTRACHECKS) && defined(CONFIG_SCSI_TARGET_EXTRACHECKS) #define EXTRACHECKS Modified: trunk/scst/src/dev_handlers/scst_dev_handler.h =================================================================== --- trunk/scst/src/dev_handlers/scst_dev_handler.h 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/src/dev_handlers/scst_dev_handler.h 2007-06-27 16:19:38 UTC (rev 138) @@ -42,7 +42,7 @@ return res; } -static int scst_dev_handler_proc_log_entry_write(struct file *file, +static ssize_t scst_dev_handler_proc_log_entry_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { int res = 0; Modified: trunk/scst/src/dev_handlers/scst_user.c =================================================================== --- trunk/scst/src/dev_handlers/scst_user.c 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/src/dev_handlers/scst_user.c 2007-06-27 16:19:38 UTC (rev 138) @@ -26,7 +26,7 @@ #include "scst_user.h" #include "scst_dev_handler.h" -#ifndef CONFIG_NOHIGHMEM +#if !defined(CONFIG_NOHIGHMEM) && !defined(CONFIG_64BIT) #warning HIGHMEM kernel configurations are not supported. Consider \ changing VMSPLIT option or using 64-bit configuration. #endif @@ -2927,7 +2927,7 @@ TRACE_ENTRY(); -#ifndef CONFIG_NOHIGHMEM +#if !defined(CONFIG_NOHIGHMEM) && !defined(CONFIG_64BIT) PRINT_ERROR_PR("%s", "HIGHMEM kernel configurations are not supported. " "Consider changing VMSPLIT option or using 64-bit " "configuration."); Modified: trunk/scst/src/scst.c =================================================================== --- trunk/scst/src/scst.c 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/src/scst.c 2007-06-27 16:19:38 UTC (rev 138) @@ -32,7 +32,7 @@ #include "scst_priv.h" #include "scst_mem.h" -#ifndef CONFIG_NOHIGHMEM +#if !defined(CONFIG_NOHIGHMEM) && !defined(CONFIG_64BIT) #warning HIGHMEM kernel configurations are supported, but not recommended. \ Consider changing VMSPLIT option or using 64-bit configuration instead. #endif Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/src/scst_lib.c 2007-06-27 16:19:38 UTC (rev 138) @@ -1622,7 +1622,7 @@ op = *cdb_p; /* get clear opcode */ - TRACE_DBG("opcode=%02x, cdblen=%d bytes, tblsize=%zd, " + TRACE_DBG("opcode=%02x, cdblen=%d bytes, tblsize=%d, " "dev_type=%d", op, SCST_GET_CDB_LEN(op), SCST_CDB_TBL_SIZE, dev_type); @@ -1854,7 +1854,7 @@ cmd->bufflen = info_cdb->transfer_len << get_block_shift(cmd); } - TRACE_DBG("res %d, bufflen %zd, data_len %zd, direct %d", + TRACE_DBG("res %d, bufflen %d, data_len %d, direct %d", res, cmd->bufflen, cmd->data_len, cmd->data_direction); TRACE_EXIT_RES(res); @@ -1915,7 +1915,7 @@ if (info_cdb->flags & SCST_TRANSFER_LEN_TYPE_FIXED) cmd->bufflen = info_cdb->transfer_len << get_block_shift(cmd); - TRACE_DBG("res %d bufflen %zd direct %d", + TRACE_DBG("res %d bufflen %d direct %d", res, cmd->bufflen, cmd->data_direction); TRACE_EXIT(); @@ -1976,7 +1976,7 @@ if (info_cdb->flags & SCST_TRANSFER_LEN_TYPE_FIXED) cmd->bufflen = info_cdb->transfer_len << get_block_shift(cmd); - TRACE_DBG("res %d bufflen %zd direct %d", + TRACE_DBG("res %d bufflen %d direct %d", res, cmd->bufflen, cmd->data_direction); TRACE_EXIT_RES(res); @@ -2043,7 +2043,7 @@ break; } #endif - TRACE_DBG("res %d bufflen %zd direct %d", + TRACE_DBG("res %d bufflen %d direct %d", res, cmd->bufflen, cmd->data_direction); TRACE_EXIT(); Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/src/scst_mem.c 2007-06-27 16:19:38 UTC (rev 138) @@ -556,7 +556,7 @@ out: TRACE_MEM("Alloced sg %p (count %d)", res, *count); - TRACE_EXIT_HRES((int)res); + TRACE_EXIT_HRES(res); return res; out_free: Modified: trunk/scst/src/scst_proc.c =================================================================== --- trunk/scst/src/scst_proc.c 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/src/scst_proc.c 2007-06-27 16:19:38 UTC (rev 138) @@ -351,7 +351,7 @@ return res; } -static int scst_proc_scsi_tgt_gen_write_log(struct file *file, const char __user *buf, +static ssize_t scst_proc_scsi_tgt_gen_write_log(struct file *file, const char __user *buf, size_t length, loff_t *off) { int res; @@ -736,7 +736,7 @@ TRACE_EXIT(); } -static int scst_proc_threads_write(struct file *file, const char __user *buf, +static ssize_t scst_proc_threads_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { int res = length; @@ -883,7 +883,7 @@ return; } -static int scst_proc_scsi_tgt_write(struct file *file, const char __user *buf, +static ssize_t scst_proc_scsi_tgt_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { struct scst_tgt *vtt = (struct scst_tgt *)PDE(file->f_dentry->d_inode)->data; @@ -1023,7 +1023,7 @@ return; } -static int scst_proc_scsi_dev_handler_write(struct file *file, const char __user *buf, +static ssize_t scst_proc_scsi_dev_handler_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { struct scst_dev_type *dev_type = (struct scst_dev_type *)PDE(file->f_dentry->d_inode)->data; @@ -1083,7 +1083,7 @@ return res; } -static int scst_proc_scsi_tgt_gen_write(struct file *file, const char __user *buf, +static ssize_t scst_proc_scsi_tgt_gen_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { int res = length, rc = 0, action; @@ -1210,7 +1210,7 @@ { int res = 0; char *p = buf, *e, *ee; - unsigned int host, channel = 0, id = 0, lun = 0; + unsigned long host, channel = 0, id = 0, lun = 0; struct scst_device *d, *dev = NULL; struct scst_dev_type *dt, *handler = NULL; @@ -1247,7 +1247,7 @@ } *ee = '\0'; - TRACE_DBG("Dev %d:%d:%d:%d, handler %s", host, channel, id, lun, e); + TRACE_DBG("Dev %ld:%ld:%ld:%ld, handler %s", host, channel, id, lun, e); list_for_each_entry(d, &scst_dev_list, dev_list_entry) { if ((d->virt_id == 0) && @@ -1257,14 +1257,14 @@ d->scsi_dev->lun == lun) { dev = d; - TRACE_DBG("Dev %p (%d:%d:%d:%d) found", + TRACE_DBG("Dev %p (%ld:%ld:%ld:%ld) found", dev, host, channel, id, lun); break; } } if (dev == NULL) { - PRINT_ERROR_PR("Device %d:%d:%d:%d not found", + PRINT_ERROR_PR("Device %ld:%ld:%ld:%ld not found", host, channel, id, lun); res = -EINVAL; goto out; @@ -1305,7 +1305,7 @@ goto out; } -static int scst_proc_groups_devices_write(struct file *file, const char __user *buf, +static ssize_t scst_proc_groups_devices_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { int res = length, action, virt = 0, rc, read_only = 0; @@ -1499,7 +1499,7 @@ return res; } -static int scst_proc_groups_names_write(struct file *file, const char __user *buf, +static ssize_t scst_proc_groups_names_write(struct file *file, const char __user *buf, size_t length, loff_t *off) { int res = length, action; Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2007-06-27 10:41:44 UTC (rev 137) +++ trunk/scst/src/scst_targ.c 2007-06-27 16:19:38 UTC (rev 138) @@ -402,7 +402,7 @@ if (scst_cmd_is_expected_set(cmd)) { if (cmd->expected_transfer_len < cmd->bufflen) { TRACE(TRACE_SCSI, "cmd->expected_transfer_len(%d) < " - "cmd->bufflen(%zd), using expected_transfer_len " + "cmd->bufflen(%d), using expected_transfer_len " "instead", cmd->expected_transfer_len, cmd->bufflen); cmd->bufflen = cmd->expected_transfer_len; @@ -433,7 +433,7 @@ { PRINT_ERROR_PR("Dev handler %s parse() returned " "invalid cmd data_direction %d, " - "bufflen %zd or state %d (opcode 0x%x)", + "bufflen %d or state %d (opcode 0x%x)", dev->handler->name, cmd->data_direction, cmd->bufflen, state, cmd->cdb[0]); @@ -680,7 +680,7 @@ out_no_space: TRACE(TRACE_OUT_OF_MEM, "Unable to allocate or build requested buffer " - "(size %zd), sending BUSY or QUEUE FULL status", cmd->bufflen); + "(size %d), sending BUSY or QUEUE FULL status", cmd->bufflen); scst_low_cur_max_cmd_mem(); scst_set_busy(cmd); cmd->state = SCST_CMD_STATE_DEV_DONE; @@ -1765,7 +1765,7 @@ /* Optimized for lockless fast path */ - TRACE_SN("Slot %d, *cur_sn_slot %d", slot - tgt_dev->sn_slots, + TRACE_SN("Slot %zd, *cur_sn_slot %d", slot - tgt_dev->sn_slots, atomic_read(slot)); if (!atomic_dec_and_test(slot)) @@ -2521,7 +2521,7 @@ ARRAY_SIZE(tgt_dev->sn_slots)) tgt_dev->cur_sn_slot = tgt_dev->sn_slots; } while(atomic_read(tgt_dev->cur_sn_slot) != 0); - TRACE_SN("New cur SN slot %d", + TRACE_SN("New cur SN slot %zd", tgt_dev->cur_sn_slot-tgt_dev->sn_slots); } else tgt_dev->num_free_sn_slots++; @@ -2550,7 +2550,7 @@ TRACE_SN("cmd(%p)->sn: %ld (tgt_dev %p, *cur_sn_slot %d, " "num_free_sn_slots %d, prev_cmd_ordered %ld, " - "cur_sn_slot %d)", cmd, cmd->sn, tgt_dev, + "cur_sn_slot %zd)", cmd, cmd->sn, tgt_dev, atomic_read(tgt_dev->cur_sn_slot), tgt_dev->num_free_sn_slots, tgt_dev->prev_cmd_ordered, tgt_dev->cur_sn_slot-tgt_dev->sn_slots); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |