qla2xxx: Remove set-but-not-used variables
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 9 Jul 2015 14:23:26 +0000 (07:23 -0700)
committerJames Bottomley <JBottomley@Odin.com>
Wed, 26 Aug 2015 17:34:49 +0000 (10:34 -0700)
Detected these variables by building with W=1.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
14 files changed:
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_bsg.c
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_mid.c
drivers/scsi/qla2xxx/qla_mr.c
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_nx2.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/qla_tmpl.c

index 82b92c4..741d6e0 100644 (file)
@@ -884,7 +884,6 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj,
            struct device, kobj)));
        struct qla_hw_data *ha = vha->hw;
        int rval;
-       uint16_t actual_size;
 
        if (!capable(CAP_SYS_ADMIN) || off != 0 || count > DCBX_TLV_DATA_SIZE)
                return 0;
@@ -901,7 +900,6 @@ qla2x00_sysfs_read_dcbx_tlv(struct file *filp, struct kobject *kobj,
        }
 
 do_read:
-       actual_size = 0;
        memset(ha->dcbx_tlv, 0, DCBX_TLV_DATA_SIZE);
 
        rval = qla2x00_get_dcbx_params(vha, ha->dcbx_tlv_dma,
index e1c2a57..c26acde 100644 (file)
@@ -1733,7 +1733,6 @@ qla24xx_process_bidir_cmd(struct fc_bsg_job *bsg_job)
        struct Scsi_Host *host = bsg_job->shost;
        scsi_qla_host_t *vha = shost_priv(host);
        struct qla_hw_data *ha = vha->hw;
-       uint16_t thread_id;
        uint32_t rval = EXT_STATUS_OK;
        uint16_t req_sg_cnt = 0;
        uint16_t rsp_sg_cnt = 0;
@@ -1790,8 +1789,6 @@ qla24xx_process_bidir_cmd(struct fc_bsg_job *bsg_job)
                goto done;
        }
 
