summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-05 11:03:24 +0000
committermav <mav@FreeBSD.org>2015-10-05 11:03:24 +0000
commit46689cc3155fd525c883cde3275c96e1c87b7777 (patch)
tree2b44376c9f3e195ca3d541d50fc0517f73be5cad /sys/cam
parentc5a6a52cc6756f590647fd6f8d45909104f46369 (diff)
downloadFreeBSD-src-46689cc3155fd525c883cde3275c96e1c87b7777.zip
FreeBSD-src-46689cc3155fd525c883cde3275c96e1c87b7777.tar.gz
MFC r288221: Remove some dead code found by Clang analyzer.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ctl/ctl.c205
-rw-r--r--sys/cam/ctl/ctl_backend_block.c4
-rw-r--r--sys/cam/ctl/ctl_backend_ramdisk.c8
-rw-r--r--sys/cam/ctl/ctl_cmd_table.c4
-rw-r--r--sys/cam/ctl/ctl_error.c3
-rw-r--r--sys/cam/ctl/ctl_frontend.c2
-rw-r--r--sys/cam/ctl/ctl_frontend_cam_sim.c1
-rw-r--r--sys/cam/ctl/ctl_frontend_ioctl.c3
-rw-r--r--sys/cam/ctl/ctl_frontend_iscsi.c3
-rw-r--r--sys/cam/ctl/ctl_tpc_local.c4
10 files changed, 17 insertions, 220 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 7e20fce..ade94c1 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -380,7 +380,7 @@ void ctl_shutdown(void);
static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td);
static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td);
static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio);
-static int ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num,
+static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num,
struct ctl_ooa *ooa_hdr,
struct ctl_ooa_entry *kern_entries);
static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
@@ -459,7 +459,7 @@ static int ctl_datamove_remote_xfer(union ctl_io *io, unsigned command,
ctl_ha_dt_cb callback);
static void ctl_datamove_remote_read(union ctl_io *io);
static void ctl_datamove_remote(union ctl_io *io);
-static int ctl_process_done(union ctl_io *io);
+static void ctl_process_done(union ctl_io *io);
static void ctl_lun_thread(void *arg);
static void ctl_thresh_thread(void *arg);
static void ctl_work_thread(void *arg);
@@ -1730,9 +1730,8 @@ ctl_init(void)
{
struct ctl_softc *softc;
void *other_pool;
- int i, error, retval;
+ int i, error;
- retval = 0;
softc = control_softc = malloc(sizeof(*control_softc), M_DEVBUF,
M_WAITOK | M_ZERO);
@@ -2276,14 +2275,11 @@ badjuju:
/*
* Returns 0 for success, errno for failure.
*/
-static int
+static void
ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num,
struct ctl_ooa *ooa_hdr, struct ctl_ooa_entry *kern_entries)
{
union ctl_io *io;
- int retval;
-
- retval = 0;
mtx_lock(&lun->lun_lock);
for (io = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); (io != NULL);
@@ -2323,8 +2319,6 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num,
entry->cmd_flags |= CTL_OOACMD_FLAG_DMA_QUEUED;
}
mtx_unlock(&lun->lun_lock);
-
- return (retval);
}
static void *
@@ -2750,21 +2744,13 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag,
if (ooa_hdr->flags & CTL_OOA_FLAG_ALL_LUNS) {
STAILQ_FOREACH(lun, &softc->lun_list, links) {
- retval = ctl_ioctl_fill_ooa(lun, &cur_fill_num,
- ooa_hdr, entries);
- if (retval != 0)
- break;
- }
- if (retval != 0) {
- mtx_unlock(&softc->ctl_lock);
- free(entries, M_CTL);
- break;
+ ctl_ioctl_fill_ooa(lun, &cur_fill_num,
+ ooa_hdr, entries);
}
} else {
lun = softc->ctl_luns[ooa_hdr->lun_num];
-
- retval = ctl_ioctl_fill_ooa(lun, &cur_fill_num,ooa_hdr,
- entries);
+ ctl_ioctl_fill_ooa(lun, &cur_fill_num, ooa_hdr,
+ entries);
}
mtx_unlock(&softc->ctl_lock);
@@ -4385,9 +4371,6 @@ ctl_init_page_index(struct ctl_lun *lun)
case SMS_VENDOR_SPECIFIC_PAGE:{
switch (page_index->subpage) {
case DBGCNF_SUBPAGE_CODE: {
- struct copan_debugconf_subpage *current_page,
- *saved_page;
-
memcpy(&lun->mode_pages.debugconf_subpage[
CTL_PAGE_CURRENT],
&debugconf_page_default,
@@ -4405,16 +4388,7 @@ ctl_init_page_index(struct ctl_lun *lun)
&debugconf_page_default,
sizeof(debugconf_page_default));
page_index->page_data =
- (uint8_t *)lun->mode_pages.debugconf_subpage;
-
- current_page = (struct copan_debugconf_subpage *)
- (page_index->page_data +
- (page_index->page_len *
- CTL_PAGE_CURRENT));
- saved_page = (struct copan_debugconf_subpage *)
- (page_index->page_data +
- (page_index->page_len *
- CTL_PAGE_SAVED));
+ (uint8_t *)lun->mode_pages.debugconf_subpage;
break;
}
default:
@@ -5250,36 +5224,14 @@ ctl_config_read_done(union ctl_io *io)
int
ctl_scsi_release(struct ctl_scsiio *ctsio)
{
- int length, longid, thirdparty_id, resv_id;
struct ctl_lun *lun;
uint32_t residx;
- length = 0;
- resv_id = 0;
-
CTL_DEBUG_PRINT(("ctl_scsi_release\n"));
residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
- switch (ctsio->cdb[0]) {
- case RELEASE_10: {
- struct scsi_release_10 *cdb;
-
- cdb = (struct scsi_release_10 *)ctsio->cdb;
-
- if (cdb->byte2 & SR10_LONGID)
- longid = 1;
- else
- thirdparty_id = cdb->thirdparty_id;
-
- resv_id = cdb->resv_id;
- length = scsi_2btoul(cdb->length);
- break;
- }
- }
-
-
/*
* XXX KDM right now, we only support LUN reservation. We don't
* support 3rd party reservations, or extent reservations, which
@@ -5287,25 +5239,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsio)
* far, we've got a LUN reservation. Anything else got kicked out
* above. So, according to SPC, ignore the length.
*/
- length = 0;
-
- if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0)
- && (length > 0)) {
- ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK);
- ctsio->kern_data_len = length;
- ctsio->kern_total_len = length;
- ctsio->kern_data_resid = 0;
- ctsio->kern_rel_offset = 0;
- ctsio->kern_sg_entries = 0;
- ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
- ctsio->be_move_done = ctl_config_move_done;
- ctl_datamove((union ctl_io *)ctsio);
-
- return (CTL_RETVAL_COMPLETE);
- }
-
- if (length > 0)
- thirdparty_id = scsi_8btou64(ctsio->kern_data_ptr);
mtx_lock(&lun->lun_lock);
@@ -5321,11 +5254,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsio)
mtx_unlock(&lun->lun_lock);
- if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) {
- free(ctsio->kern_data_ptr, M_CTL);
- ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED;
- }
-
ctl_set_success(ctsio);
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
@@ -5334,41 +5262,14 @@ ctl_scsi_release(struct ctl_scsiio *ctsio)
int
ctl_scsi_reserve(struct ctl_scsiio *ctsio)
{
- int extent, thirdparty, longid;
- int resv_id, length;
- uint64_t thirdparty_id;
struct ctl_lun *lun;
uint32_t residx;
- extent = 0;
- thirdparty = 0;
- longid = 0;
- resv_id = 0;
- length = 0;
- thirdparty_id = 0;
-
CTL_DEBUG_PRINT(("ctl_reserve\n"));
residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
- switch (ctsio->cdb[0]) {
- case RESERVE_10: {
- struct scsi_reserve_10 *cdb;
-
- cdb = (struct scsi_reserve_10 *)ctsio->cdb;
-
- if (cdb->byte2 & SR10_LONGID)
- longid = 1;
- else
- thirdparty_id = cdb->thirdparty_id;
-
- resv_id = cdb->resv_id;
- length = scsi_2btoul(cdb->length);
- break;
- }
- }
-
/*
* XXX KDM right now, we only support LUN reservation. We don't
* support 3rd party reservations, or extent reservations, which
@@ -5376,45 +5277,18 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsio)
* far, we've got a LUN reservation. Anything else got kicked out
* above. So, according to SPC, ignore the length.
*/
- length = 0;
-
- if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0)
- && (length > 0)) {
- ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK);
- ctsio->kern_data_len = length;
- ctsio->kern_total_len = length;
- ctsio->kern_data_resid = 0;
- ctsio->kern_rel_offset = 0;
- ctsio->kern_sg_entries = 0;
- ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
- ctsio->be_move_done = ctl_config_move_done;
- ctl_datamove((union ctl_io *)ctsio);
-
- return (CTL_RETVAL_COMPLETE);
- }
-
- if (length > 0)
- thirdparty_id = scsi_8btou64(ctsio->kern_data_ptr);
mtx_lock(&lun->lun_lock);
if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx != residx)) {
ctl_set_reservation_conflict(ctsio);
goto bailout;
}
-
lun->flags |= CTL_LUN_RESERVED;
lun->res_idx = residx;
-
ctl_set_success(ctsio);
bailout:
mtx_unlock(&lun->lun_lock);
-
- if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) {
- free(ctsio->kern_data_ptr, M_CTL);
- ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED;
- }
-
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
}
@@ -5894,8 +5768,6 @@ ctl_write_same(struct ctl_scsiio *ctsio)
int len, retval;
uint8_t byte2;
- retval = CTL_RETVAL_COMPLETE;
-
CTL_DEBUG_PRINT(("ctl_write_same\n"));
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
@@ -6012,8 +5884,6 @@ ctl_unmap(struct ctl_scsiio *ctsio)
int len, retval;
uint8_t byte2;
- retval = CTL_RETVAL_COMPLETE;
-
CTL_DEBUG_PRINT(("ctl_unmap\n"));
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
@@ -6297,8 +6167,6 @@ ctl_do_mode_select(union ctl_io *io)
ctsio = &io->scsiio;
page_index = NULL;
page_len = 0;
- retval = CTL_RETVAL_COMPLETE;
-
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
if (lun->be_lun->lun_type != T_DIRECT)
@@ -6516,28 +6384,7 @@ ctl_mode_select(struct ctl_scsiio *ctsio)
{
int param_len, pf, sp;
int header_size, bd_len;
- int len_left, len_used;
- struct ctl_page_index *page_index;
- struct ctl_lun *lun;
- int control_dev, page_len;
union ctl_modepage_info *modepage_info;
- int retval;
-
- pf = 0;
- sp = 0;
- page_len = 0;
- len_used = 0;
- len_left = 0;
- retval = 0;
- bd_len = 0;
- page_index = NULL;
-
- lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
-
- if (lun->be_lun->lun_type != T_DIRECT)
- control_dev = 1;
- else
- control_dev = 0;
switch (ctsio->cdb[0]) {
case MODE_SELECT_6: {
@@ -6547,7 +6394,6 @@ ctl_mode_select(struct ctl_scsiio *ctsio)
pf = (cdb->byte2 & SMS_PF) ? 1 : 0;
sp = (cdb->byte2 & SMS_SP) ? 1 : 0;
-
param_len = cdb->length;
header_size = sizeof(struct scsi_mode_header_6);
break;
@@ -6559,7 +6405,6 @@ ctl_mode_select(struct ctl_scsiio *ctsio)
pf = (cdb->byte2 & SMS_PF) ? 1 : 0;
sp = (cdb->byte2 & SMS_SP) ? 1 : 0;
-
param_len = scsi_2btoul(cdb->length);
header_size = sizeof(struct scsi_mode_header_10);
break;
@@ -6568,7 +6413,6 @@ ctl_mode_select(struct ctl_scsiio *ctsio)
ctl_set_invalid_opcode(ctsio);
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
- break; /* NOTREACHED */
}
/*
@@ -6650,14 +6494,9 @@ ctl_mode_select(struct ctl_scsiio *ctsio)
modepage_info = (union ctl_modepage_info *)
ctsio->io_hdr.ctl_private[CTL_PRIV_MODEPAGE].bytes;
-
memset(modepage_info, 0, sizeof(*modepage_info));
-
- len_left = param_len - header_size - bd_len;
- len_used = header_size + bd_len;
-
- modepage_info->header.len_left = len_left;
- modepage_info->header.len_used = len_used;
+ modepage_info->header.len_left = param_len - header_size - bd_len;
+ modepage_info->header.len_used = header_size + bd_len;
return (ctl_do_mode_select((union ctl_io *)ctsio));
}
@@ -8979,8 +8818,6 @@ ctl_read_write(struct ctl_scsiio *ctsio)
CTL_DEBUG_PRINT(("ctl_read_write: command: %#x\n", ctsio->cdb[0]));
flags = 0;
- retval = CTL_RETVAL_COMPLETE;
-
isread = ctsio->cdb[0] == READ_6 || ctsio->cdb[0] == READ_10
|| ctsio->cdb[0] == READ_12 || ctsio->cdb[0] == READ_16;
switch (ctsio->cdb[0]) {
@@ -9157,7 +8994,6 @@ ctl_read_write(struct ctl_scsiio *ctsio)
CTL_DEBUG_PRINT(("ctl_read_write: calling data_submit()\n"));
retval = lun->backend->data_submit((union ctl_io *)ctsio);
-
return (retval);
}
@@ -9197,8 +9033,6 @@ ctl_cnw(struct ctl_scsiio *ctsio)
CTL_DEBUG_PRINT(("ctl_cnw: command: %#x\n", ctsio->cdb[0]));
flags = 0;
- retval = CTL_RETVAL_COMPLETE;
-
switch (ctsio->cdb[0]) {
case COMPARE_AND_WRITE: {
struct scsi_compare_and_write *cdb;
@@ -9289,8 +9123,6 @@ ctl_verify(struct ctl_scsiio *ctsio)
bytchk = 0;
flags = CTL_LLF_FUA;
- retval = CTL_RETVAL_COMPLETE;
-
switch (ctsio->cdb[0]) {
case VERIFY_10: {
struct scsi_verify_10 *cdb;
@@ -10219,7 +10051,6 @@ ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len)
{
struct scsi_vpd_block_limits *bl_ptr;
struct ctl_lun *lun;
- int bs;
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
@@ -10256,7 +10087,6 @@ ctl_inquiry_evpd_block_limits(struct ctl_scsiio *ctsio, int alloc_len)
bl_ptr->max_cmp_write_len = 0xff;
scsi_ulto4b(0xffffffff, bl_ptr->max_txfer_len);
if (lun != NULL) {
- bs = lun->be_lun->blocksize;
scsi_ulto4b(lun->be_lun->opttxferlen, bl_ptr->opt_txfer_len);
if (lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) {
scsi_ulto4b(0xffffffff, bl_ptr->max_unmap_lba_cnt);
@@ -13061,7 +12891,7 @@ ctl_datamove_remote(union ctl_io *io)
}
}
-static int
+static void
ctl_process_done(union ctl_io *io)
{
struct ctl_lun *lun;
@@ -13116,7 +12946,7 @@ ctl_process_done(union ctl_io *io)
if (ctl_debug & CTL_DEBUG_INFO)
ctl_io_error_print(io, NULL);
fe_done(io);
- return (CTL_RETVAL_COMPLETE);
+ return;
default:
panic("ctl_process_done: invalid io type %d\n",
io->io_hdr.io_type);
@@ -13239,7 +13069,6 @@ bailout:
}
fe_done(io);
- return (CTL_RETVAL_COMPLETE);
}
#ifdef CTL_WITH_CA
@@ -13445,8 +13274,6 @@ ctl_work_thread(void *arg)
CTL_DEBUG_PRINT(("ctl_work_thread starting\n"));
for (;;) {
- retval = 0;
-
/*
* We handle the queues in this order:
* - ISC
@@ -13470,7 +13297,7 @@ ctl_work_thread(void *arg)
STAILQ_REMOVE_HEAD(&thr->done_queue, links);
/* clear any blocked commands, call fe_done */
mtx_unlock(&thr->queue_lock);
- retval = ctl_process_done(io);
+ ctl_process_done(io);
continue;
}
io = (union ctl_io *)STAILQ_FIRST(&thr->incoming_queue);
@@ -13503,12 +13330,10 @@ ctl_lun_thread(void *arg)
{
struct ctl_softc *softc = (struct ctl_softc *)arg;
struct ctl_be_lun *be_lun;
- int retval;
CTL_DEBUG_PRINT(("ctl_lun_thread starting\n"));
for (;;) {
- retval = 0;
mtx_lock(&softc->ctl_lock);
be_lun = STAILQ_FIRST(&softc->pending_lun_queue);
if (be_lun != NULL) {
@@ -13529,7 +13354,6 @@ ctl_thresh_thread(void *arg)
{
struct ctl_softc *softc = (struct ctl_softc *)arg;
struct ctl_lun *lun;
- struct ctl_be_lun *be_lun;
struct scsi_da_rw_recovery_page *rwpage;
struct ctl_logical_block_provisioning_page *page;
const char *attr;
@@ -13542,7 +13366,6 @@ ctl_thresh_thread(void *arg)
for (;;) {
mtx_lock(&softc->ctl_lock);
STAILQ_FOREACH(lun, &softc->lun_list, links) {
- be_lun = lun->be_lun;
if ((lun->flags & CTL_LUN_DISABLED) ||
(lun->flags & CTL_LUN_OFFLINE) ||
lun->backend->lun_attr == NULL)
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c
index 1839e47..3e8550a 100644
--- a/sys/cam/ctl/ctl_backend_block.c
+++ b/sys/cam/ctl/ctl_backend_block.c
@@ -1006,13 +1006,10 @@ ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun,
struct ctl_be_block_io *beio)
{
struct bio *bio;
- union ctl_io *io;
struct cdevsw *csw;
struct cdev *dev;
int ref;
- io = beio->io;
-
DPRINTF("entered\n");
/* This can't fail, it's a blocking allocation. */
@@ -1826,7 +1823,6 @@ ctl_be_block_open_file(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req)
off_t ps, pss, po, pos, us, uss, uo, uos;
int error;
- error = 0;
cbe_lun = &be_lun->cbe_lun;
file_data = &be_lun->backend.file;
params = &be_lun->params;
diff --git a/sys/cam/ctl/ctl_backend_ramdisk.c b/sys/cam/ctl/ctl_backend_ramdisk.c
index 8e549c6..0382fde 100644
--- a/sys/cam/ctl/ctl_backend_ramdisk.c
+++ b/sys/cam/ctl/ctl_backend_ramdisk.c
@@ -340,12 +340,10 @@ ctl_backend_ramdisk_continue(union ctl_io *io)
static void
ctl_backend_ramdisk_worker(void *context, int pending)
{
- struct ctl_be_ramdisk_softc *softc;
struct ctl_be_ramdisk_lun *be_lun;
union ctl_io *io;
be_lun = (struct ctl_be_ramdisk_lun *)context;
- softc = be_lun->softc;
mtx_lock(&be_lun->queue_lock);
for (;;) {
@@ -414,7 +412,6 @@ ctl_backend_ramdisk_rm(struct ctl_be_ramdisk_softc *softc,
struct ctl_lun_rm_params *params;
int retval;
- retval = 0;
params = &req->reqdata.rm;
mtx_lock(&softc->lock);
STAILQ_FOREACH(be_lun, &softc->lun_list, links) {
@@ -845,12 +842,9 @@ ctl_backend_ramdisk_lun_config_status(void *be_lun,
static int
ctl_backend_ramdisk_config_write(union ctl_io *io)
{
- struct ctl_be_ramdisk_softc *softc;
int retval;
retval = 0;
- softc = &rd_softc;
-
switch (io->scsiio.cdb[0]) {
case SYNCHRONIZE_CACHE:
case SYNCHRONIZE_CACHE_16:
@@ -875,13 +869,11 @@ ctl_backend_ramdisk_config_write(union ctl_io *io)
case START_STOP_UNIT: {
struct scsi_start_stop_unit *cdb;
struct ctl_be_lun *cbe_lun;
- struct ctl_be_ramdisk_lun *be_lun;
cdb = (struct scsi_start_stop_unit *)io->scsiio.cdb;
cbe_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
CTL_PRIV_BACKEND_LUN].ptr;
- be_lun = (struct ctl_be_ramdisk_lun *)cbe_lun->be_lun;
if (cdb->how & SSS_START)
retval = ctl_start_lun(cbe_lun);
diff --git a/sys/cam/ctl/ctl_cmd_table.c b/sys/cam/ctl/ctl_cmd_table.c
index 0753f28..e66cce4 100644
--- a/sys/cam/ctl/ctl_cmd_table.c
+++ b/sys/cam/ctl/ctl_cmd_table.c
@@ -134,7 +134,7 @@ const struct ctl_cmd_entry ctl_cmd_table_5f[32] =
CTL_FLAG_DATA_OUT |
CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
CTL_LUN_PAT_NONE,
- 10, { 0x01, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
+ 10, { 0, 0, 0, 0, 0, 0, 0, 0, 0x07}},
/* 02 RELEASE */
{ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
@@ -145,7 +145,7 @@ const struct ctl_cmd_entry ctl_cmd_table_5f[32] =
CTL_FLAG_DATA_OUT |
CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
CTL_LUN_PAT_NONE,
- 10, { 0x02, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
+ 10, { 0, 0, 0, 0, 0, 0, 0, 0, 0x07}},
/* 03 CLEAR */
{ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
diff --git a/sys/cam/ctl/ctl_error.c b/sys/cam/ctl/ctl_error.c
index 217bf30..bf3cbf0 100644
--- a/sys/cam/ctl/ctl_error.c
+++ b/sys/cam/ctl/ctl_error.c
@@ -606,11 +606,8 @@ ctl_set_invalid_field(struct ctl_scsiio *ctsio, int sks_valid, int command,
void
ctl_set_invalid_opcode(struct ctl_scsiio *ctsio)
{
- struct scsi_sense_data *sense;
uint8_t sks[3];
- sense = &ctsio->sense_data;
-
sks[0] = SSD_SCS_VALID | SSD_FIELDPTR_CMD;
scsi_ulto2b(0, &sks[1]);
diff --git a/sys/cam/ctl/ctl_frontend.c b/sys/cam/ctl/ctl_frontend.c
index 06e7f22..87ed9d5 100644
--- a/sys/cam/ctl/ctl_frontend.c
+++ b/sys/cam/ctl/ctl_frontend.c
@@ -145,8 +145,6 @@ ctl_port_register(struct ctl_port *port)
int port_num;
int retval;
- retval = 0;
-
KASSERT(softc != NULL, ("CTL is not initialized"));
port->ctl_softc = softc;
diff --git a/sys/cam/ctl/ctl_frontend_cam_sim.c b/sys/cam/ctl/ctl_frontend_cam_sim.c
index 5423a17..fb862c6 100644
--- a/sys/cam/ctl/ctl_frontend_cam_sim.c
+++ b/sys/cam/ctl/ctl_frontend_cam_sim.c
@@ -136,7 +136,6 @@ cfcs_init(void)
int retval;
softc = &cfcs_softc;
- retval = 0;
bzero(softc, sizeof(*softc));
mtx_init(&softc->lock, "ctl2cam", NULL, MTX_DEF);
port = &softc->port;
diff --git a/sys/cam/ctl/ctl_frontend_ioctl.c b/sys/cam/ctl/ctl_frontend_ioctl.c
index d58fc6a..0f2e7a815 100644
--- a/sys/cam/ctl/ctl_frontend_ioctl.c
+++ b/sys/cam/ctl/ctl_frontend_ioctl.c
@@ -307,10 +307,7 @@ cfi_submit_wait(union ctl_io *io)
ctl_fe_ioctl_state last_state;
int done, retval;
- retval = 0;
-
bzero(&params, sizeof(params));
-
mtx_init(&params.ioctl_mtx, "ctliocmtx", NULL, MTX_DEF);
cv_init(&params.sem, "ctlioccv");
params.state = CTL_IOCTL_INPROG;
diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index e3b7c2d..778a6ba 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -458,6 +458,7 @@ cfiscsi_decode_lun(uint64_t encoded)
break;
}
result = (lun[1] << 16) + (lun[2] << 8) + lun[3];
+ break;
default:
CFISCSI_WARN("unsupported LUN format 0x%jx",
(uintmax_t)encoded);
@@ -1331,10 +1332,8 @@ int
cfiscsi_init(void)
{
struct cfiscsi_softc *softc;
- int retval;
softc = &cfiscsi_softc;
- retval = 0;
bzero(softc, sizeof(*softc));
mtx_init(&softc->lock, "cfiscsi", NULL, MTX_DEF);
diff --git a/sys/cam/ctl/ctl_tpc_local.c b/sys/cam/ctl/ctl_tpc_local.c
index 5c566dd..4f368f9 100644
--- a/sys/cam/ctl/ctl_tpc_local.c
+++ b/sys/cam/ctl/ctl_tpc_local.c
@@ -142,10 +142,6 @@ tpcl_datamove(union ctl_io *io)
struct ctl_scsiio *ctsio;
int i, j;
- ext_sg_start = 0;
- ext_offset = 0;
- ext_sglist = NULL;
-
CTL_DEBUG_PRINT(("%s\n", __func__));
ctsio = &io->scsiio;
OpenPOWER on IntegriCloud