diff options
Diffstat (limited to 'drivers/scsi/snic/snic_scsi.c')
| -rw-r--r-- | drivers/scsi/snic/snic_scsi.c | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/drivers/scsi/snic/snic_scsi.c b/drivers/scsi/snic/snic_scsi.c index 5f17666f3e1d..84973f0f771e 100644 --- a/drivers/scsi/snic/snic_scsi.c +++ b/drivers/scsi/snic/snic_scsi.c @@ -1,19 +1,5 @@ -/* - * Copyright 2014 Cisco Systems, Inc. All rights reserved. - * - * This program is free software; you may redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright 2014 Cisco Systems, Inc. All rights reserved. #include <linux/mempool.h> #include <linux/errno.h> @@ -501,7 +487,6 @@ snic_process_icmnd_cmpl_status(struct snic *snic, struct scsi_cmnd *sc) { u8 scsi_stat = icmnd_cmpl->scsi_status; - u64 xfer_len = 0; int ret = 0; /* Mark the IO as complete */ @@ -510,15 +495,11 @@ snic_process_icmnd_cmpl_status(struct snic *snic, if (likely(cmpl_stat == SNIC_STAT_IO_SUCCESS)) { sc->result = (DID_OK << 16) | scsi_stat; - xfer_len = scsi_bufflen(sc); - /* Update SCSI Cmd with resid value */ scsi_set_resid(sc, le32_to_cpu(icmnd_cmpl->resid)); - if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN) { - xfer_len -= le32_to_cpu(icmnd_cmpl->resid); + if (icmnd_cmpl->flags & SNIC_ICMND_CMPL_UNDR_RUN) atomic64_inc(&snic->s_stats.misc.io_under_run); - } if (icmnd_cmpl->scsi_status == SAM_STAT_TASK_SET_FULL) atomic64_inc(&snic->s_stats.misc.qfull); @@ -1869,7 +1850,7 @@ snic_dr_clean_pending_req(struct snic *snic, struct scsi_cmnd *lr_sc) { struct scsi_device *lr_sdev = lr_sc->device; u32 tag = 0; - int ret = FAILED; + int ret; for (tag = 0; tag < snic->max_tag_id; tag++) { if (tag == snic_cmd_tag(lr_sc)) @@ -1878,7 +1859,6 @@ snic_dr_clean_pending_req(struct snic *snic, struct scsi_cmnd *lr_sc) ret = snic_dr_clean_single_req(snic, tag, lr_sdev); if (ret) { SNIC_HOST_ERR(snic->shost, "clean_err:tag = %d\n", tag); - goto clean_err; } } @@ -1886,24 +1866,19 @@ snic_dr_clean_pending_req(struct snic *snic, struct scsi_cmnd *lr_sc) schedule_timeout(msecs_to_jiffies(100)); /* Walk through all the cmds and check abts status. */ - if (snic_is_abts_pending(snic, lr_sc)) { - ret = FAILED; - + if (snic_is_abts_pending(snic, lr_sc)) goto clean_err; - } - ret = 0; SNIC_SCSI_DBG(snic->shost, "clean_pending_req: Success.\n"); - return ret; + return 0; clean_err: - ret = FAILED; SNIC_HOST_ERR(snic->shost, "Failed to Clean Pending IOs on %s device.\n", dev_name(&lr_sdev->sdev_gendev)); - return ret; + return FAILED; } /* end of snic_dr_clean_pending_req */ |