-       thread_id = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
-
        mutex_lock(&ha->selflogin_lock);
        if (vha->self_login_loop_id == 0) {
                /* Initialize all required  fields of fcport */
@@ -2174,7 +2171,6 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
 {
        int ret = -EINVAL;
        struct fc_rport *rport;
-       fc_port_t *fcport = NULL;
        struct Scsi_Host *host;
        scsi_qla_host_t *vha;
 
@@ -2183,7 +2179,6 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
 
        if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) {
                rport = bsg_job->rport;
-               fcport = *(fc_port_t **) rport->dd_data;
                host = rport_to_shost(rport);
                vha = shost_priv(host);
        } else {
index 0e6ee3c..121ed5b 100644 (file)
@@ -117,7 +117,7 @@ qla27xx_dump_mpi_ram(struct qla_hw_data *ha, uint32_t addr, uint32_t *ram,
 {
        int rval;
        uint32_t cnt, stat, timer, dwords, idx;
-       uint16_t mb0, mb1;
+       uint16_t mb0;
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
        dma_addr_t dump_dma = ha->gid_list_dma;
        uint32_t *dump = (uint32_t *)ha->gid_list;
@@ -161,7 +161,7 @@ qla27xx_dump_mpi_ram(struct qla_hw_data *ha, uint32_t addr, uint32_t *ram,
                                            &ha->mbx_cmd_flags);
 
                                        mb0 = RD_REG_WORD(&reg->mailbox0);
-                                       mb1 = RD_REG_WORD(&reg->mailbox1);
+                                       RD_REG_WORD(&reg->mailbox1);
 
                                        WRT_REG_DWORD(&reg->hccr,
                                            HCCRX_CLR_RISC_INT);
@@ -1039,7 +1039,6 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 {
        int             rval;
        uint32_t        cnt;
-       uint32_t        risc_address;
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
        uint32_t __iomem *dmp_reg;
@@ -1047,7 +1046,6 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint16_t __iomem *mbx_reg;
        unsigned long   flags;
        struct qla24xx_fw_dump *fw;
-       uint32_t        ext_mem_cnt;
        void            *nxt;
        void            *nxt_chain;
        uint32_t        *last_chain = NULL;
@@ -1056,7 +1054,6 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        if (IS_P3P_TYPE(ha))
                return;
 
-       risc_address = ext_mem_cnt = 0;
        flags = 0;
        ha->fw_dump_cap_flags = 0;
 
@@ -1294,7 +1291,6 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 {
        int             rval;
        uint32_t        cnt;
-       uint32_t        risc_address;
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
        uint32_t __iomem *dmp_reg;
@@ -1302,12 +1298,10 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint16_t __iomem *mbx_reg;
        unsigned long   flags;
        struct qla25xx_fw_dump *fw;
-       uint32_t        ext_mem_cnt;
        void            *nxt, *nxt_chain;
        uint32_t        *last_chain = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       risc_address = ext_mem_cnt = 0;
        flags = 0;
        ha->fw_dump_cap_flags = 0;
 
@@ -1613,7 +1607,6 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 {
        int             rval;
        uint32_t        cnt;
-       uint32_t        risc_address;
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
        uint32_t __iomem *dmp_reg;
@@ -1621,12 +1614,10 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint16_t __iomem *mbx_reg;
        unsigned long   flags;
        struct qla81xx_fw_dump *fw;
-       uint32_t        ext_mem_cnt;
        void            *nxt, *nxt_chain;
        uint32_t        *last_chain = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       risc_address = ext_mem_cnt = 0;
        flags = 0;
        ha->fw_dump_cap_flags = 0;
 
@@ -1933,8 +1924,7 @@ void
 qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 {
        int             rval;
-       uint32_t        cnt, reg_data;
-       uint32_t        risc_address;
+       uint32_t        cnt;
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
        uint32_t __iomem *dmp_reg;
@@ -1942,12 +1932,10 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
        uint16_t __iomem *mbx_reg;
        unsigned long   flags;
        struct qla83xx_fw_dump *fw;
-       uint32_t        ext_mem_cnt;
        void            *nxt, *nxt_chain;
        uint32_t        *last_chain = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
 
-       risc_address = ext_mem_cnt = 0;
        flags = 0;
        ha->fw_dump_cap_flags = 0;
 
@@ -1979,16 +1967,16 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
 
        WRT_REG_DWORD(&reg->iobase_addr, 0x6000);
        dmp_reg = &reg->iobase_window;
-       reg_data = RD_REG_DWORD(dmp_reg);
+       RD_REG_DWORD(dmp_reg);
        WRT_REG_DWORD(dmp_reg, 0);
 
        dmp_reg = &reg->unused_4_1[0];
-       reg_data = RD_REG_DWORD(dmp_reg);
+       RD_REG_DWORD(dmp_reg);
        WRT_REG_DWORD(dmp_reg, 0);
 
        WRT_REG_DWORD(&reg->iobase_addr, 0x6010);
        dmp_reg = &reg->unused_4_1[2];
-       reg_data = RD_REG_DWORD(dmp_reg);
+       RD_REG_DWORD(dmp_reg);
        WRT_REG_DWORD(dmp_reg, 0);
 
        /* select PCR and disable ecc checking and correction */
index 6640131..f4a64a4 100644 (file)
@@ -1127,7 +1127,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha)
        unsigned long flags = 0;
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
-       uint32_t cnt, d2;
+       uint32_t cnt;
        uint16_t wd;
        static int abts_cnt; /* ISP abort retry counts */
        int rval = QLA_SUCCESS;
@@ -1159,7 +1159,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha)
        udelay(100);
 
        /* Wait for firmware to complete NVRAM accesses. */
-       d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0);
+       RD_REG_WORD(&reg->mailbox0);
        for (cnt = 10000; RD_REG_WORD(&reg->mailbox0) != 0 &&
            rval == QLA_SUCCESS; cnt--) {
                barrier();
@@ -1178,7 +1178,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha)
            RD_REG_DWORD(&reg->mailbox0));
 
        /* Wait for soft-reset to complete. */
-       d2 = RD_REG_DWORD(&reg->ctrl_status);
+       RD_REG_DWORD(&reg->ctrl_status);
        for (cnt = 0; cnt < 6000000; cnt++) {
                barrier();
                if ((RD_REG_DWORD(&reg->ctrl_status) &
@@ -1221,7 +1221,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha)
        WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_RESET);
        RD_REG_DWORD(&reg->hccr);
 
-       d2 = (uint32_t) RD_REG_WORD(&reg->mailbox0);
+       RD_REG_WORD(&reg->mailbox0);
        for (cnt = 6000000; RD_REG_WORD(&reg->mailbox0) != 0 &&
            rval == QLA_SUCCESS; cnt--) {
                barrier();
@@ -3856,12 +3856,10 @@ qla2x00_fabric_dev_login(scsi_qla_host_t *vha, fc_port_t *fcport,
     uint16_t *next_loopid)
 {
        int     rval;
-       int     retry;
        uint8_t opts;
        struct qla_hw_data *ha = vha->hw;
 
        rval = QLA_SUCCESS;
-       retry = 0;
 
        if (IS_ALOGIO_CAPABLE(ha)) {
                if (fcport->flags & FCF_ASYNC_SENT)
index d58ffb7..e95162e 100644 (file)
@@ -310,7 +310,7 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
 int
 qla2x00_start_scsi(srb_t *sp)
 {
-       int             ret, nseg;
+       int             nseg;
        unsigned long   flags;
        scsi_qla_host_t *vha;
        struct scsi_cmnd *cmd;
@@ -327,7 +327,6 @@ qla2x00_start_scsi(srb_t *sp)
        struct rsp_que *rsp;
 
        /* Setup device pointers. */
-       ret = 0;
        vha = sp->fcport->vha;
        ha = vha->hw;
        reg = &ha->iobase->isp;
@@ -710,7 +709,6 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
        struct scsi_cmnd *cmd;
        struct scatterlist *sg;
        int i;
-       struct req_que *req;
 
        cmd = GET_CMD_SP(sp);
 
@@ -725,7 +723,6 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
        }
 
        vha = sp->fcport->vha;
-       req = vha->req;
 
        /* Set transfer direction */
        if (cmd->sc_data_direction == DMA_TO_DEVICE) {
@@ -933,11 +930,9 @@ qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *ha, srb_t *sp,
        dma_addr_t      sle_dma;
        uint32_t        sle_dma_len, tot_prot_dma_len = 0;
        struct scsi_cmnd *cmd;
-       struct scsi_qla_host *vha;
 
        memset(&sgx, 0, sizeof(struct qla2_sgx));
        if (sp) {
-               vha = sp->fcport->vha;
                cmd = GET_CMD_SP(sp);
                prot_int = cmd->device->sector_size;
 
@@ -947,7 +942,6 @@ qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *ha, srb_t *sp,
 
                sg_prot = scsi_prot_sglist(cmd);
        } else if (tc) {
-               vha = tc->vha;
                prot_int      = tc->blk_sz;
                sgx.tot_bytes = tc->bufflen;
                sgx.cur_sg    = tc->sg;
@@ -1047,15 +1041,12 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd,
        int     i;
        uint16_t        used_dsds = tot_dsds;
        struct scsi_cmnd *cmd;
-       struct scsi_qla_host *vha;
 
        if (sp) {
                cmd = GET_CMD_SP(sp);
                sgl = scsi_sglist(cmd);
-               vha = sp->fcport->vha;
        } else if (tc) {
                sgl = tc->sg;
-               vha = tc->vha;
        } else {
                BUG();
                return 1;
@@ -1231,7 +1222,6 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
        uint32_t                *cur_dsd, *fcp_dl;
        scsi_qla_host_t         *vha;
        struct scsi_cmnd        *cmd;
-       int                     sgc;
        uint32_t                total_bytes = 0;
        uint32_t                data_bytes;
        uint32_t                dif_bytes;
@@ -1247,7 +1237,6 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
 
        cmd = GET_CMD_SP(sp);
 
-       sgc = 0;
        /* Update entry type to indicate Command Type CRC_2 IOCB */
        *((uint32_t *)(&cmd_pkt->entry_type)) =
            __constant_cpu_to_le32(COMMAND_TYPE_CRC_2);
@@ -1442,7 +1431,7 @@ crc_queuing_error:
 int
 qla24xx_start_scsi(srb_t *sp)
 {
-       int             ret, nseg;
+       int             nseg;
        unsigned long   flags;
        uint32_t        *clr_ptr;
        uint32_t        index;
@@ -1458,8 +1447,6 @@ qla24xx_start_scsi(srb_t *sp)
        struct qla_hw_data *ha = vha->hw;
 
        /* Setup device pointers. */
-       ret = 0;
-
        qla25xx_set_que(sp, &rsp);
        req = vha->req;
 
@@ -2088,7 +2075,6 @@ qla2x00_ct_iocb(srb_t *sp, ms_iocb_entry_t *ct_iocb)
        struct qla_hw_data *ha = vha->hw;
        struct fc_bsg_job *bsg_job = sp->u.bsg_job;
        int loop_iterartion = 0;
-       int cont_iocb_prsnt = 0;
        int entry_count = 1;
 
        memset(ct_iocb, 0, sizeof(ms_iocb_entry_t));
@@ -2139,7 +2125,6 @@ qla2x00_ct_iocb(srb_t *sp, ms_iocb_entry_t *ct_iocb)
                            vha->hw->req_q_map[0]);
                        cur_dsd = (uint32_t *) cont_pkt->dseg_0_address;
                        avail_dsds = 5;
-                       cont_iocb_prsnt = 1;
                        entry_count++;
                }
 
@@ -2167,7 +2152,6 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
        struct qla_hw_data *ha = vha->hw;
        struct fc_bsg_job *bsg_job = sp->u.bsg_job;
        int loop_iterartion = 0;
-       int cont_iocb_prsnt = 0;
        int entry_count = 1;
 
        ct_iocb->entry_type = CT_IOCB_TYPE;
@@ -2214,7 +2198,6 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
                            ha->req_q_map[0]);
                        cur_dsd = (uint32_t *) cont_pkt->dseg_0_address;
                        avail_dsds = 5;
-                       cont_iocb_prsnt = 1;
                        entry_count++;
                }
 
@@ -2237,7 +2220,7 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb)
 int
 qla82xx_start_scsi(srb_t *sp)
 {
-       int             ret, nseg;
+       int             nseg;
        unsigned long   flags;
        struct scsi_cmnd *cmd;
        uint32_t        *clr_ptr;
@@ -2257,7 +2240,6 @@ qla82xx_start_scsi(srb_t *sp)
        struct rsp_que *rsp = NULL;
 
        /* Setup device pointers. */
-       ret = 0;
        reg = &ha->iobase->isp82;
        cmd = GET_CMD_SP(sp);
        req = vha->req;
index dcfa465..a526c38 100644 (file)
@@ -575,7 +575,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
        struct device_reg_2xxx __iomem *reg = &ha->iobase->isp;
        struct device_reg_24xx __iomem *reg24 = &ha->iobase->isp24;
        struct device_reg_82xx __iomem *reg82 = &ha->iobase->isp82;
-       uint32_t        rscn_entry, host_pid, tmp_pid;
+       uint32_t        rscn_entry, host_pid;
        unsigned long   flags;
        fc_port_t       *fcport = NULL;
 
@@ -998,7 +998,6 @@ skip_rio:
                list_for_each_entry(fcport, &vha->vp_fcports, list) {
                        if (atomic_read(&fcport->state) != FCS_ONLINE)
                                continue;
-                       tmp_pid = fcport->d_id.b24;
                        if (fcport->d_id.b24 == rscn_entry) {
                                qla2x00_mark_device_lost(vha, fcport, 0, 0);
                                break;
index 02b1c1c..65c2dc1 100644 (file)
@@ -1865,7 +1865,6 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
        uint32_t        iop[2];
        struct qla_hw_data *ha = vha->hw;
        struct req_que *req;
-       struct rsp_que *rsp;
 
        ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1061,
            "Entered %s.\n", __func__);
@@ -1874,7 +1873,6 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
                req = ha->req_q_map[0];
        else
                req = vha->req;
-       rsp = req->rsp;
 
        lg = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &lg_dma);
        if (lg == NULL) {
@@ -2142,7 +2140,6 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
        dma_addr_t      lg_dma;
        struct qla_hw_data *ha = vha->hw;
        struct req_que *req;
-       struct rsp_que *rsp;
 
        ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x106d,
            "Entered %s.\n", __func__);
@@ -2159,7 +2156,6 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,
                req = ha->req_q_map[0];
        else
                req = vha->req;
-       rsp = req->rsp;
        lg->entry_type = LOGINOUT_PORT_IOCB_TYPE;
        lg->entry_count = 1;
        lg->handle = MAKE_HANDLE(req->id, lg->handle);
index cc94192..c5dd594 100644 (file)
@@ -371,7 +371,6 @@ qla2x00_do_dpc_vp(scsi_qla_host_t *vha)
 void
 qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
 {
-       int ret;
        struct qla_hw_data *ha = vha->hw;
        scsi_qla_host_t *vp;
        unsigned long flags = 0;
@@ -392,7 +391,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
                        atomic_inc(&vp->vref_count);
                        spin_unlock_irqrestore(&ha->vport_slock, flags);
 
-                       ret = qla2x00_do_dpc_vp(vp);
+                       qla2x00_do_dpc_vp(vp);
 
                        spin_lock_irqsave(&ha->vport_slock, flags);
                        atomic_dec(&vp->vref_count);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge