qla2xxx: Fix various warnings reported by static source code analysis tools
Subsystems (2)
v3 cover qla2xxx: Fix various warnings reported by static source code analysis tools
This patch series addresses several warnings reported by static source code analysis tools for the qla2xxx driver (gcc (W=1), sparse (C=2) and smatch (C=2 CHECK="smatch -p=kernel")). The patches in this series are:
0001-qla2xxx-Report-both-rsp_info-and-rsp_info_len.patch 0002-qla2xxx-Declare-local-functions-static.patch 0003-qla2xxx-Remove-set-but-not-used-variables.patch 0004-qla2xxx-Replace-two-macros-with-an-inline-function.patch 0005-qla2xxx-Remove-__constant_-prefix.patch 0006-qla2xxx-Avoid-that-sparse-complains-about-duplicate-.patch 0007-qla2xxx-Fix-sparse-annotations.patch 0008-qla2xxx-Remove-a-superfluous-test.patch 0009-qla2xxx-Remove-dead-code.patch 0010-qla2xxx-Avoid-that-sparse-complains-about-context-im.patch
Version 3 is a resend of the patches from v2 that are not yet upstream.
The changes compared to v1 of this series are:
- Rebased this patch series onto kernel v4.1-rc6.
- Also removed variable 'd2' in patch 3.
- Also remove the recently introduced dead code in patch 10.
PATCH v3 1/10 qla2xxx: Report both rsp_info and rsp_info_len
Let the debug statement in qlafx00_tm_iocb_entry() report both rsp_info and rsp_info_len instead of reporting rsp_info_len twice.
--- drivers/scsi/qla2xxx/qla_mr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_mr.c +2 -2
@@ -2528,12 +2528,12 @@ check_scsi_status:ql_dbg (ql_dbg_io, fcport->vha,0x3058 ,"FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%llu " "tgt_id: 0x%x lscsi_status: 0x%x cdb=%10phN len=0x%x " -"rsp_info=0x%x resid=0x%x fw_resid=0x%x sense_len=0x%x, " +"rsp_info=%p resid=0x%x fw_resid=0x%x sense_len=0x%x, " "par_sense_len=0x%x, rsp_info_len=0x%x\n" , comp_status, scsi_status, res, vha->host_no, cp->device->id, cp->device->lun, fcport->tgt_id, lscsi_status, cp->cmnd,scsi_bufflen (cp), - rsp_info_len, resid_len, fw_resid_len, sense_len, + rsp_info, resid_len, fw_resid_len, sense_len, par_sense_len, rsp_info_len);if (rsp->status_srb ==NULL )
Signature · 1 line
2.1.4
PATCH v3 2/10 qla2xxx: Declare local functions static
In reply to Bart Van Assche--- drivers/scsi/qla2xxx/qla_bsg.c | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- drivers/scsi/qla2xxx/qla_nx.c | 2 +- drivers/scsi/qla2xxx/qla_nx2.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)
drivers/scsi/qla2xxx/qla_bsg.c +1 -1
@@ -405,7 +405,7 @@ done:return rval; } -inline uint16_t +static inline uint16_t qla24xx_calc_ct_iocbs (uint16_t dsds) {uint16_t iocbs;
drivers/scsi/qla2xxx/qla_iocb.c +2 -2
@@ -680,7 +680,7 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,* * Returns the number of dsd list needed to store @dsds. */ -inline uint16_t +static inline uint16_t qla24xx_calc_dsd_lists (uint16_t dsds) {uint16_t dsd_lists =0 ;
@@ -700,7 +700,7 @@ qla24xx_calc_dsd_lists(uint16_t dsds)* @cmd_pkt: Command type 3 IOCB * @tot_dsds: Total number of segments to transfer */ -inline void +static inline void qla24xx_build_scsi_iocbs (srb_t *sp,struct cmd_type_7 *cmd_pkt,uint16_t tot_dsds) {
drivers/scsi/qla2xxx/qla_nx.c +1 -1
@@ -2298,7 +2298,7 @@ void qla82xx_init_flags(struct qla_hw_data *ha) ha->nx_legacy_intr.pci_int_reg = nx_legacy_intr->pci_int_reg; } -inline void +static inline void qla82xx_set_idc_version (scsi_qla_host_t *vha) {int idc_ver;
drivers/scsi/qla2xxx/qla_nx2.c +2 -2
@@ -561,7 +561,7 @@ qla8044_read_optrom_data(struct scsi_qla_host *vha, uint8_t *buf,return buf; } -inline int +static inline int qla8044_need_reset (struct scsi_qla_host *vha) {uint32_t drv_state, drv_active;
@@ -1605,7 +1605,7 @@ qla8044_set_idc_dontreset(struct scsi_qla_host *vha)qla8044_wr_reg (ha,QLA8044_IDC_DRV_CTRL , idc_ctrl); } -inline void +static inline void qla8044_set_rst_ready (struct scsi_qla_host *vha) {uint32_t drv_state;
Signature · 1 line
2.1.4
PATCH v3 3/10 qla2xxx: Remove set-but-not-used variables
In reply to Bart Van AsscheDetected these variables by building with W=1.
--- drivers/scsi/qla2xxx/qla_attr.c | 2 -- drivers/scsi/qla2xxx/qla_bsg.c | 5 ----- drivers/scsi/qla2xxx/qla_dbg.c | 24 ++++++------------------ drivers/scsi/qla2xxx/qla_init.c | 10 ++++------ drivers/scsi/qla2xxx/qla_iocb.c | 24 +++--------------------- drivers/scsi/qla2xxx/qla_isr.c | 3 +-- drivers/scsi/qla2xxx/qla_mbx.c | 4 ---- drivers/scsi/qla2xxx/qla_mid.c | 3 +-- drivers/scsi/qla2xxx/qla_mr.c | 10 +++------- drivers/scsi/qla2xxx/qla_nx.c | 9 +++------ drivers/scsi/qla2xxx/qla_nx2.c | 12 ++++-------- drivers/scsi/qla2xxx/qla_os.c | 6 ++---- drivers/scsi/qla2xxx/qla_target.c | 19 ++++--------------- drivers/scsi/qla2xxx/qla_tmpl.c | 3 +-- 14 files changed, 32 insertions(+), 102 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +0 -2
@@ -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,
drivers/scsi/qla2xxx/qla_bsg.c +0 -5
@@ -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 {
drivers/scsi/qla2xxx/qla_dbg.c +6 -18
@@ -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 (®->mailbox0); - mb1 =RD_REG_WORD (®->mailbox1); +RD_REG_WORD (®->mailbox1);WRT_REG_DWORD (®->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 (®->iobase_addr,0x6000 ); dmp_reg = ®->iobase_window; - reg_data =RD_REG_DWORD (dmp_reg); +RD_REG_DWORD (dmp_reg);WRT_REG_DWORD (dmp_reg,0 ); dmp_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 (®->iobase_addr,0x6010 ); dmp_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 */
drivers/scsi/qla2xxx/qla_init.c +4 -6
@@ -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 (®->mailbox0); +RD_REG_WORD (®->mailbox0);for (cnt =10000 ;RD_REG_WORD (®->mailbox0) !=0 && rval ==QLA_SUCCESS ; cnt--) {barrier ();
@@ -1178,7 +1178,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha) RD_REG_DWORD(®->mailbox0));/* Wait for soft-reset to complete. */ - d2 =RD_REG_DWORD (®->ctrl_status); +RD_REG_DWORD (®->ctrl_status);for (cnt =0 ; cnt <6000000 ; cnt++) {barrier (); if ((RD_REG_DWORD(®->ctrl_status) &
@@ -1221,7 +1221,7 @@ qla24xx_reset_risc(scsi_qla_host_t *vha)WRT_REG_DWORD (®->hccr,HCCRX_CLR_RISC_RESET );RD_REG_DWORD (®->hccr); - d2 = (uint32_t )RD_REG_WORD (®->mailbox0); +RD_REG_WORD (®->mailbox0);for (cnt =6000000 ;RD_REG_WORD (®->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 )
drivers/scsi/qla2xxx/qla_iocb.c +3 -21
@@ -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;
drivers/scsi/qla2xxx/qla_isr.c +1 -2
@@ -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 ;
drivers/scsi/qla2xxx/qla_mbx.c +0 -4
@@ -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);
drivers/scsi/qla2xxx/qla_mid.c +1 -2
@@ -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);
drivers/scsi/qla2xxx/qla_mr.c +3 -7
@@ -1317,10 +1317,10 @@ int qlafx00_configure_devices(scsi_qla_host_t *vha) {int rval; -unsigned long flags, save_flags; +unsigned long flags; rval =QLA_SUCCESS ; - save_flags = flags = vha->dpc_flags; + flags = vha->dpc_flags;ql_dbg (ql_dbg_disc, vha,0x2090 ,"Configure devices -- dpc flags =0x%lx\n" , flags);
@@ -2279,7 +2279,6 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)struct sts_entry_fx00 *sts;__le16 comp_status;__le16 scsi_status; -uint16_t ox_id;__le16 lscsi_status;int32_t resid; uint32_t sense_len, par_sense_len, rsp_info_len, resid_len,
@@ -2344,7 +2343,6 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) fcport = sp->fcport; - ox_id =0 ; sense_len = par_sense_len = rsp_info_len = resid_len = fw_resid_len =0 ;if (scsi_status &cpu_to_le16 ((uint16_t )SS_SENSE_LEN_VALID ))
@@ -3071,7 +3069,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt,int qlafx00_start_scsi (srb_t *sp) { -int ret, nseg; +int nseg;unsigned long flags;uint32_t index;uint32_t handle;
@@ -3088,8 +3086,6 @@ qlafx00_start_scsi(srb_t *sp)struct scsi_lun llun;/* Setup device pointers. */ - ret =0 ; - rsp = ha->rsp_q_map[0 ]; req = vha->req;
drivers/scsi/qla2xxx/qla_nx.c +3 -6
@@ -1740,8 +1740,8 @@ qla82xx_pci_config(scsi_qla_host_t *vha) ret =pci_set_mwi (ha->pdev); ha->chip_revision = ha->pdev->revision;ql_dbg (ql_dbg_init, vha,0x0043 , -"Chip revision:%d.\n" , - ha->chip_revision); +"Chip revision:%d; pci_set_mwi() returned %d.\n" , + ha->chip_revision, ret);return 0 ; }
@@ -2671,7 +2671,7 @@ qla82xx_write_flash_data(struct scsi_qla_host *vha, uint32_t *dwptr, {int ret;uint32_t liter; -uint32_t sec_mask, rest_addr; +uint32_t rest_addr;dma_addr_t optrom_dma;void *optrom =NULL ;int page_mode =0 ;
@@ -2693,7 +2693,6 @@ qla82xx_write_flash_data(struct scsi_qla_host *vha, uint32_t *dwptr, } rest_addr = ha->fdt_block_size -1 ; - sec_mask = ~rest_addr; ret =qla82xx_unprotect_flash (ha);if (ret) {
@@ -2789,7 +2788,6 @@ qla82xx_start_iocbs(scsi_qla_host_t *vha) {struct qla_hw_data *ha = vha->hw;struct req_que *req = ha->req_q_map[0 ]; -struct device_reg_82xx __iomem *reg;uint32_t dbval;/* Adjust ring index. */
@@ -2800,7 +2798,6 @@ qla82xx_start_iocbs(scsi_qla_host_t *vha) }else req->ring_ptr++; - reg = &ha->iobase->isp82; dbval =0x04 | (ha->portnum <<5 ); dbval = dbval | (req->id <<8 ) | (req->ring_index <<16 );
drivers/scsi/qla2xxx/qla_nx2.c +4 -8
@@ -462,12 +462,11 @@ qla8044_flash_lock(scsi_qla_host_t *vha)static void qla8044_flash_unlock (scsi_qla_host_t *vha) { -int ret_val;struct qla_hw_data *ha = vha->hw;/* Reading FLASH_UNLOCK register unlocks the Flash */ qla8044_wr_reg (ha,QLA8044_FLASH_LOCK_ID ,0xFF ); - ret_val =qla8044_rd_reg (ha,QLA8044_FLASH_UNLOCK ); +qla8044_rd_reg (ha,QLA8044_FLASH_UNLOCK ); }
@@ -2992,7 +2991,7 @@ qla8044_minidump_process_rddfe(struct scsi_qla_host *vha,uint32_t addr1, addr2, value, data, temp, wrVal;uint8_t stride, stride2;uint16_t count; -uint32_t poll, mask, data_size, modify_mask; +uint32_t poll, mask, modify_mask;uint32_t wait_count =0 ;uint32_t *data_ptr = *d_ptr;
@@ -3009,7 +3008,6 @@ qla8044_minidump_process_rddfe(struct scsi_qla_host *vha, poll = rddfe->poll; mask = rddfe->mask; modify_mask = rddfe->modify_mask; - data_size = rddfe->data_size; addr2 = addr1 + stride;
@@ -3091,7 +3089,7 @@ qla8044_minidump_process_rdmdio(struct scsi_qla_host *vha,uint8_t stride1, stride2;uint32_t addr3, addr4, addr5, addr6, addr7;uint16_t count, loop_cnt; -uint32_t poll, mask; +uint32_t mask;uint32_t *data_ptr = *d_ptr;struct qla8044_minidump_entry_rdmdio *rdmdio;
@@ -3105,7 +3103,6 @@ qla8044_minidump_process_rdmdio(struct scsi_qla_host *vha, stride2 = rdmdio->stride_2; count = rdmdio->count; - poll = rdmdio->poll; mask = rdmdio->mask; value2 = rdmdio->value_2;
@@ -3164,7 +3161,7 @@ error:static uint32_t qla8044_minidump_process_pollwr (struct scsi_qla_host *vha,struct qla8044_minidump_entry_hdr *entry_hdr,uint32_t **d_ptr) { -uint32_t addr1, addr2, value1, value2, poll, mask, r_value; +uint32_t addr1, addr2, value1, value2, poll, r_value;uint32_t wait_count =0 ;struct qla8044_minidump_entry_pollwr *pollwr_hdr;
@@ -3175,7 +3172,6 @@ static uint32_t qla8044_minidump_process_pollwr(struct scsi_qla_host *vha, value2 = pollwr_hdr->value_2; poll = pollwr_hdr->poll; - mask = pollwr_hdr->mask;while (wait_count < poll) {qla8044_rd_reg_indirect (vha, addr1, &r_value);
drivers/scsi/qla2xxx/qla_os.c +2 -4
@@ -2973,7 +2973,6 @@ qla2x00_shutdown(struct pci_dev *pdev)static void qla2x00_delete_all_vps (struct qla_hw_data *ha,scsi_qla_host_t *base_vha) { -struct Scsi_Host *scsi_host;scsi_qla_host_t *vha;unsigned long flags;
@@ -2984,7 +2983,7 @@ qla2x00_delete_all_vps(struct qla_hw_data *ha, scsi_qla_host_t *base_vha)BUG_ON (base_vha->list.next == &ha->vp_list);/* This assumes first entry in ha->vp_list is always base vha */ vha =list_first_entry (&base_vha->list, scsi_qla_host_t, list); - scsi_host =scsi_host_get (vha->host); +scsi_host_get (vha->host);spin_unlock_irqrestore (&ha->vport_slock, flags);mutex_unlock (&ha->vport_lock);
@@ -4793,7 +4792,6 @@ qla2x00_disable_board_on_pci_error(struct work_struct *work)static int qla2x00_do_dpc (void *data) { -int rval;scsi_qla_host_t *base_vha;struct qla_hw_data *ha;
@@ -5025,7 +5023,7 @@ loop_resync_check:if (!(test_and_set_bit (LOOP_RESYNC_ACTIVE , &base_vha->dpc_flags))) { - rval =qla2x00_loop_resync (base_vha); +qla2x00_loop_resync (base_vha);clear_bit (LOOP_RESYNC_ACTIVE , &base_vha->dpc_flags);
drivers/scsi/qla2xxx/qla_target.c +4 -15
@@ -2077,7 +2077,6 @@ static inline int qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) { uint32_t *cur_dsd; -int sgc;uint32_t transfer_length =0 ;uint32_t data_bytes;uint32_t dif_bytes;
@@ -2094,7 +2093,6 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha)struct atio_from_isp *atio = &prm->cmd->atio;uint16_t t16; - sgc =0 ; ha = vha->hw; pkt = (struct ctio_crc2_to_fw *)vha->req->ring_ptr;
@@ -2563,7 +2561,7 @@ qlt_handle_dif_error(struct scsi_qla_host *vha, struct qla_tgt_cmd *cmd,/* Update protection tag */ if (cmd->prot_sg_cnt) { -uint32_t i, j =0 , k =0 , num_ent; +uint32_t i, k =0 , num_ent;struct scatterlist *sg, *sgl;
@@ -2576,7 +2574,6 @@ qlt_handle_dif_error(struct scsi_qla_host *vha, struct qla_tgt_cmd *cmd, k += num_ent;continue ; } - j = blocks_done - k -1 ; k = blocks_done;break ; }
@@ -3063,7 +3060,6 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, uint32_t handle, {struct qla_hw_data *ha = vha->hw;struct se_cmd *se_cmd; -const struct target_core_fabric_ops *tfo;struct qla_tgt_cmd *cmd;if (handle &CTIO_INTERMEDIATE_HANDLE_MARK ) {
@@ -3081,7 +3077,6 @@ static void qlt_do_ctio_completion(struct scsi_qla_host *vha, uint32_t handle,return ; se_cmd = &cmd->se_cmd; - tfo = se_cmd->se_tfo; cmd->cmd_sent_to_fw =0 ;qlt_unmap_sg (vha, cmd);
@@ -3179,13 +3174,9 @@ skip_term:if (cmd->state ==QLA_TGT_STATE_PROCESSED ) { ; }else if (cmd->state ==QLA_TGT_STATE_NEED_DATA ) { -int rx_status =0 ; - cmd->state =QLA_TGT_STATE_DATA_IN ; -if (unlikely (status !=CTIO_SUCCESS )) - rx_status = -EIO ; -else +if (status ==CTIO_SUCCESS ) cmd->write_data_transferred =1 ; ha->tgt.tgt_ops->handle_data (cmd);
@@ -3580,12 +3571,11 @@ static int qlt_handle_task_mgmt(struct scsi_qla_host *vha, void *iocb)struct qla_tgt *tgt;struct qla_tgt_sess *sess;uint32_t lun, unpacked_lun; -int lun_size, fn; +int fn; tgt = vha->vha_tgt.qla_tgt; lun = a->u.isp24.fcp_cmnd.lun; - lun_size =sizeof (a->u.isp24.fcp_cmnd.lun); fn = a->u.isp24.fcp_cmnd.task_mgmt_flags; sess = ha->tgt.tgt_ops->find_sess_by_s_id (vha, a->u.isp24.fcp_hdr.s_id);
@@ -5044,7 +5034,7 @@ static void qlt_tmr_work(struct qla_tgt *tgt,uint8_t *s_id =NULL ;/* to hide compiler warnings */ int rc;uint32_t lun, unpacked_lun; -int lun_size, fn; +int fn;void *iocb;spin_lock_irqsave (&ha->hardware_lock, flags);
@@ -5071,7 +5061,6 @@ static void qlt_tmr_work(struct qla_tgt *tgt, iocb = a; lun = a->u.isp24.fcp_cmnd.lun; - lun_size =sizeof (lun); fn = a->u.isp24.fcp_cmnd.task_mgmt_flags; unpacked_lun =scsilun_to_int ((struct scsi_lun *)&lun);
drivers/scsi/qla2xxx/qla_tmpl.c +1 -2
@@ -805,9 +805,8 @@ static void qla27xx_driver_info(struct qla27xx_fwdt_template *tmp) {uint8_t v[] = {0 ,0 ,0 ,0 ,0 ,0 }; -int rval =0 ; - rval =sscanf (qla2x00_version_str,"%hhu.%hhu.%hhu.%hhu.%hhu.%hhu" , +sscanf (qla2x00_version_str,"%hhu.%hhu.%hhu.%hhu.%hhu.%hhu" , v+0 , v+1 , v+2 , v+3 , v+4 , v+5 ); tmp->driver_info[0 ] = v[3 ] <<24 | v[2 ] <<16 | v[1 ] <<8 | v[0 ];
Signature · 1 line
2.1.4
PATCH v3 4/10 qla2xxx: Replace two macros with an inline function
In reply to Bart Van AsscheReplace the QLA82XX_ADDR_IN_RANGE() and QLA8044_ADDR_IN_RANGE() macros with the inline function addr_in_range(). This avoids that the compiler reports the following warning when building with W=1: comparison of unsigned expression >= 0 is always true.
--- drivers/scsi/qla2xxx/qla_nx.c | 21 +++++++++------------ drivers/scsi/qla2xxx/qla_nx2.c | 4 ++-- drivers/scsi/qla2xxx/qla_nx2.h | 6 ++++-- 3 files changed, 15 insertions(+), 16 deletions(-)
drivers/scsi/qla2xxx/qla_nx.c +9 -12
@@ -547,9 +547,6 @@ void qla82xx_idc_unlock(struct qla_hw_data *ha)qla82xx_rd_32 (ha,QLA82XX_PCIE_REG (PCIE_SEM5_UNLOCK )); } -/* PCI Windowing for DDR regions. */ -#define QLA82XX_ADDR_IN_RANGE (addr, low, high) \ - (((addr) <= (high)) && ((addr) >= (low)))/* * check memory access boundary. * used by test agent. support ddr access only for now
@@ -558,9 +555,9 @@ static unsigned long qla82xx_pci_mem_bound_check(struct qla_hw_data *ha, unsigned long long addr, int size) { - if (!QLA82XX_ADDR_IN_RANGE(addr, QLA82XX_ADDR_DDR_NET, + if (!addr_in_range(addr, QLA82XX_ADDR_DDR_NET, QLA82XX_ADDR_DDR_NET_MAX) || - !QLA82XX_ADDR_IN_RANGE(addr + size - 1, QLA82XX_ADDR_DDR_NET, + !addr_in_range(addr + size - 1, QLA82XX_ADDR_DDR_NET, QLA82XX_ADDR_DDR_NET_MAX) || ((size != 1) && (size != 2) && (size != 4) && (size != 8))) return 0;
@@ -577,7 +574,7 @@ qla82xx_pci_set_window(struct qla_hw_data *ha, unsigned long long addr)u32 win_read;scsi_qla_host_t *vha =pci_get_drvdata (ha->pdev); -if (QLA82XX_ADDR_IN_RANGE (addr,QLA82XX_ADDR_DDR_NET , +if (addr_in_range (addr,QLA82XX_ADDR_DDR_NET ,QLA82XX_ADDR_DDR_NET_MAX )) {/* DDR network side */ window =MN_WIN (addr);
@@ -592,7 +589,7 @@ qla82xx_pci_set_window(struct qla_hw_data *ha, unsigned long long addr) __func__, window, win_read); } addr =GET_MEM_OFFS_2M (addr) +QLA82XX_PCI_DDR_NET ; - }else if (QLA82XX_ADDR_IN_RANGE (addr,QLA82XX_ADDR_OCM0 , + }else if (addr_in_range (addr,QLA82XX_ADDR_OCM0 ,QLA82XX_ADDR_OCM0_MAX )) {unsigned int temp1;if ((addr &0x00ff800 ) ==0xff800 ) {
@@ -615,7 +612,7 @@ qla82xx_pci_set_window(struct qla_hw_data *ha, unsigned long long addr) } addr =GET_MEM_OFFS_2M (addr) +QLA82XX_PCI_OCM0_2M ; - }else if (QLA82XX_ADDR_IN_RANGE (addr,QLA82XX_ADDR_QDR_NET , + }else if (addr_in_range (addr,QLA82XX_ADDR_QDR_NET ,QLA82XX_P3_ADDR_QDR_NET_MAX )) {/* QDR network side */ window =MS_WIN (addr);
@@ -656,16 +653,16 @@ static int qla82xx_pci_is_same_window(struct qla_hw_data *ha, qdr_max =QLA82XX_P3_ADDR_QDR_NET_MAX ;/* DDR network side */ -if (QLA82XX_ADDR_IN_RANGE (addr,QLA82XX_ADDR_DDR_NET , +if (addr_in_range (addr,QLA82XX_ADDR_DDR_NET ,QLA82XX_ADDR_DDR_NET_MAX ))BUG (); -else if (QLA82XX_ADDR_IN_RANGE (addr,QLA82XX_ADDR_OCM0 , +else if (addr_in_range (addr,QLA82XX_ADDR_OCM0 ,QLA82XX_ADDR_OCM0_MAX ))return 1 ; -else if (QLA82XX_ADDR_IN_RANGE (addr,QLA82XX_ADDR_OCM1 , +else if (addr_in_range (addr,QLA82XX_ADDR_OCM1 ,QLA82XX_ADDR_OCM1_MAX ))return 1 ; -else if (QLA82XX_ADDR_IN_RANGE (addr,QLA82XX_ADDR_QDR_NET , qdr_max)) { +else if (addr_in_range (addr,QLA82XX_ADDR_QDR_NET , qdr_max)) {/* QDR network side */ window = ((addr -QLA82XX_ADDR_QDR_NET ) >>22 ) &0x3f ;if (ha->qdr_sn_window == window)
drivers/scsi/qla2xxx/qla_nx2.c +2 -2
@@ -1129,9 +1129,9 @@ qla8044_ms_mem_write_128b(struct scsi_qla_host *vha, }for (i =0 ; i < count; i++, addr +=16 ) { -if (!((QLA8044_ADDR_IN_RANGE (addr,QLA8044_ADDR_QDR_NET , +if (!((addr_in_range (addr,QLA8044_ADDR_QDR_NET ,QLA8044_ADDR_QDR_NET_MAX )) || - (QLA8044_ADDR_IN_RANGE (addr,QLA8044_ADDR_DDR_NET , + (addr_in_range (addr,QLA8044_ADDR_DDR_NET ,QLA8044_ADDR_DDR_NET_MAX )))) { ret_val =QLA_FUNCTION_FAILED ; goto exit_ms_mem_write_unlock;
drivers/scsi/qla2xxx/qla_nx2.h +4 -2
@@ -58,8 +58,10 @@#define QLA8044_PCI_QDR_NET_MAX ((unsigned long)0x043fffff)/* PCI Windowing for DDR regions. */ -#define QLA8044_ADDR_IN_RANGE (addr, low, high) \ - (((addr) <= (high)) && ((addr) >= (low))) +static inline bool addr_in_range (u64 addr,u64 low,u64 high) +{ +return addr <= high && addr >= low; +}/* Indirectly Mapped Registers */ #define QLA8044_FLASH_SPI_STATUS 0x2808E010
Signature · 1 line
2.1.4
PATCH v3 5/10 qla2xxx: Remove __constant_ prefix
In reply to Bart Van AsscheWhether htonl() or __constant_htonl() is used, if the argument is a constant the conversion happens at compile time. Hence leave out the __constant_ prefix for this and other endianness conversion functions. This improves source code readability.
--- drivers/scsi/qla2xxx/qla_dbg.c | 36 +++++----- drivers/scsi/qla2xxx/qla_gs.c | 52 +++++++------- drivers/scsi/qla2xxx/qla_init.c | 143 ++++++++++++++++++-------------------- drivers/scsi/qla2xxx/qla_iocb.c | 88 ++++++++++------------- drivers/scsi/qla2xxx/qla_isr.c | 2 +- drivers/scsi/qla2xxx/qla_mbx.c | 25 ++++--- drivers/scsi/qla2xxx/qla_mr.c | 2 +- drivers/scsi/qla2xxx/qla_nx.c | 6 +- drivers/scsi/qla2xxx/qla_sup.c | 14 ++-- drivers/scsi/qla2xxx/qla_target.c | 116 +++++++++++++++---------------- 10 files changed, 231 insertions(+), 253 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +18 -18
@@ -486,7 +486,7 @@ qla25xx_copy_fce(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)return ptr; *last_chain = &fcec->type; - fcec->type =__constant_htonl (DUMP_CHAIN_FCE ); + fcec->type =htonl (DUMP_CHAIN_FCE ); fcec->chain_size =htonl (sizeof (struct qla2xxx_fce_chain ) +fce_calc_size (ha->fce_bufs)); fcec->size =htonl (fce_calc_size (ha->fce_bufs));
@@ -527,7 +527,7 @@ qla2xxx_copy_atioqueues(struct qla_hw_data *ha, void *ptr,/* aqp = ha->atio_q_map[que]; */ q = ptr; *last_chain = &q->type; - q->type =__constant_htonl (DUMP_CHAIN_QUEUE ); + q->type =htonl (DUMP_CHAIN_QUEUE ); q->chain_size = htonl( sizeof(struct qla2xxx_mqueue_chain) + sizeof(struct qla2xxx_mqueue_header) +
@@ -536,7 +536,7 @@ qla2xxx_copy_atioqueues(struct qla_hw_data *ha, void *ptr,/* Add header. */ qh = ptr; - qh->queue =__constant_htonl (TYPE_ATIO_QUEUE ); + qh->queue =htonl (TYPE_ATIO_QUEUE ); qh->number =htonl (que); qh->size =htonl (aqp->length *sizeof (request_t)); ptr +=sizeof (struct qla2xxx_mqueue_header );
@@ -571,7 +571,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add chain. */ q = ptr; *last_chain = &q->type; - q->type =__constant_htonl (DUMP_CHAIN_QUEUE ); + q->type =htonl (DUMP_CHAIN_QUEUE ); q->chain_size = htonl( sizeof(struct qla2xxx_mqueue_chain) + sizeof(struct qla2xxx_mqueue_header) +
@@ -580,7 +580,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add header. */ qh = ptr; - qh->queue =__constant_htonl (TYPE_REQUEST_QUEUE ); + qh->queue =htonl (TYPE_REQUEST_QUEUE ); qh->number =htonl (que); qh->size =htonl (req->length *sizeof (request_t)); ptr +=sizeof (struct qla2xxx_mqueue_header );
@@ -599,7 +599,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add chain. */ q = ptr; *last_chain = &q->type; - q->type =__constant_htonl (DUMP_CHAIN_QUEUE ); + q->type =htonl (DUMP_CHAIN_QUEUE ); q->chain_size = htonl( sizeof(struct qla2xxx_mqueue_chain) + sizeof(struct qla2xxx_mqueue_header) +
@@ -608,7 +608,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add header. */ qh = ptr; - qh->queue =__constant_htonl (TYPE_RESPONSE_QUEUE ); + qh->queue =htonl (TYPE_RESPONSE_QUEUE ); qh->number =htonl (que); qh->size =htonl (rsp->length *sizeof (response_t)); ptr +=sizeof (struct qla2xxx_mqueue_header );
@@ -634,8 +634,8 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain) mq = ptr; *last_chain = &mq->type; - mq->type =__constant_htonl (DUMP_CHAIN_MQ ); - mq->chain_size =__constant_htonl (sizeof (struct qla2xxx_mq_chain )); + mq->type =htonl (DUMP_CHAIN_MQ ); + mq->chain_size =htonl (sizeof (struct qla2xxx_mq_chain )); que_cnt = ha->max_req_queues > ha->max_rsp_queues ? ha->max_req_queues : ha->max_rsp_queues;
@@ -1271,8 +1271,8 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) nxt_chain = (void *)ha->fw_dump + ha->chain_offset; nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */
@@ -1323,7 +1323,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) } fw = &ha->fw_dump->isp.isp25;qla2xxx_prep_dump (ha, ha->fw_dump); - ha->fw_dump->version =__constant_htonl (2 ); + ha->fw_dump->version =htonl (2 ); fw->host_status =htonl (RD_REG_DWORD (®->host_status));
@@ -1587,8 +1587,8 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) nxt_chain =qla25xx_copy_mqueues (ha, nxt_chain, &last_chain); nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */
@@ -1905,8 +1905,8 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) nxt_chain =qla25xx_copy_mqueues (ha, nxt_chain, &last_chain); nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */
@@ -2408,8 +2408,8 @@ copy_queue: nxt_chain =qla25xx_copy_mqueues (ha, nxt_chain, &last_chain); nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */
drivers/scsi/qla2xxx/qla_gs.c +26 -26
154 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_init.c +69 -74
337 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_iocb.c +38 -50
259 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_isr.c +1 -1
@@ -1564,7 +1564,7 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)"Async-%s error - hdl=%x entry-status(%x).\n" , type, sp->handle, sts->entry_status); iocb->u.tmf.data =QLA_FUNCTION_FAILED ; - }else if (sts->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (sts->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_log (ql_log_warn, fcport->vha,0x5039 ,"Async-%s error - hdl=%x completion status(%x).\n" , type, sp->handle, sts->comp_status);
drivers/scsi/qla2xxx/qla_mbx.c +12 -13
@@ -1886,11 +1886,11 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, lg->entry_count =1 ; lg->handle =MAKE_HANDLE (req->id, lg->handle); lg->nport_handle =cpu_to_le16 (loop_id); - lg->control_flags =__constant_cpu_to_le16 (LCF_COMMAND_PLOGI ); + lg->control_flags =cpu_to_le16 (LCF_COMMAND_PLOGI );if (opt &BIT_0 ) - lg->control_flags |=__constant_cpu_to_le16 (LCF_COND_PLOGI ); + lg->control_flags |=cpu_to_le16 (LCF_COND_PLOGI );if (opt &BIT_1 ) - lg->control_flags |=__constant_cpu_to_le16 (LCF_SKIP_PRLI ); + lg->control_flags |=cpu_to_le16 (LCF_SKIP_PRLI ); lg->port_id[0 ] = al_pa; lg->port_id[1 ] = area; lg->port_id[2 ] = domain;
@@ -1905,7 +1905,7 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,"Failed to complete IOCB -- error status (%x).\n" , lg->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (lg->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (lg->comp_status !=cpu_to_le16 (CS_COMPLETE )) { iop[0 ] =le32_to_cpu (lg->io_parameter[0 ]); iop[1 ] =le32_to_cpu (lg->io_parameter[1 ]);
@@ -1959,7 +1959,7 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, mb[10 ] |=BIT_0 ;/* Class 2. */ if (lg->io_parameter[9 ] || lg->io_parameter[10 ]) mb[10 ] |=BIT_1 ;/* Class 3. */ -if (lg->io_parameter[0 ] &__constant_cpu_to_le32 (BIT_7 )) +if (lg->io_parameter[0 ] &cpu_to_le32 (BIT_7 )) mb[10 ] |=BIT_7 ;/* Confirmed Completion * Allowed */
@@ -2161,7 +2161,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, lg->handle =MAKE_HANDLE (req->id, lg->handle); lg->nport_handle =cpu_to_le16 (loop_id); lg->control_flags = -__constant_cpu_to_le16 (LCF_COMMAND_LOGO |LCF_IMPL_LOGO | +cpu_to_le16 (LCF_COMMAND_LOGO |LCF_IMPL_LOGO |LCF_FREE_NPORT ); lg->port_id[0 ] = al_pa; lg->port_id[1 ] = area;
@@ -2177,7 +2177,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,"Failed to complete IOCB -- error status (%x).\n" , lg->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (lg->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (lg->comp_status !=cpu_to_le16 (CS_COMPLETE )) { ql_dbg(ql_dbg_mbx, vha, 0x1071, "Failed to complete IOCB -- completion status (%x) " "ioparam=%x/%x.\n", le16_to_cpu(lg->comp_status),
@@ -2668,7 +2668,7 @@ qla24xx_abort_command(srb_t *sp)"Failed to complete IOCB -- error status (%x).\n" , abt->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (abt->nport_handle !=__constant_cpu_to_le16 (0 )) { + }else if (abt->nport_handle !=cpu_to_le16 (0 )) {ql_dbg (ql_dbg_mbx, vha,0x1090 ,"Failed to complete IOCB -- completion status (%x).\n" ,le16_to_cpu (abt->nport_handle));
@@ -2751,8 +2751,7 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport,"Failed to complete IOCB -- error status (%x).\n" , sts->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (sts->comp_status != -__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (sts->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_dbg (ql_dbg_mbx, vha,0x1096 ,"Failed to complete IOCB -- completion status (%x).\n" ,le16_to_cpu (sts->comp_status));
@@ -3478,7 +3477,7 @@ qla24xx_modify_vp_config(scsi_qla_host_t *vha)"Failed to complete IOCB -- error status (%x).\n" , vpmod->comp_status); rval =QLA_FUNCTION_FAILED ; - }else if (vpmod->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (vpmod->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_dbg (ql_dbg_mbx, vha,0x10bf ,"Failed to complete IOCB -- completion status (%x).\n" ,le16_to_cpu (vpmod->comp_status));
@@ -3537,7 +3536,7 @@ qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) vce->entry_type =VP_CTRL_IOCB_TYPE ; vce->entry_count =1 ; vce->command =cpu_to_le16 (cmd); - vce->vp_count =__constant_cpu_to_le16 (1 ); + vce->vp_count =cpu_to_le16 (1 );/* index map in firmware starts with 1; decrement index * this is ok as we never use index 0
@@ -3557,7 +3556,7 @@ qla24xx_control_vp(scsi_qla_host_t *vha, int cmd)"Failed to complete IOCB -- error status (%x).\n" , vce->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (vce->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (vce->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_dbg (ql_dbg_mbx, vha,0x10c5 ,"Failed to complet IOCB -- completion status (%x).\n" ,le16_to_cpu (vce->comp_status));
drivers/scsi/qla2xxx/qla_mr.c +1 -1
@@ -3007,7 +3007,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt,/* No data transfer */ if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) { - lcmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + lcmd_pkt->byte_count =cpu_to_le32 (0 );return ; }
drivers/scsi/qla2xxx/qla_nx.c +3 -3
@@ -1765,8 +1765,8 @@ void qla82xx_config_rings(struct scsi_qla_host *vha)/* Setup ring parameters in initialization control block. */ icb = (struct init_cb_81xx *)ha->init_cb; - icb->request_q_outpointer =__constant_cpu_to_le16 (0 ); - icb->response_q_inpointer =__constant_cpu_to_le16 (0 ); + icb->request_q_outpointer =cpu_to_le16 (0 ); + icb->response_q_inpointer =cpu_to_le16 (0 ); icb->request_q_length =cpu_to_le16 (req->length); icb->response_q_length =cpu_to_le16 (rsp->length); icb->request_q_address[0 ] =cpu_to_le32 (LSD (req->dma));
@@ -2546,7 +2546,7 @@ qla82xx_read_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr, "Do ROM fast read failed.\n"); goto done_read; } - dwptr[i] =__constant_cpu_to_le32 (val); + dwptr[i] =cpu_to_le32 (val); } done_read:return dwptr;
drivers/scsi/qla2xxx/qla_sup.c +7 -7
@@ -316,7 +316,7 @@ qla2x00_clear_nvram_protection(struct qla_hw_data *ha) wprot_old =cpu_to_le16 (qla2x00_get_nvram_word (ha, ha->nvram_base)); stat =qla2x00_write_nvram_word_tmo (ha, ha->nvram_base, -__constant_cpu_to_le16 (0x1234 ),100000 ); +cpu_to_le16 (0x1234 ),100000 ); wprot =cpu_to_le16 (qla2x00_get_nvram_word (ha, ha->nvram_base));if (stat !=QLA_SUCCESS || wprot !=0x1234 ) {/* Write enable. */
@@ -691,9 +691,9 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) region = (struct qla_flt_region *)&flt[1 ]; ha->isp_ops->read_optrom (vha, (uint8_t *)req->ring, flt_addr <<2 ,OPTROM_BURST_SIZE ); -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; -if (flt->version !=__constant_cpu_to_le16 (1 )) { +if (flt->version !=cpu_to_le16 (1 )) { ql_log(ql_log_warn, vha, 0x0047, "Unsupported FLT detected: version=0x%x length=0x%x checksum=0x%x.\n", le16_to_cpu(flt->version), le16_to_cpu(flt->length),
@@ -892,7 +892,7 @@ qla2xxx_get_fdt_info(scsi_qla_host_t *vha) fdt = (struct qla_fdt_layout *)req->ring; ha->isp_ops->read_optrom (vha, (uint8_t *)req->ring, ha->flt_region_fdt <<2 ,OPTROM_BURST_SIZE ); -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data;if (fdt->sig[0 ] !='Q' || fdt->sig[1 ] !='L' || fdt->sig[2 ] !='I' || fdt->sig[3 ] !='D' )
@@ -991,7 +991,7 @@ qla2xxx_get_idc_param(scsi_qla_host_t *vha) ha->isp_ops->read_optrom (vha, (uint8_t *)req->ring,QLA82XX_IDC_PARAM_ADDR ,8 ); -if (*wptr ==__constant_cpu_to_le32 (0xffffffff )) { +if (*wptr ==cpu_to_le32 (0xffffffff )) { ha->fcoe_dev_init_timeout =QLA82XX_ROM_DEV_INIT_TIMEOUT ; ha->fcoe_reset_timeout =QLA82XX_ROM_DRV_RESET_ACK_TIMEOUT ; }else {
@@ -1051,9 +1051,9 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) ha->isp_ops->read_optrom (vha, (uint8_t *)&hdr, ha->flt_region_npiv_conf <<2 ,sizeof (struct qla_npiv_header )); -if (hdr.version ==__constant_cpu_to_le16 (0xffff )) +if (hdr.version ==cpu_to_le16 (0xffff ))return ; -if (hdr.version !=__constant_cpu_to_le16 (1 )) { +if (hdr.version !=cpu_to_le16 (1 )) { ql_dbg(ql_dbg_user, vha, 0x7090, "Unsupported NPIV-Config " "detected: version=0x%x entries=0x%x checksum=0x%x.\n",
drivers/scsi/qla2xxx/qla_target.c +56 -60
356 lines not on this page · raw message
Signature · 1 line
2.1.4
James Bottomley
maintainerRe: [PATCH v3 05/10] qla2xxx: Remove __constant_ prefix
Quoted 4 lines · Bart Van Assche
Whether
htonl()or__constant_htonl()is used, if the argument is a constant the conversion happens at compile time. Hence leave out the__constant_prefix for this and other endianness conversion functions. This improves source code readability.
Could you please run checkpatch on stuff before sending it? I know the qla_iocb.c file is a mess with mixed tabs and spaces, but if you don't convert the lines you touch to acceptable style it will trigger the static checkers. I've fixed this up.
James
Quoted 1,567 lines
Signed-off-by Bart Van Assche <[email protected]>Acked-by Himanshu Madhani <[email protected]>Cc Quinn Tran <[email protected]>Cc Saurav Kashyap <[email protected]>--- drivers/scsi/qla2xxx/qla_dbg.c | 36 +++++----- drivers/scsi/qla2xxx/qla_gs.c | 52 +++++++------- drivers/scsi/qla2xxx/qla_init.c | 143 ++++++++++++++++++-------------------- drivers/scsi/qla2xxx/qla_iocb.c | 88 ++++++++++------------- drivers/scsi/qla2xxx/qla_isr.c | 2 +- drivers/scsi/qla2xxx/qla_mbx.c | 25 ++++--- drivers/scsi/qla2xxx/qla_mr.c | 2 +- drivers/scsi/qla2xxx/qla_nx.c | 6 +- drivers/scsi/qla2xxx/qla_sup.c | 14 ++-- drivers/scsi/qla2xxx/qla_target.c | 116 +++++++++++++++---------------- 10 files changed, 231 insertions(+), 253 deletions(-)drivers/scsi/qla2xxx/qla_dbg.c +18
-18@@ -486,7 +486,7 @@ qla25xx_copy_fce(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)return ptr; *last_chain = &fcec->type; - fcec->type =__constant_htonl (DUMP_CHAIN_FCE ); + fcec->type =htonl (DUMP_CHAIN_FCE ); fcec->chain_size =htonl (sizeof (struct qla2xxx_fce_chain ) +fce_calc_size (ha->fce_bufs)); fcec->size =htonl (fce_calc_size (ha->fce_bufs));@@ -527,7 +527,7 @@ qla2xxx_copy_atioqueues(struct qla_hw_data *ha, void *ptr,/* aqp = ha->atio_q_map[que]; */ q = ptr; *last_chain = &q->type; - q->type =__constant_htonl (DUMP_CHAIN_QUEUE ); + q->type =htonl (DUMP_CHAIN_QUEUE ); q->chain_size = htonl( sizeof(struct qla2xxx_mqueue_chain) + sizeof(struct qla2xxx_mqueue_header) +@@ -536,7 +536,7 @@ qla2xxx_copy_atioqueues(struct qla_hw_data *ha, void *ptr,/* Add header. */ qh = ptr; - qh->queue =__constant_htonl (TYPE_ATIO_QUEUE ); + qh->queue =htonl (TYPE_ATIO_QUEUE ); qh->number =htonl (que); qh->size =htonl (aqp->length *sizeof (request_t)); ptr +=sizeof (struct qla2xxx_mqueue_header );@@ -571,7 +571,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add chain. */ q = ptr; *last_chain = &q->type; - q->type =__constant_htonl (DUMP_CHAIN_QUEUE ); + q->type =htonl (DUMP_CHAIN_QUEUE ); q->chain_size = htonl( sizeof(struct qla2xxx_mqueue_chain) + sizeof(struct qla2xxx_mqueue_header) +@@ -580,7 +580,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add header. */ qh = ptr; - qh->queue =__constant_htonl (TYPE_REQUEST_QUEUE ); + qh->queue =htonl (TYPE_REQUEST_QUEUE ); qh->number =htonl (que); qh->size =htonl (req->length *sizeof (request_t)); ptr +=sizeof (struct qla2xxx_mqueue_header );@@ -599,7 +599,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add chain. */ q = ptr; *last_chain = &q->type; - q->type =__constant_htonl (DUMP_CHAIN_QUEUE ); + q->type =htonl (DUMP_CHAIN_QUEUE ); q->chain_size = htonl( sizeof(struct qla2xxx_mqueue_chain) + sizeof(struct qla2xxx_mqueue_header) +@@ -608,7 +608,7 @@ qla25xx_copy_mqueues(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)/* Add header. */ qh = ptr; - qh->queue =__constant_htonl (TYPE_RESPONSE_QUEUE ); + qh->queue =htonl (TYPE_RESPONSE_QUEUE ); qh->number =htonl (que); qh->size =htonl (rsp->length *sizeof (response_t)); ptr +=sizeof (struct qla2xxx_mqueue_header );@@ -634,8 +634,8 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain) mq = ptr; *last_chain = &mq->type; - mq->type =__constant_htonl (DUMP_CHAIN_MQ ); - mq->chain_size =__constant_htonl (sizeof (struct qla2xxx_mq_chain )); + mq->type =htonl (DUMP_CHAIN_MQ ); + mq->chain_size =htonl (sizeof (struct qla2xxx_mq_chain )); que_cnt = ha->max_req_queues > ha->max_rsp_queues ? ha->max_req_queues : ha->max_rsp_queues;@@ -1271,8 +1271,8 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) nxt_chain = (void *)ha->fw_dump + ha->chain_offset; nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */ @@ -1323,7 +1323,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) } fw = &ha->fw_dump->isp.isp25;qla2xxx_prep_dump (ha, ha->fw_dump); - ha->fw_dump->version =__constant_htonl (2 ); + ha->fw_dump->version =htonl (2 ); fw->host_status =htonl (RD_REG_DWORD (®->host_status));@@ -1587,8 +1587,8 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) nxt_chain =qla25xx_copy_mqueues (ha, nxt_chain, &last_chain); nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */ @@ -1905,8 +1905,8 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) nxt_chain =qla25xx_copy_mqueues (ha, nxt_chain, &last_chain); nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */ @@ -2408,8 +2408,8 @@ copy_queue: nxt_chain =qla25xx_copy_mqueues (ha, nxt_chain, &last_chain); nxt_chain =qla2xxx_copy_atioqueues (ha, nxt_chain, &last_chain);if (last_chain) { - ha->fw_dump->version |=__constant_htonl (DUMP_CHAIN_VARIANT ); - *last_chain |=__constant_htonl (DUMP_CHAIN_LAST ); + ha->fw_dump->version |=htonl (DUMP_CHAIN_VARIANT ); + *last_chain |=htonl (DUMP_CHAIN_LAST ); }/* Adjust valid length. */ drivers/scsi/qla2xxx/qla_gs.c +26
-26@@ -35,10 +35,10 @@ qla2x00_prep_ms_iocb(scsi_qla_host_t *vha, uint32_t req_size, uint32_t rsp_size) ms_pkt->entry_type =MS_IOCB_TYPE ; ms_pkt->entry_count =1 ;SET_TARGET_ID (ha, ms_pkt->loop_id,SIMPLE_NAME_SERVER ); - ms_pkt->control_flags =__constant_cpu_to_le16 (CF_READ |CF_HEAD_TAG ); + ms_pkt->control_flags =cpu_to_le16 (CF_READ |CF_HEAD_TAG ); ms_pkt->timeout =cpu_to_le16 (ha->r_a_tov /10 *2 ); - ms_pkt->cmd_dsd_count =__constant_cpu_to_le16 (1 ); - ms_pkt->total_dsd_count =__constant_cpu_to_le16 (2 ); + ms_pkt->cmd_dsd_count =cpu_to_le16 (1 ); + ms_pkt->total_dsd_count =cpu_to_le16 (2 ); ms_pkt->rsp_bytecount =cpu_to_le32 (rsp_size); ms_pkt->req_bytecount =cpu_to_le32 (req_size);@@ -74,10 +74,10 @@ qla24xx_prep_ms_iocb(scsi_qla_host_t *vha, uint32_t req_size, uint32_t rsp_size) ct_pkt->entry_type =CT_IOCB_TYPE ; ct_pkt->entry_count =1 ; - ct_pkt->nport_handle =__constant_cpu_to_le16 (NPH_SNS ); + ct_pkt->nport_handle =cpu_to_le16 (NPH_SNS ); ct_pkt->timeout =cpu_to_le16 (ha->r_a_tov /10 *2 ); - ct_pkt->cmd_dsd_count =__constant_cpu_to_le16 (1 ); - ct_pkt->rsp_dsd_count =__constant_cpu_to_le16 (1 ); + ct_pkt->cmd_dsd_count =cpu_to_le16 (1 ); + ct_pkt->rsp_dsd_count =cpu_to_le16 (1 ); ct_pkt->rsp_byte_count =cpu_to_le32 (rsp_size); ct_pkt->cmd_byte_count =cpu_to_le32 (req_size);@@ -142,7 +142,7 @@ qla2x00_chk_ms_status(scsi_qla_host_t *vha, ms_iocb_entry_t *ms_pkt,case CS_DATA_UNDERRUN :case CS_DATA_OVERRUN :/* Overrun? */ if (ct_rsp->header.response != -__constant_cpu_to_be16 (CT_ACCEPT_RESPONSE )) { +cpu_to_be16 (CT_ACCEPT_RESPONSE )) { ql_dbg(ql_dbg_disc + ql_dbg_buffer, vha, 0x2077, "%s failed rejected request on port_id: %02x%02x%02x Compeltion status 0x%x, response 0x%x\n", routine, vha->d_id.b.domain,@@ -1153,10 +1153,10 @@ qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *vha, uint32_t req_size, ms_pkt->entry_type =MS_IOCB_TYPE ; ms_pkt->entry_count =1 ;SET_TARGET_ID (ha, ms_pkt->loop_id, vha->mgmt_svr_loop_id); - ms_pkt->control_flags =__constant_cpu_to_le16 (CF_READ |CF_HEAD_TAG ); + ms_pkt->control_flags =cpu_to_le16 (CF_READ |CF_HEAD_TAG ); ms_pkt->timeout =cpu_to_le16 (ha->r_a_tov /10 *2 ); - ms_pkt->cmd_dsd_count =__constant_cpu_to_le16 (1 ); - ms_pkt->total_dsd_count =__constant_cpu_to_le16 (2 ); + ms_pkt->cmd_dsd_count =cpu_to_le16 (1 ); + ms_pkt->total_dsd_count =cpu_to_le16 (2 ); ms_pkt->rsp_bytecount =cpu_to_le32 (rsp_size); ms_pkt->req_bytecount =cpu_to_le32 (req_size);@@ -1193,8 +1193,8 @@ qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *vha, uint32_t req_size, ct_pkt->entry_count =1 ; ct_pkt->nport_handle =cpu_to_le16 (vha->mgmt_svr_loop_id); ct_pkt->timeout =cpu_to_le16 (ha->r_a_tov /10 *2 ); - ct_pkt->cmd_dsd_count =__constant_cpu_to_le16 (1 ); - ct_pkt->rsp_dsd_count =__constant_cpu_to_le16 (1 ); + ct_pkt->cmd_dsd_count =cpu_to_le16 (1 ); + ct_pkt->rsp_dsd_count =cpu_to_le16 (1 ); ct_pkt->rsp_byte_count =cpu_to_le32 (rsp_size); ct_pkt->cmd_byte_count =cpu_to_le32 (req_size);@@ -1281,19 +1281,19 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Prepare FDMI command arguments -- attribute block, attributes. */ memcpy (ct_req->req.rhba.hba_identifier, vha->port_name,WWN_SIZE ); - ct_req->req.rhba.entry_count =__constant_cpu_to_be32 (1 ); + ct_req->req.rhba.entry_count =cpu_to_be32 (1 );memcpy (ct_req->req.rhba.port_name, vha->port_name,WWN_SIZE ); size =2 *WWN_SIZE +4 +4 ;/* Attributes */ ct_req->req.rhba.attrs.count = -__constant_cpu_to_be32 (FDMI_HBA_ATTR_COUNT ); +cpu_to_be32 (FDMI_HBA_ATTR_COUNT ); entries = ct_req->req.rhba.hba_identifier;/* Nodename. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_NODE_NAME ); - eiter->len =__constant_cpu_to_be16 (4 +WWN_SIZE ); + eiter->type =cpu_to_be16 (FDMI_HBA_NODE_NAME ); + eiter->len =cpu_to_be16 (4 +WWN_SIZE );memcpy (eiter->a.node_name, vha->node_name,WWN_SIZE ); size +=4 +WWN_SIZE ;@@ -1302,7 +1302,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Manufacturer. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_MANUFACTURER ); + eiter->type =cpu_to_be16 (FDMI_HBA_MANUFACTURER ); alen =strlen (QLA2XXX_MANUFACTURER );snprintf (eiter->a.manufacturer,sizeof (eiter->a.manufacturer),"%s" ,"QLogic Corporation" );@@ -1315,7 +1315,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Serial number. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_SERIAL_NUMBER ); + eiter->type =cpu_to_be16 (FDMI_HBA_SERIAL_NUMBER );if (IS_FWI2_CAPABLE (ha))qla2xxx_get_vpd_field (vha,"SN" , eiter->a.serial_num,sizeof (eiter->a.serial_num));@@ -1335,7 +1335,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Model name. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_MODEL ); + eiter->type =cpu_to_be16 (FDMI_HBA_MODEL );snprintf (eiter->a.model,sizeof (eiter->a.model),"%s" , ha->model_number); alen =strlen (eiter->a.model);@@ -1348,7 +1348,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Model description. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_MODEL_DESCRIPTION ); + eiter->type =cpu_to_be16 (FDMI_HBA_MODEL_DESCRIPTION );snprintf (eiter->a.model_desc,sizeof (eiter->a.model_desc),"%s" , ha->model_desc); alen =strlen (eiter->a.model_desc);@@ -1361,7 +1361,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Hardware version. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_HARDWARE_VERSION ); + eiter->type =cpu_to_be16 (FDMI_HBA_HARDWARE_VERSION );if (!IS_FWI2_CAPABLE (ha)) {snprintf (eiter->a.hw_version,sizeof (eiter->a.hw_version),"HW:%s" , ha->adapter_id);@@ -1385,7 +1385,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Driver version. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_DRIVER_VERSION ); + eiter->type =cpu_to_be16 (FDMI_HBA_DRIVER_VERSION );snprintf (eiter->a.driver_version,sizeof (eiter->a.driver_version),"%s" , qla2x00_version_str); alen =strlen (eiter->a.driver_version);@@ -1398,7 +1398,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Option ROM version. */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_OPTION_ROM_VERSION ); + eiter->type =cpu_to_be16 (FDMI_HBA_OPTION_ROM_VERSION );snprintf (eiter->a.orom_version,sizeof (eiter->a.orom_version),"%d.%02d" , ha->bios_revision[1 ], ha->bios_revision[0 ]); alen =strlen (eiter->a.orom_version);@@ -1411,7 +1411,7 @@ qla2x00_fdmi_rhba(scsi_qla_host_t *vha)/* Firmware version */ eiter = entries + size; - eiter->type =__constant_cpu_to_be16 (FDMI_HBA_FIRMWARE_VERSION ); + eiter->type =cpu_to_be16 (FDMI_HBA_FIRMWARE_VERSION ); ha->isp_ops->fw_version_str (vha, eiter->a.fw_version,sizeof (eiter->a.fw_version)); alen =strlen (eiter->a.fw_version);@@ -2484,8 +2484,8 @@ qla24xx_prep_ms_fm_iocb(scsi_qla_host_t *vha, uint32_t req_size, ct_pkt->entry_count =1 ; ct_pkt->nport_handle =cpu_to_le16 (vha->mgmt_svr_loop_id); ct_pkt->timeout =cpu_to_le16 (ha->r_a_tov /10 *2 ); - ct_pkt->cmd_dsd_count =__constant_cpu_to_le16 (1 ); - ct_pkt->rsp_dsd_count =__constant_cpu_to_le16 (1 ); + ct_pkt->cmd_dsd_count =cpu_to_le16 (1 ); + ct_pkt->rsp_dsd_count =cpu_to_le16 (1 ); ct_pkt->rsp_byte_count =cpu_to_le32 (rsp_size); ct_pkt->cmd_byte_count =cpu_to_le32 (req_size);drivers/scsi/qla2xxx/qla_init.c +69
-74@@ -1685,7 +1685,7 @@ allocate: ha->fw_dump->signature[1 ] ='L' ; ha->fw_dump->signature[2 ] ='G' ; ha->fw_dump->signature[3 ] ='C' ; - ha->fw_dump->version =__constant_htonl (1 ); + ha->fw_dump->version =htonl (1 ); ha->fw_dump->fixed_size =htonl (fixed_size); ha->fw_dump->mem_size =htonl (mem_size);@@ -2065,8 +2065,8 @@ qla2x00_config_rings(struct scsi_qla_host *vha)struct rsp_que *rsp = ha->rsp_q_map[0 ];/* Setup ring parameters in initialization control block. */ - ha->init_cb->request_q_outpointer =__constant_cpu_to_le16 (0 ); - ha->init_cb->response_q_inpointer =__constant_cpu_to_le16 (0 ); + ha->init_cb->request_q_outpointer =cpu_to_le16 (0 ); + ha->init_cb->response_q_inpointer =cpu_to_le16 (0 ); ha->init_cb->request_q_length =cpu_to_le16 (req->length); ha->init_cb->response_q_length =cpu_to_le16 (rsp->length); ha->init_cb->request_q_address[0 ] =cpu_to_le32 (LSD (req->dma));@@ -2095,8 +2095,8 @@ qla24xx_config_rings(struct scsi_qla_host *vha)/* Setup ring parameters in initialization control block. */ icb = (struct init_cb_24xx *)ha->init_cb; - icb->request_q_outpointer =__constant_cpu_to_le16 (0 ); - icb->response_q_inpointer =__constant_cpu_to_le16 (0 ); + icb->request_q_outpointer =cpu_to_le16 (0 ); + icb->response_q_inpointer =cpu_to_le16 (0 ); icb->request_q_length =cpu_to_le16 (req->length); icb->response_q_length =cpu_to_le16 (rsp->length); icb->request_q_address[0 ] =cpu_to_le32 (LSD (req->dma));@@ -2105,18 +2105,17 @@ qla24xx_config_rings(struct scsi_qla_host *vha) icb->response_q_address[1 ] =cpu_to_le32 (MSD (rsp->dma));/* Setup ATIO queue dma pointers for target mode */ - icb->atio_q_inpointer =__constant_cpu_to_le16 (0 ); + icb->atio_q_inpointer =cpu_to_le16 (0 ); icb->atio_q_length =cpu_to_le16 (ha->tgt.atio_q_length); icb->atio_q_address[0 ] =cpu_to_le32 (LSD (ha->tgt.atio_dma)); icb->atio_q_address[1 ] =cpu_to_le32 (MSD (ha->tgt.atio_dma));if (IS_SHADOW_REG_CAPABLE (ha)) - icb->firmware_options_2 |= -__constant_cpu_to_le32 (BIT_30 |BIT_29 ); + icb->firmware_options_2 |=cpu_to_le32 (BIT_30 |BIT_29 );if (ha->mqenable ||IS_QLA83XX (ha) ||IS_QLA27XX (ha)) { - icb->qos =__constant_cpu_to_le16 (QLA_DEFAULT_QUE_QOS ); - icb->rid =__constant_cpu_to_le16 (rid); + icb->qos =cpu_to_le16 (QLA_DEFAULT_QUE_QOS ); + icb->rid =cpu_to_le16 (rid);if (ha->flags.msix_enabled) { msix = &ha->msix_entries[1 ]; ql_dbg(ql_dbg_init, vha, 0x00fd,@@ -2126,26 +2125,22 @@ qla24xx_config_rings(struct scsi_qla_host *vha) }/* Use alternate PCI bus number */ if (MSB (rid)) - icb->firmware_options_2 |= -__constant_cpu_to_le32 (BIT_19 ); + icb->firmware_options_2 |=cpu_to_le32 (BIT_19 );/* Use alternate PCI devfn */ if (LSB (rid)) - icb->firmware_options_2 |= -__constant_cpu_to_le32 (BIT_18 ); + icb->firmware_options_2 |=cpu_to_le32 (BIT_18 );/* Use Disable MSIX Handshake mode for capable adapters */ if ((ha->fw_attributes &BIT_6 ) && (IS_MSIX_NACK_CAPABLE (ha)) && (ha->flags.msix_enabled)) { - icb->firmware_options_2 &= -__constant_cpu_to_le32 (~BIT_22 ); + icb->firmware_options_2 &=cpu_to_le32 (~BIT_22 ); ha->flags.disable_msix_handshake =1 ;ql_dbg (ql_dbg_init, vha,0x00fe ,"MSIX Handshake Disable Mode turned on.\n" ); }else { - icb->firmware_options_2 |= -__constant_cpu_to_le32 (BIT_22 ); + icb->firmware_options_2 |=cpu_to_le32 (BIT_22 ); } - icb->firmware_options_2 |=__constant_cpu_to_le32 (BIT_23 ); + icb->firmware_options_2 |=cpu_to_le32 (BIT_23 );WRT_REG_DWORD (®->isp25mq.req_q_in,0 );WRT_REG_DWORD (®->isp25mq.req_q_out,0 );@@ -2243,7 +2238,7 @@ qla2x00_init_rings(scsi_qla_host_t *vha) }if (IS_FWI2_CAPABLE (ha)) { - mid_init_cb->options =__constant_cpu_to_le16 (BIT_1 ); + mid_init_cb->options =cpu_to_le16 (BIT_1 ); mid_init_cb->init_cb.execution_throttle =cpu_to_le16 (ha->fw_xcb_count);/* D-Port Status */ @@ -2672,8 +2667,8 @@ qla2x00_nvram_config(scsi_qla_host_t *vha) nv->frame_payload_size =1024 ; } - nv->max_iocb_allocation =__constant_cpu_to_le16 (256 ); - nv->execution_throttle =__constant_cpu_to_le16 (16 ); + nv->max_iocb_allocation =cpu_to_le16 (256 ); + nv->execution_throttle =cpu_to_le16 (16 ); nv->retry_count =8 ; nv->retry_delay =1 ;@@ -2691,7 +2686,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha) nv->host_p[1 ] =BIT_2 ; nv->reset_delay =5 ; nv->port_down_retry_count =8 ; - nv->max_luns_per_target =__constant_cpu_to_le16 (8 ); + nv->max_luns_per_target =cpu_to_le16 (8 ); nv->link_down_timeout =60 ; rval =1 ;@@ -2819,7 +2814,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)memcpy (vha->node_name, icb->node_name,WWN_SIZE );memcpy (vha->port_name, icb->port_name,WWN_SIZE ); - icb->execution_throttle =__constant_cpu_to_le16 (0xFFFF ); + icb->execution_throttle =cpu_to_le16 (0xFFFF ); ha->retry_count = nv->retry_count;@@ -2871,10 +2866,10 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)if (ql2xloginretrycount) ha->login_retry_count = ql2xloginretrycount; - icb->lun_enables =__constant_cpu_to_le16 (0 ); + icb->lun_enables =cpu_to_le16 (0 ); icb->command_resource_count =0 ; icb->immediate_notify_resource_count =0 ; - icb->timeout =__constant_cpu_to_le16 (0 ); + icb->timeout =cpu_to_le16 (0 );if (IS_QLA2100 (ha) ||IS_QLA2200 (ha)) {/* Enable RIO */ @@ -5005,7 +5000,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)/* Bad NVRAM data, set defaults parameters. */ if (chksum || nv->id[0 ] !='I' || nv->id[1 ] !='S' || nv->id[2 ] !='P' || nv->id[3 ] !=' ' || - nv->nvram_version <__constant_cpu_to_le16 (ICB_VERSION )) { + nv->nvram_version <cpu_to_le16 (ICB_VERSION )) {/* Reset NVRAM data. */ ql_log (ql_log_warn, vha,0x006b , "Inconsistent NVRAM detected: checksum=0x%x id=%c "@@ -5018,12 +5013,12 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)* Set default initialization control block. */ memset (nv,0 , ha->nvram_size); - nv->nvram_version =__constant_cpu_to_le16 (ICB_VERSION ); - nv->version =__constant_cpu_to_le16 (ICB_VERSION ); + nv->nvram_version =cpu_to_le16 (ICB_VERSION ); + nv->version =cpu_to_le16 (ICB_VERSION ); nv->frame_payload_size =2048 ; - nv->execution_throttle =__constant_cpu_to_le16 (0xFFFF ); - nv->exchange_count =__constant_cpu_to_le16 (0 ); - nv->hard_address =__constant_cpu_to_le16 (124 ); + nv->execution_throttle =cpu_to_le16 (0xFFFF ); + nv->exchange_count =cpu_to_le16 (0 ); + nv->hard_address =cpu_to_le16 (124 ); nv->port_name[0 ] =0x21 ; nv->port_name[1 ] =0x00 + ha->port_no +1 ; nv->port_name[2 ] =0x00 ;@@ -5041,29 +5036,29 @@ qla24xx_nvram_config(scsi_qla_host_t *vha) nv->node_name[6 ] =0x55 ; nv->node_name[7 ] =0x86 ;qla24xx_nvram_wwn_from_ofw (vha, nv); - nv->login_retry_count =__constant_cpu_to_le16 (8 ); - nv->interrupt_delay_timer =__constant_cpu_to_le16 (0 ); - nv->login_timeout =__constant_cpu_to_le16 (0 ); + nv->login_retry_count =cpu_to_le16 (8 ); + nv->interrupt_delay_timer =cpu_to_le16 (0 ); + nv->login_timeout =cpu_to_le16 (0 ); nv->firmware_options_1 = -__constant_cpu_to_le32 (BIT_14 |BIT_13 |BIT_2 |BIT_1 ); - nv->firmware_options_2 =__constant_cpu_to_le32 (2 <<4 ); - nv->firmware_options_2 |=__constant_cpu_to_le32 (BIT_12 ); - nv->firmware_options_3 =__constant_cpu_to_le32 (2 <<13 ); - nv->host_p =__constant_cpu_to_le32 (BIT_11 |BIT_10 ); - nv->efi_parameters =__constant_cpu_to_le32 (0 ); +cpu_to_le32 (BIT_14 |BIT_13 |BIT_2 |BIT_1 ); + nv->firmware_options_2 =cpu_to_le32 (2 <<4 ); + nv->firmware_options_2 |=cpu_to_le32 (BIT_12 ); + nv->firmware_options_3 =cpu_to_le32 (2 <<13 ); + nv->host_p =cpu_to_le32 (BIT_11 |BIT_10 ); + nv->efi_parameters =cpu_to_le32 (0 ); nv->reset_delay =5 ; - nv->max_luns_per_target =__constant_cpu_to_le16 (128 ); - nv->port_down_retry_count =__constant_cpu_to_le16 (30 ); - nv->link_down_timeout =__constant_cpu_to_le16 (30 ); + nv->max_luns_per_target =cpu_to_le16 (128 ); + nv->port_down_retry_count =cpu_to_le16 (30 ); + nv->link_down_timeout =cpu_to_le16 (30 ); rval =1 ; }if (!qla_ini_mode_enabled (vha)) {/* Don't enable full login after initial LIP */ - nv->firmware_options_1 &=__constant_cpu_to_le32 (~BIT_13 ); + nv->firmware_options_1 &=cpu_to_le32 (~BIT_13 );/* Don't enable LIP full login for initiator */ - nv->host_p &=__constant_cpu_to_le32 (~BIT_10 ); + nv->host_p &=cpu_to_le32 (~BIT_10 ); }qlt_24xx_config_nvram_stage1 (vha, nv);@@ -5097,14 +5092,14 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)qlt_24xx_config_nvram_stage2 (vha, icb); -if (nv->host_p &__constant_cpu_to_le32 (BIT_15 )) { +if (nv->host_p &cpu_to_le32 (BIT_15 )) {/* Use alternate WWN? */ memcpy (icb->node_name, nv->alternate_node_name,WWN_SIZE );memcpy (icb->port_name, nv->alternate_port_name,WWN_SIZE ); }/* Prepare nodename */ -if ((icb->firmware_options_1 &__constant_cpu_to_le32 (BIT_14 )) ==0 ) { +if ((icb->firmware_options_1 &cpu_to_le32 (BIT_14 )) ==0 ) {/* * Firmware will apply the following mask if the nodename was * not provided. @@ -5136,7 +5131,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)memcpy (vha->node_name, icb->node_name,WWN_SIZE );memcpy (vha->port_name, icb->port_name,WWN_SIZE ); - icb->execution_throttle =__constant_cpu_to_le16 (0xFFFF ); + icb->execution_throttle =cpu_to_le16 (0xFFFF ); ha->retry_count =le16_to_cpu (nv->login_retry_count);@@ -5144,7 +5139,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha)if (le16_to_cpu (nv->login_timeout) < ql2xlogintimeout) nv->login_timeout =cpu_to_le16 (ql2xlogintimeout);if (le16_to_cpu (nv->login_timeout) <4 ) - nv->login_timeout =__constant_cpu_to_le16 (4 ); + nv->login_timeout =cpu_to_le16 (4 ); ha->login_timeout =le16_to_cpu (nv->login_timeout); icb->login_timeout = nv->login_timeout;@@ -5195,7 +5190,7 @@ qla24xx_nvram_config(scsi_qla_host_t *vha) ha->zio_timer =le16_to_cpu (icb->interrupt_delay_timer) ?le16_to_cpu (icb->interrupt_delay_timer):2 ; } - icb->firmware_options_2 &=__constant_cpu_to_le32 ( + icb->firmware_options_2 &=cpu_to_le32 ( ~(BIT_3 |BIT_2 |BIT_1 |BIT_0 )); vha->flags.process_response_queue =0 ;if (ha->zio_mode !=QLA_ZIO_DISABLED ) {@@ -5951,7 +5946,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)/* Bad NVRAM data, set defaults parameters. */ if (chksum || nv->id[0 ] !='I' || nv->id[1 ] !='S' || nv->id[2 ] !='P' || nv->id[3 ] !=' ' || - nv->nvram_version <__constant_cpu_to_le16 (ICB_VERSION )) { + nv->nvram_version <cpu_to_le16 (ICB_VERSION )) {/* Reset NVRAM data. */ ql_log (ql_log_info, vha,0x0073 , "Inconsistent NVRAM detected: checksum=0x%x id=%c "@@ -5965,11 +5960,11 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)* Set default initialization control block. */ memset (nv,0 , ha->nvram_size); - nv->nvram_version =__constant_cpu_to_le16 (ICB_VERSION ); - nv->version =__constant_cpu_to_le16 (ICB_VERSION ); + nv->nvram_version =cpu_to_le16 (ICB_VERSION ); + nv->version =cpu_to_le16 (ICB_VERSION ); nv->frame_payload_size =2048 ; - nv->execution_throttle =__constant_cpu_to_le16 (0xFFFF ); - nv->exchange_count =__constant_cpu_to_le16 (0 ); + nv->execution_throttle =cpu_to_le16 (0xFFFF ); + nv->exchange_count =cpu_to_le16 (0 ); nv->port_name[0 ] =0x21 ; nv->port_name[1 ] =0x00 + ha->port_no +1 ; nv->port_name[2 ] =0x00 ;@@ -5986,20 +5981,20 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) nv->node_name[5 ] =0x1c ; nv->node_name[6 ] =0x55 ; nv->node_name[7 ] =0x86 ; - nv->login_retry_count =__constant_cpu_to_le16 (8 ); - nv->interrupt_delay_timer =__constant_cpu_to_le16 (0 ); - nv->login_timeout =__constant_cpu_to_le16 (0 ); + nv->login_retry_count =cpu_to_le16 (8 ); + nv->interrupt_delay_timer =cpu_to_le16 (0 ); + nv->login_timeout =cpu_to_le16 (0 ); nv->firmware_options_1 = -__constant_cpu_to_le32 (BIT_14 |BIT_13 |BIT_2 |BIT_1 ); - nv->firmware_options_2 =__constant_cpu_to_le32 (2 <<4 ); - nv->firmware_options_2 |=__constant_cpu_to_le32 (BIT_12 ); - nv->firmware_options_3 =__constant_cpu_to_le32 (2 <<13 ); - nv->host_p =__constant_cpu_to_le32 (BIT_11 |BIT_10 ); - nv->efi_parameters =__constant_cpu_to_le32 (0 ); +cpu_to_le32 (BIT_14 |BIT_13 |BIT_2 |BIT_1 ); + nv->firmware_options_2 =cpu_to_le32 (2 <<4 ); + nv->firmware_options_2 |=cpu_to_le32 (BIT_12 ); + nv->firmware_options_3 =cpu_to_le32 (2 <<13 ); + nv->host_p =cpu_to_le32 (BIT_11 |BIT_10 ); + nv->efi_parameters =cpu_to_le32 (0 ); nv->reset_delay =5 ; - nv->max_luns_per_target =__constant_cpu_to_le16 (128 ); - nv->port_down_retry_count =__constant_cpu_to_le16 (30 ); - nv->link_down_timeout =__constant_cpu_to_le16 (180 ); + nv->max_luns_per_target =cpu_to_le16 (128 ); + nv->port_down_retry_count =cpu_to_le16 (30 ); + nv->link_down_timeout =cpu_to_le16 (180 ); nv->enode_mac[0 ] =0x00 ; nv->enode_mac[1 ] =0xC0 ; nv->enode_mac[2 ] =0xDD ;@@ -6058,13 +6053,13 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)qlt_81xx_config_nvram_stage2 (vha, icb);/* Use alternate WWN? */ -if (nv->host_p &__constant_cpu_to_le32 (BIT_15 )) { +if (nv->host_p &cpu_to_le32 (BIT_15 )) {memcpy (icb->node_name, nv->alternate_node_name,WWN_SIZE );memcpy (icb->port_name, nv->alternate_port_name,WWN_SIZE ); }/* Prepare nodename */ -if ((icb->firmware_options_1 &__constant_cpu_to_le32 (BIT_14 )) ==0 ) { +if ((icb->firmware_options_1 &cpu_to_le32 (BIT_14 )) ==0 ) {/* * Firmware will apply the following mask if the nodename was * not provided. @@ -6093,7 +6088,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)memcpy (vha->node_name, icb->node_name,WWN_SIZE );memcpy (vha->port_name, icb->port_name,WWN_SIZE ); - icb->execution_throttle =__constant_cpu_to_le16 (0xFFFF ); + icb->execution_throttle =cpu_to_le16 (0xFFFF ); ha->retry_count =le16_to_cpu (nv->login_retry_count);@@ -6101,7 +6096,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)if (le16_to_cpu (nv->login_timeout) < ql2xlogintimeout) nv->login_timeout =cpu_to_le16 (ql2xlogintimeout);if (le16_to_cpu (nv->login_timeout) <4 ) - nv->login_timeout =__constant_cpu_to_le16 (4 ); + nv->login_timeout =cpu_to_le16 (4 ); ha->login_timeout =le16_to_cpu (nv->login_timeout); icb->login_timeout = nv->login_timeout;@@ -6147,7 +6142,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)/* if not running MSI-X we need handshaking on interrupts */ if (!vha->hw->flags.msix_enabled && (IS_QLA83XX (ha) ||IS_QLA27XX (ha))) - icb->firmware_options_2 |=__constant_cpu_to_le32 (BIT_22 ); + icb->firmware_options_2 |=cpu_to_le32 (BIT_22 );/* Enable ZIO. */ if (!vha->flags.init_done) {@@ -6156,7 +6151,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) ha->zio_timer =le16_to_cpu (icb->interrupt_delay_timer) ?le16_to_cpu (icb->interrupt_delay_timer):2 ; } - icb->firmware_options_2 &=__constant_cpu_to_le32 ( + icb->firmware_options_2 &=cpu_to_le32 ( ~(BIT_3 |BIT_2 |BIT_1 |BIT_0 )); vha->flags.process_response_queue =0 ;if (ha->zio_mode !=QLA_ZIO_DISABLED ) {drivers/scsi/qla2xxx/qla_iocb.c +38
-50@@ -108,8 +108,7 @@ qla2x00_prep_cont_type0_iocb(struct scsi_qla_host *vha) cont_pkt = (cont_entry_t *)req->ring_ptr;/* Load packet defaults. */ - *((uint32_t *)(&cont_pkt->entry_type)) = -__constant_cpu_to_le32 (CONTINUE_TYPE ); + *((uint32_t *)(&cont_pkt->entry_type)) =cpu_to_le32 (CONTINUE_TYPE );return (cont_pkt); }@@ -138,8 +137,8 @@ qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *vha, struct req_que *req)/* Load packet defaults. */ *((uint32_t *)(&cont_pkt->entry_type)) =IS_QLAFX00 (vha->hw) ? -__constant_cpu_to_le32 (CONTINUE_A64_TYPE_FX00 ) : -__constant_cpu_to_le32 (CONTINUE_A64_TYPE ); +cpu_to_le32 (CONTINUE_A64_TYPE_FX00 ) : +cpu_to_le32 (CONTINUE_A64_TYPE );return (cont_pkt); }@@ -204,11 +203,11 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,/* Update entry type to indicate Command Type 2 IOCB */ *((uint32_t *)(&cmd_pkt->entry_type)) = -__constant_cpu_to_le32 (COMMAND_TYPE ); +cpu_to_le32 (COMMAND_TYPE );/* No data transfer */ if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) { - cmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + cmd_pkt->byte_count =cpu_to_le32 (0 );return ; }@@ -261,12 +260,11 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt, cmd =GET_CMD_SP (sp);/* Update entry type to indicate Command Type 3 IOCB */ - *((uint32_t *)(&cmd_pkt->entry_type)) = -__constant_cpu_to_le32 (COMMAND_A64_TYPE ); + *((uint32_t *)(&cmd_pkt->entry_type)) =cpu_to_le32 (COMMAND_A64_TYPE );/* No data transfer */ if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) { - cmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + cmd_pkt->byte_count =cpu_to_le32 (0 );return ; }@@ -402,7 +400,7 @@ qla2x00_start_scsi(srb_t *sp)/* Set target ID and LUN number*/ SET_TARGET_ID (ha, cmd_pkt->target, sp->fcport->loop_id); cmd_pkt->lun =cpu_to_le16 (cmd->device->lun); - cmd_pkt->control_flags =__constant_cpu_to_le16 (CF_SIMPLE_TAG ); + cmd_pkt->control_flags =cpu_to_le16 (CF_SIMPLE_TAG );/* Load SCSI command packet. */ memcpy (cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len);@@ -596,12 +594,11 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt, cmd =GET_CMD_SP (sp);/* Update entry type to indicate Command Type 3 IOCB */ - *((uint32_t *)(&cmd_pkt->entry_type)) = -__constant_cpu_to_le32 (COMMAND_TYPE_6 ); + *((uint32_t *)(&cmd_pkt->entry_type)) =cpu_to_le32 (COMMAND_TYPE_6 );/* No data transfer */ if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) { - cmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + cmd_pkt->byte_count =cpu_to_le32 (0 );return 0 ; }@@ -610,13 +607,11 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt,/* Set transfer direction */ if (cmd->sc_data_direction ==DMA_TO_DEVICE ) { - cmd_pkt->control_flags = -__constant_cpu_to_le16 (CF_WRITE_DATA ); + cmd_pkt->control_flags =cpu_to_le16 (CF_WRITE_DATA ); vha->qla_stats.output_bytes +=scsi_bufflen (cmd); vha->qla_stats.output_requests++; }else if (cmd->sc_data_direction ==DMA_FROM_DEVICE ) { - cmd_pkt->control_flags = -__constant_cpu_to_le16 (CF_READ_DATA ); + cmd_pkt->control_flags =cpu_to_le16 (CF_READ_DATA ); vha->qla_stats.input_bytes +=scsi_bufflen (cmd); vha->qla_stats.input_requests++; }@@ -713,12 +708,11 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt, cmd =GET_CMD_SP (sp);/* Update entry type to indicate Command Type 3 IOCB */ - *((uint32_t *)(&cmd_pkt->entry_type)) = -__constant_cpu_to_le32 (COMMAND_TYPE_7 ); + *((uint32_t *)(&cmd_pkt->entry_type)) =cpu_to_le32 (COMMAND_TYPE_7 );/* No data transfer */ if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) { - cmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + cmd_pkt->byte_count =cpu_to_le32 (0 );return ; }@@ -726,13 +720,11 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,/* Set transfer direction */ if (cmd->sc_data_direction ==DMA_TO_DEVICE ) { - cmd_pkt->task_mgmt_flags = -__constant_cpu_to_le16 (TMF_WRITE_DATA ); + cmd_pkt->task_mgmt_flags =cpu_to_le16 (TMF_WRITE_DATA ); vha->qla_stats.output_bytes +=scsi_bufflen (cmd); vha->qla_stats.output_requests++; }else if (cmd->sc_data_direction ==DMA_FROM_DEVICE ) { - cmd_pkt->task_mgmt_flags = -__constant_cpu_to_le16 (TMF_READ_DATA ); + cmd_pkt->task_mgmt_flags =cpu_to_le16 (TMF_READ_DATA ); vha->qla_stats.input_bytes +=scsi_bufflen (cmd); vha->qla_stats.input_requests++; }@@ -806,7 +798,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,* match LBA in CDB + N */ case SCSI_PROT_DIF_TYPE2 : - pkt->app_tag =__constant_cpu_to_le16 (0 ); + pkt->app_tag =cpu_to_le16 (0 ); pkt->app_tag_mask[0 ] =0x0 ; pkt->app_tag_mask[1 ] =0x0 ;@@ -837,7 +829,7 @@ qla24xx_set_t10dif_tags(srb_t *sp, struct fw_dif_context *pkt,case SCSI_PROT_DIF_TYPE1 : pkt->ref_tag =cpu_to_le32 ((uint32_t ) (0xffffffff &scsi_get_lba (cmd))); - pkt->app_tag =__constant_cpu_to_le16 (0 ); + pkt->app_tag =cpu_to_le16 (0 ); pkt->app_tag_mask[0 ] =0x0 ; pkt->app_tag_mask[1 ] =0x0 ;@@ -1238,8 +1230,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, cmd =GET_CMD_SP (sp);/* Update entry type to indicate Command Type CRC_2 IOCB */ - *((uint32_t *)(&cmd_pkt->entry_type)) = -__constant_cpu_to_le32 (COMMAND_TYPE_CRC_2 ); + *((uint32_t *)(&cmd_pkt->entry_type)) =cpu_to_le32 (COMMAND_TYPE_CRC_2 ); vha = sp->fcport->vha; ha = vha->hw;@@ -1247,7 +1238,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,/* No data transfer */ data_bytes =scsi_bufflen (cmd);if (!data_bytes || cmd->sc_data_direction ==DMA_NONE ) { - cmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + cmd_pkt->byte_count =cpu_to_le32 (0 );return QLA_SUCCESS ; }@@ -1256,10 +1247,10 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,/* Set transfer direction */ if (cmd->sc_data_direction ==DMA_TO_DEVICE ) { cmd_pkt->control_flags = -__constant_cpu_to_le16 (CF_WRITE_DATA ); +cpu_to_le16 (CF_WRITE_DATA ); }else if (cmd->sc_data_direction ==DMA_FROM_DEVICE ) { cmd_pkt->control_flags = -__constant_cpu_to_le16 (CF_READ_DATA ); +cpu_to_le16 (CF_READ_DATA ); } if ((scsi_get_prot_op(cmd) == SCSI_PROT_READ_INSERT) ||@@ -1381,7 +1372,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, crc_ctx_pkt->blk_size =cpu_to_le16 (blk_size); crc_ctx_pkt->prot_opts =cpu_to_le16 (fw_prot_opts); crc_ctx_pkt->byte_count =cpu_to_le32 (data_bytes); - crc_ctx_pkt->guard_seed =__constant_cpu_to_le16 (0 ); + crc_ctx_pkt->guard_seed =cpu_to_le16 (0 );/* Fibre channel byte count */ cmd_pkt->byte_count =cpu_to_le32 (total_bytes); fcp_dl = (uint32_t *)(crc_ctx_pkt->fcp_cmnd.cdb + 16 +@@ -1389,13 +1380,12 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, *fcp_dl =htonl (total_bytes);if (!data_bytes || cmd->sc_data_direction ==DMA_NONE ) { - cmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + cmd_pkt->byte_count =cpu_to_le32 (0 );return QLA_SUCCESS ; }/* Walks data segments */ - cmd_pkt->control_flags |= -__constant_cpu_to_le16 (CF_DATA_SEG_DESCR_ENABLE ); + cmd_pkt->control_flags |=cpu_to_le16 (CF_DATA_SEG_DESCR_ENABLE );if (!bundling && tot_prot_dsds) { if (qla24xx_walk_and_build_sglist_no_difb(ha, sp,@@ -1407,8 +1397,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,if (bundling && tot_prot_dsds) {/* Walks dif segments */ - cmd_pkt->control_flags |= -__constant_cpu_to_le16 (CF_DIF_SEG_DESCR_ENABLE ); + cmd_pkt->control_flags |=cpu_to_le16 (CF_DIF_SEG_DESCR_ENABLE ); cur_dsd = (uint32_t *) &crc_ctx_pkt->u.bundling.dif_address;if (qla24xx_walk_and_build_prot_sglist (ha, sp, cur_dsd, tot_prot_dsds,NULL ))@@ -1740,7 +1729,7 @@ qla24xx_dif_start_scsi(srb_t *sp) cmd_pkt->entry_count = (uint8_t )req_cnt;/* Specify response queue number where completion should happen */ cmd_pkt->entry_status = (uint8_t ) rsp->id; - cmd_pkt->timeout =__constant_cpu_to_le16 (0 ); + cmd_pkt->timeout =cpu_to_le16 (0 );wmb ();/* Adjust ring index. */ @@ -2028,10 +2017,10 @@ qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) els_iocb->entry_status =0 ; els_iocb->handle = sp->handle; els_iocb->nport_handle =cpu_to_le16 (sp->fcport->loop_id); - els_iocb->tx_dsd_count =__constant_cpu_to_le16 (bsg_job->request_payload.sg_cnt); + els_iocb->tx_dsd_count =cpu_to_le16 (bsg_job->request_payload.sg_cnt); els_iocb->vp_index = sp->fcport->vha->vp_idx; els_iocb->sof_type =EST_SOFI3 ; - els_iocb->rx_dsd_count =__constant_cpu_to_le16 (bsg_job->reply_payload.sg_cnt); + els_iocb->rx_dsd_count =cpu_to_le16 (bsg_job->reply_payload.sg_cnt); els_iocb->opcode = sp->type == SRB_ELS_CMD_RPT ?@@ -2082,13 +2071,13 @@ qla2x00_ct_iocb(srb_t *sp, ms_iocb_entry_t *ct_iocb) ct_iocb->entry_status =0 ; ct_iocb->handle1 = sp->handle;SET_TARGET_ID (ha, ct_iocb->loop_id, sp->fcport->loop_id); - ct_iocb->status =__constant_cpu_to_le16 (0 ); - ct_iocb->control_flags =__constant_cpu_to_le16 (0 ); + ct_iocb->status =cpu_to_le16 (0 ); + ct_iocb->control_flags =cpu_to_le16 (0 ); ct_iocb->timeout =0 ; ct_iocb->cmd_dsd_count = -__constant_cpu_to_le16 (bsg_job->request_payload.sg_cnt); +cpu_to_le16 (bsg_job->request_payload.sg_cnt); ct_iocb->total_dsd_count = -__constant_cpu_to_le16 (bsg_job->request_payload.sg_cnt +1 ); +cpu_to_le16 (bsg_job->request_payload.sg_cnt +1 ); ct_iocb->req_bytecount =cpu_to_le32 (bsg_job->request_payload.payload_len); ct_iocb->rsp_bytecount =@@ -2161,13 +2150,13 @@ qla24xx_ct_iocb(srb_t *sp, struct ct_entry_24xx *ct_iocb) ct_iocb->nport_handle =cpu_to_le16 (sp->fcport->loop_id); ct_iocb->vp_index = sp->fcport->vha->vp_idx; - ct_iocb->comp_status =__constant_cpu_to_le16 (0 ); + ct_iocb->comp_status =cpu_to_le16 (0 ); ct_iocb->cmd_dsd_count = -__constant_cpu_to_le16 (bsg_job->request_payload.sg_cnt); +cpu_to_le16 (bsg_job->request_payload.sg_cnt); ct_iocb->timeout =0 ; ct_iocb->rsp_dsd_count = -__constant_cpu_to_le16 (bsg_job->reply_payload.sg_cnt); +cpu_to_le16 (bsg_job->reply_payload.sg_cnt); ct_iocb->rsp_byte_count =cpu_to_le32 (bsg_job->reply_payload.payload_len); ct_iocb->cmd_byte_count =@@ -2661,7 +2650,7 @@ qla25xx_build_bidir_iocb(srb_t *sp, struct scsi_qla_host *vha,/*Update entry type to indicate bidir command */ *((uint32_t *)(&cmd_pkt->entry_type)) = -__constant_cpu_to_le32 (COMMAND_BIDIRECTIONAL ); +cpu_to_le32 (COMMAND_BIDIRECTIONAL );/* Set the transfer direction, in this set both flags * Also set the BD_WRAP_BACK flag, firmware will take care @@ -2669,8 +2658,7 @@ qla25xx_build_bidir_iocb(srb_t *sp, struct scsi_qla_host *vha,*/ cmd_pkt->wr_dseg_count =cpu_to_le16 (bsg_job->request_payload.sg_cnt); cmd_pkt->rd_dseg_count =cpu_to_le16 (bsg_job->reply_payload.sg_cnt); - cmd_pkt->control_flags = -__constant_cpu_to_le16 (BD_WRITE_DATA |BD_READ_DATA | + cmd_pkt->control_flags =cpu_to_le16 (BD_WRITE_DATA |BD_READ_DATA |BD_WRAP_BACK ); req_data_len = rsp_data_len = bsg_job->request_payload.payload_len;drivers/scsi/qla2xxx/qla_isr.c +1
-1@@ -1564,7 +1564,7 @@ qla24xx_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, void *tsk)"Async-%s error - hdl=%x entry-status(%x).\n" , type, sp->handle, sts->entry_status); iocb->u.tmf.data =QLA_FUNCTION_FAILED ; - }else if (sts->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (sts->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_log (ql_log_warn, fcport->vha,0x5039 ,"Async-%s error - hdl=%x completion status(%x).\n" , type, sp->handle, sts->comp_status);drivers/scsi/qla2xxx/qla_mbx.c +12
-13@@ -1886,11 +1886,11 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, lg->entry_count =1 ; lg->handle =MAKE_HANDLE (req->id, lg->handle); lg->nport_handle =cpu_to_le16 (loop_id); - lg->control_flags =__constant_cpu_to_le16 (LCF_COMMAND_PLOGI ); + lg->control_flags =cpu_to_le16 (LCF_COMMAND_PLOGI );if (opt &BIT_0 ) - lg->control_flags |=__constant_cpu_to_le16 (LCF_COND_PLOGI ); + lg->control_flags |=cpu_to_le16 (LCF_COND_PLOGI );if (opt &BIT_1 ) - lg->control_flags |=__constant_cpu_to_le16 (LCF_SKIP_PRLI ); + lg->control_flags |=cpu_to_le16 (LCF_SKIP_PRLI ); lg->port_id[0 ] = al_pa; lg->port_id[1 ] = area; lg->port_id[2 ] = domain;@@ -1905,7 +1905,7 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,"Failed to complete IOCB -- error status (%x).\n" , lg->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (lg->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (lg->comp_status !=cpu_to_le16 (CS_COMPLETE )) { iop[0 ] =le32_to_cpu (lg->io_parameter[0 ]); iop[1 ] =le32_to_cpu (lg->io_parameter[1 ]);@@ -1959,7 +1959,7 @@ qla24xx_login_fabric(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, mb[10 ] |=BIT_0 ;/* Class 2. */ if (lg->io_parameter[9 ] || lg->io_parameter[10 ]) mb[10 ] |=BIT_1 ;/* Class 3. */ -if (lg->io_parameter[0 ] &__constant_cpu_to_le32 (BIT_7 )) +if (lg->io_parameter[0 ] &cpu_to_le32 (BIT_7 )) mb[10 ] |=BIT_7 ;/* Confirmed Completion * Allowed */ @@ -2161,7 +2161,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain, lg->handle =MAKE_HANDLE (req->id, lg->handle); lg->nport_handle =cpu_to_le16 (loop_id); lg->control_flags = -__constant_cpu_to_le16 (LCF_COMMAND_LOGO |LCF_IMPL_LOGO | +cpu_to_le16 (LCF_COMMAND_LOGO |LCF_IMPL_LOGO |LCF_FREE_NPORT ); lg->port_id[0 ] = al_pa; lg->port_id[1 ] = area;@@ -2177,7 +2177,7 @@ qla24xx_fabric_logout(scsi_qla_host_t *vha, uint16_t loop_id, uint8_t domain,"Failed to complete IOCB -- error status (%x).\n" , lg->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (lg->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (lg->comp_status !=cpu_to_le16 (CS_COMPLETE )) { ql_dbg(ql_dbg_mbx, vha, 0x1071, "Failed to complete IOCB -- completion status (%x) " "ioparam=%x/%x.\n", le16_to_cpu(lg->comp_status),@@ -2668,7 +2668,7 @@ qla24xx_abort_command(srb_t *sp)"Failed to complete IOCB -- error status (%x).\n" , abt->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (abt->nport_handle !=__constant_cpu_to_le16 (0 )) { + }else if (abt->nport_handle !=cpu_to_le16 (0 )) {ql_dbg (ql_dbg_mbx, vha,0x1090 ,"Failed to complete IOCB -- completion status (%x).\n" ,le16_to_cpu (abt->nport_handle));@@ -2751,8 +2751,7 @@ __qla24xx_issue_tmf(char *name, uint32_t type, struct fc_port *fcport,"Failed to complete IOCB -- error status (%x).\n" , sts->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (sts->comp_status != -__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (sts->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_dbg (ql_dbg_mbx, vha,0x1096 ,"Failed to complete IOCB -- completion status (%x).\n" ,le16_to_cpu (sts->comp_status));@@ -3478,7 +3477,7 @@ qla24xx_modify_vp_config(scsi_qla_host_t *vha)"Failed to complete IOCB -- error status (%x).\n" , vpmod->comp_status); rval =QLA_FUNCTION_FAILED ; - }else if (vpmod->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (vpmod->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_dbg (ql_dbg_mbx, vha,0x10bf ,"Failed to complete IOCB -- completion status (%x).\n" ,le16_to_cpu (vpmod->comp_status));@@ -3537,7 +3536,7 @@ qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) vce->entry_type =VP_CTRL_IOCB_TYPE ; vce->entry_count =1 ; vce->command =cpu_to_le16 (cmd); - vce->vp_count =__constant_cpu_to_le16 (1 ); + vce->vp_count =cpu_to_le16 (1 );/* index map in firmware starts with 1; decrement index * this is ok as we never use index 0 @@ -3557,7 +3556,7 @@ qla24xx_control_vp(scsi_qla_host_t *vha, int cmd)"Failed to complete IOCB -- error status (%x).\n" , vce->entry_status); rval =QLA_FUNCTION_FAILED ; - }else if (vce->comp_status !=__constant_cpu_to_le16 (CS_COMPLETE )) { + }else if (vce->comp_status !=cpu_to_le16 (CS_COMPLETE )) {ql_dbg (ql_dbg_mbx, vha,0x10c5 ,"Failed to complet IOCB -- completion status (%x).\n" ,le16_to_cpu (vce->comp_status));drivers/scsi/qla2xxx/qla_mr.c +1
-1@@ -3007,7 +3007,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt,/* No data transfer */ if (!scsi_bufflen (cmd) || cmd->sc_data_direction ==DMA_NONE ) { - lcmd_pkt->byte_count =__constant_cpu_to_le32 (0 ); + lcmd_pkt->byte_count =cpu_to_le32 (0 );return ; }drivers/scsi/qla2xxx/qla_nx.c +3
-3@@ -1765,8 +1765,8 @@ void qla82xx_config_rings(struct scsi_qla_host *vha)/* Setup ring parameters in initialization control block. */ icb = (struct init_cb_81xx *)ha->init_cb; - icb->request_q_outpointer =__constant_cpu_to_le16 (0 ); - icb->response_q_inpointer =__constant_cpu_to_le16 (0 ); + icb->request_q_outpointer =cpu_to_le16 (0 ); + icb->response_q_inpointer =cpu_to_le16 (0 ); icb->request_q_length =cpu_to_le16 (req->length); icb->response_q_length =cpu_to_le16 (rsp->length); icb->request_q_address[0 ] =cpu_to_le32 (LSD (req->dma));@@ -2546,7 +2546,7 @@ qla82xx_read_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr, "Do ROM fast read failed.\n"); goto done_read; } - dwptr[i] =__constant_cpu_to_le32 (val); + dwptr[i] =cpu_to_le32 (val); } done_read:return dwptr;drivers/scsi/qla2xxx/qla_sup.c +7
-7@@ -316,7 +316,7 @@ qla2x00_clear_nvram_protection(struct qla_hw_data *ha) wprot_old =cpu_to_le16 (qla2x00_get_nvram_word (ha, ha->nvram_base)); stat =qla2x00_write_nvram_word_tmo (ha, ha->nvram_base, -__constant_cpu_to_le16 (0x1234 ),100000 ); +cpu_to_le16 (0x1234 ),100000 ); wprot =cpu_to_le16 (qla2x00_get_nvram_word (ha, ha->nvram_base));if (stat !=QLA_SUCCESS || wprot !=0x1234 ) {/* Write enable. */ @@ -691,9 +691,9 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) region = (struct qla_flt_region *)&flt[1 ]; ha->isp_ops->read_optrom (vha, (uint8_t *)req->ring, flt_addr <<2 ,OPTROM_BURST_SIZE ); -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data; -if (flt->version !=__constant_cpu_to_le16 (1 )) { +if (flt->version !=cpu_to_le16 (1 )) { ql_log(ql_log_warn, vha, 0x0047, "Unsupported FLT detected: version=0x%x length=0x%x checksum=0x%x.\n", le16_to_cpu(flt->version), le16_to_cpu(flt->length),@@ -892,7 +892,7 @@ qla2xxx_get_fdt_info(scsi_qla_host_t *vha) fdt = (struct qla_fdt_layout *)req->ring; ha->isp_ops->read_optrom (vha, (uint8_t *)req->ring, ha->flt_region_fdt <<2 ,OPTROM_BURST_SIZE ); -if (*wptr ==__constant_cpu_to_le16 (0xffff )) +if (*wptr ==cpu_to_le16 (0xffff )) goto no_flash_data;if (fdt->sig[0 ] !='Q' || fdt->sig[1 ] !='L' || fdt->sig[2 ] !='I' || fdt->sig[3 ] !='D' )@@ -991,7 +991,7 @@ qla2xxx_get_idc_param(scsi_qla_host_t *vha) ha->isp_ops->read_optrom (vha, (uint8_t *)req->ring,QLA82XX_IDC_PARAM_ADDR ,8 ); -if (*wptr ==__constant_cpu_to_le32 (0xffffffff )) { +if (*wptr ==cpu_to_le32 (0xffffffff )) { ha->fcoe_dev_init_timeout =QLA82XX_ROM_DEV_INIT_TIMEOUT ; ha->fcoe_reset_timeout =QLA82XX_ROM_DRV_RESET_ACK_TIMEOUT ; }else {@@ -1051,9 +1051,9 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) ha->isp_ops->read_optrom (vha, (uint8_t *)&hdr, ha->flt_region_npiv_conf <<2 ,sizeof (struct qla_npiv_header )); -if (hdr.version ==__constant_cpu_to_le16 (0xffff )) +if (hdr.version ==cpu_to_le16 (0xffff ))return ; -if (hdr.version !=__constant_cpu_to_le16 (1 )) { +if (hdr.version !=cpu_to_le16 (1 )) { ql_dbg(ql_dbg_user, vha, 0x7090, "Unsupported NPIV-Config " "detected: version=0x%x entries=0x%x checksum=0x%x.\n",drivers/scsi/qla2xxx/qla_target.c +56
-60@@ -1023,7 +1023,7 @@ static void qlt_send_notify_ack(struct scsi_qla_host *vha, nack->u.isp24.nport_handle = ntfy->u.isp24.nport_handle;if (le16_to_cpu (ntfy->u.isp24.status) ==IMM_NTFY_ELS ) { nack->u.isp24.flags = ntfy->u.isp24.flags & -__constant_cpu_to_le32 (NOTIFY24XX_FLAGS_PUREX_IOCB ); +cpu_to_le32 (NOTIFY24XX_FLAGS_PUREX_IOCB ); } nack->u.isp24.srr_rx_id = ntfy->u.isp24.srr_rx_id; nack->u.isp24.status = ntfy->u.isp24.status;@@ -1081,7 +1081,7 @@ static void qlt_24xx_send_abts_resp(struct scsi_qla_host *vha, resp->sof_type = abts->sof_type; resp->exchange_address = abts->exchange_address; resp->fcp_hdr_le = abts->fcp_hdr_le; - f_ctl =__constant_cpu_to_le32 (F_CTL_EXCH_CONTEXT_RESP | + f_ctl =cpu_to_le32 (F_CTL_EXCH_CONTEXT_RESP |F_CTL_LAST_SEQ |F_CTL_END_SEQ |F_CTL_SEQ_INITIATIVE ); p = (uint8_t *)&f_ctl;@@ -1156,15 +1156,14 @@ static void qlt_24xx_retry_term_exchange(struct scsi_qla_host *vha, ctio->entry_count =1 ; ctio->nport_handle = entry->nport_handle; ctio->handle =QLA_TGT_SKIP_HANDLE |CTIO_COMPLETION_HANDLE_MARK ; - ctio->timeout =__constant_cpu_to_le16 (QLA_TGT_TIMEOUT ); + ctio->timeout =cpu_to_le16 (QLA_TGT_TIMEOUT ); ctio->vp_index = vha->vp_idx; ctio->initiator_id[0 ] = entry->fcp_hdr_le.d_id[0 ]; ctio->initiator_id[1 ] = entry->fcp_hdr_le.d_id[1 ]; ctio->initiator_id[2 ] = entry->fcp_hdr_le.d_id[2 ]; ctio->exchange_addr = entry->exchange_addr_to_abort; - ctio->u.status1.flags = -__constant_cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 | -CTIO7_FLAGS_TERMINATE ); + ctio->u.status1.flags =cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 | +CTIO7_FLAGS_TERMINATE ); ctio->u.status1.ox_id =cpu_to_le16 (entry->fcp_hdr_le.ox_id);/* Memory Barrier */ @@ -1324,20 +1323,19 @@ static void qlt_24xx_send_task_mgmt_ctio(struct scsi_qla_host *ha, ctio->entry_count =1 ; ctio->handle =QLA_TGT_SKIP_HANDLE |CTIO_COMPLETION_HANDLE_MARK ; ctio->nport_handle = mcmd->sess->loop_id; - ctio->timeout =__constant_cpu_to_le16 (QLA_TGT_TIMEOUT ); + ctio->timeout =cpu_to_le16 (QLA_TGT_TIMEOUT ); ctio->vp_index = ha->vp_idx; ctio->initiator_id[0 ] = atio->u.isp24.fcp_hdr.s_id[2 ]; ctio->initiator_id[1 ] = atio->u.isp24.fcp_hdr.s_id[1 ]; ctio->initiator_id[2 ] = atio->u.isp24.fcp_hdr.s_id[0 ]; ctio->exchange_addr = atio->u.isp24.exchange_addr; ctio->u.status1.flags = (atio->u.isp24.attr <<9 ) | -__constant_cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 | -CTIO7_FLAGS_SEND_STATUS ); +cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 |CTIO7_FLAGS_SEND_STATUS ); temp =be16_to_cpu (atio->u.isp24.fcp_hdr.ox_id); ctio->u.status1.ox_id =cpu_to_le16 (temp); ctio->u.status1.scsi_status = -__constant_cpu_to_le16 (SS_RESPONSE_INFO_LEN_VALID ); - ctio->u.status1.response_len =__constant_cpu_to_le16 (8 ); +cpu_to_le16 (SS_RESPONSE_INFO_LEN_VALID ); + ctio->u.status1.response_len =cpu_to_le16 (8 ); ctio->u.status1.sense_data[0 ] = resp_code;/* Memory Barrier */ @@ -1588,7 +1586,7 @@ static int qlt_24xx_build_ctio_pkt(struct qla_tgt_prm *prm, pkt->handle = h |CTIO_COMPLETION_HANDLE_MARK ; pkt->nport_handle = prm->cmd->loop_id; - pkt->timeout =__constant_cpu_to_le16 (QLA_TGT_TIMEOUT ); + pkt->timeout =cpu_to_le16 (QLA_TGT_TIMEOUT ); pkt->initiator_id[0 ] = atio->u.isp24.fcp_hdr.s_id[2 ]; pkt->initiator_id[1 ] = atio->u.isp24.fcp_hdr.s_id[1 ]; pkt->initiator_id[2 ] = atio->u.isp24.fcp_hdr.s_id[0 ];@@ -1903,10 +1901,9 @@ static void qlt_24xx_init_ctio_to_isp(struct ctio7_to_24xx *ctio, { prm->sense_buffer_len =min_t (uint32_t, prm->sense_buffer_len, (uint32_t )sizeof (ctio->u.status1.sense_data)); - ctio->u.status0.flags |= -__constant_cpu_to_le16 (CTIO7_FLAGS_SEND_STATUS ); + ctio->u.status0.flags |=cpu_to_le16 (CTIO7_FLAGS_SEND_STATUS );if (qlt_need_explicit_conf (prm->tgt->ha, prm->cmd,0 )) { - ctio->u.status0.flags |=__constant_cpu_to_le16 ( + ctio->u.status0.flags |=cpu_to_le16 (CTIO7_FLAGS_EXPLICIT_CONFORM |CTIO7_FLAGS_CONFORM_REQ ); }@@ -1923,17 +1920,17 @@ static void qlt_24xx_init_ctio_to_isp(struct ctio7_to_24xx *ctio, "non GOOD status\n"); goto skip_explict_conf; } - ctio->u.status1.flags |=__constant_cpu_to_le16 ( + ctio->u.status1.flags |=cpu_to_le16 (CTIO7_FLAGS_EXPLICIT_CONFORM |CTIO7_FLAGS_CONFORM_REQ ); } skip_explict_conf: ctio->u.status1.flags &= - ~__constant_cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_0 ); + ~cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_0 ); ctio->u.status1.flags |= -__constant_cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 ); +cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 ); ctio->u.status1.scsi_status |= -__constant_cpu_to_le16 (SS_SENSE_LEN_VALID ); +cpu_to_le16 (SS_SENSE_LEN_VALID ); ctio->u.status1.sense_length =cpu_to_le16 (prm->sense_buffer_len);for (i =0 ; i < prm->sense_buffer_len/4 ; i++)@@ -1953,9 +1950,9 @@ skip_explict_conf:#endif }else { ctio->u.status1.flags &= - ~__constant_cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_0 ); + ~cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_0 ); ctio->u.status1.flags |= -__constant_cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 ); +cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 ); ctio->u.status1.sense_length =0 ;memset (ctio->u.status1.sense_data,0 ,sizeof (ctio->u.status1.sense_data));@@ -2182,7 +2179,7 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) pkt->handle = h |CTIO_COMPLETION_HANDLE_MARK ; pkt->nport_handle = prm->cmd->loop_id; - pkt->timeout =__constant_cpu_to_le16 (QLA_TGT_TIMEOUT ); + pkt->timeout =cpu_to_le16 (QLA_TGT_TIMEOUT ); pkt->initiator_id[0 ] = atio->u.isp24.fcp_hdr.s_id[2 ]; pkt->initiator_id[1 ] = atio->u.isp24.fcp_hdr.s_id[1 ]; pkt->initiator_id[2 ] = atio->u.isp24.fcp_hdr.s_id[0 ];@@ -2198,9 +2195,9 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha)/* Set transfer direction */ if (cmd->dma_data_direction ==DMA_TO_DEVICE ) - pkt->flags =__constant_cpu_to_le16 (CTIO7_FLAGS_DATA_IN ); + pkt->flags =cpu_to_le16 (CTIO7_FLAGS_DATA_IN );else if (cmd->dma_data_direction ==DMA_FROM_DEVICE ) - pkt->flags =__constant_cpu_to_le16 (CTIO7_FLAGS_DATA_OUT ); + pkt->flags =cpu_to_le16 (CTIO7_FLAGS_DATA_OUT ); pkt->dseg_count = prm->tot_dsds;@@ -2252,11 +2249,11 @@ qlt_build_ctio_crc2_pkt(struct qla_tgt_prm *prm, scsi_qla_host_t *vha) crc_ctx_pkt->blk_size =cpu_to_le16 (cmd->blk_sz); crc_ctx_pkt->prot_opts =cpu_to_le16 (fw_prot_opts); crc_ctx_pkt->byte_count =cpu_to_le32 (data_bytes); - crc_ctx_pkt->guard_seed =__constant_cpu_to_le16 (0 ); + crc_ctx_pkt->guard_seed =cpu_to_le16 (0 );/* Walks data segments */ - pkt->flags |=__constant_cpu_to_le16 (CTIO7_FLAGS_DSD_PTR ); + pkt->flags |=cpu_to_le16 (CTIO7_FLAGS_DSD_PTR );if (!bundling && prm->prot_seg_cnt) { if (qla24xx_walk_and_build_sglist_no_difb(ha, NULL, cur_dsd,@@ -2351,7 +2348,7 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type,if (qlt_has_data (cmd) && (xmit_type &QLA_TGT_XMIT_DATA )) { pkt->u.status0.flags |= -__constant_cpu_to_le16 (CTIO7_FLAGS_DATA_IN | +cpu_to_le16 (CTIO7_FLAGS_DATA_IN |CTIO7_FLAGS_STATUS_MODE_0 );if (cmd->se_cmd.prot_op ==TARGET_PROT_NORMAL )@@ -2363,11 +2360,11 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type,cpu_to_le16 (prm.rq_result); pkt->u.status0.residual =cpu_to_le32 (prm.residual); - pkt->u.status0.flags |=__constant_cpu_to_le16 ( + pkt->u.status0.flags |=cpu_to_le16 (CTIO7_FLAGS_SEND_STATUS );if (qlt_need_explicit_conf (ha, cmd,0 )) { pkt->u.status0.flags |= -__constant_cpu_to_le16 ( +cpu_to_le16 (CTIO7_FLAGS_EXPLICIT_CONFORM |CTIO7_FLAGS_CONFORM_REQ ); }@@ -2395,12 +2392,12 @@ int qlt_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, ctio->entry_count =1 ; ctio->entry_type =CTIO_TYPE7 ; ctio->dseg_count =0 ; - ctio->u.status1.flags &= ~__constant_cpu_to_le16 ( + ctio->u.status1.flags &= ~cpu_to_le16 (CTIO7_FLAGS_DATA_IN );/* Real finish is ctio_m1's finish */ pkt->handle |=CTIO_INTERMEDIATE_HANDLE_MARK ; - pkt->u.status0.flags |=__constant_cpu_to_le16 ( + pkt->u.status0.flags |=cpu_to_le16 (CTIO7_FLAGS_DONT_RET_CTIO );/* qlt_24xx_init_ctio_to_isp will correct @@ -2486,7 +2483,7 @@ int qlt_rdy_to_xfer(struct qla_tgt_cmd *cmd)if (unlikely (res !=0 )) goto out_unlock_free_unmap; pkt = (struct ctio7_to_24xx *)prm.pkt; - pkt->u.status0.flags |=__constant_cpu_to_le16 (CTIO7_FLAGS_DATA_OUT | + pkt->u.status0.flags |=cpu_to_le16 (CTIO7_FLAGS_DATA_OUT |CTIO7_FLAGS_STATUS_MODE_0 );if (cmd->se_cmd.prot_op ==TARGET_PROT_NORMAL )@@ -2684,14 +2681,14 @@ static int __qlt_send_term_exchange(struct scsi_qla_host *vha, ctio24 = (struct ctio7_to_24xx *)pkt; ctio24->entry_type =CTIO_TYPE7 ; ctio24->nport_handle = cmd ? cmd->loop_id :CTIO7_NHANDLE_UNRECOGNIZED ; - ctio24->timeout =__constant_cpu_to_le16 (QLA_TGT_TIMEOUT ); + ctio24->timeout =cpu_to_le16 (QLA_TGT_TIMEOUT ); ctio24->vp_index = vha->vp_idx; ctio24->initiator_id[0 ] = atio->u.isp24.fcp_hdr.s_id[2 ]; ctio24->initiator_id[1 ] = atio->u.isp24.fcp_hdr.s_id[1 ]; ctio24->initiator_id[2 ] = atio->u.isp24.fcp_hdr.s_id[0 ]; ctio24->exchange_addr = atio->u.isp24.exchange_addr; ctio24->u.status1.flags = (atio->u.isp24.attr <<9 ) | -__constant_cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 | +cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 |CTIO7_FLAGS_TERMINATE ); temp =be16_to_cpu (atio->u.isp24.fcp_hdr.ox_id); ctio24->u.status1.ox_id =cpu_to_le16 (temp);@@ -2912,7 +2909,7 @@ static int qlt_term_ctio_exchange(struct scsi_qla_host *vha, void *ctio,if (ctio !=NULL ) {struct ctio7_from_24xx *c = (struct ctio7_from_24xx *)ctio; term = !(c->flags & -__constant_cpu_to_le16 (OF_TERM_EXCH )); +cpu_to_le16 (OF_TERM_EXCH )); }else term =1 ;@@ -4311,14 +4308,14 @@ static int __qlt_send_busy(struct scsi_qla_host *vha, ctio24 = (struct ctio7_to_24xx *)pkt; ctio24->entry_type =CTIO_TYPE7 ; ctio24->nport_handle = sess->loop_id; - ctio24->timeout =__constant_cpu_to_le16 (QLA_TGT_TIMEOUT ); + ctio24->timeout =cpu_to_le16 (QLA_TGT_TIMEOUT ); ctio24->vp_index = vha->vp_idx; ctio24->initiator_id[0 ] = atio->u.isp24.fcp_hdr.s_id[2 ]; ctio24->initiator_id[1 ] = atio->u.isp24.fcp_hdr.s_id[1 ]; ctio24->initiator_id[2 ] = atio->u.isp24.fcp_hdr.s_id[0 ]; ctio24->exchange_addr = atio->u.isp24.exchange_addr; ctio24->u.status1.flags = (atio->u.isp24.attr <<9 ) | -__constant_cpu_to_le16 ( +cpu_to_le16 (CTIO7_FLAGS_STATUS_MODE_1 |CTIO7_FLAGS_SEND_STATUS |CTIO7_FLAGS_DONT_RET_CTIO );/* @@ -4646,7 +4643,7 @@ static void qlt_response_pkt(struct scsi_qla_host *vha, response_t *pkt)struct atio_from_isp *atio = (struct atio_from_isp *)pkt;int rc;if (atio->u.isp2x.status != -__constant_cpu_to_le16 (ATIO_CDB_VALID )) { +cpu_to_le16 (ATIO_CDB_VALID )) { ql_dbg(ql_dbg_tgt, vha, 0xe05e, "qla_target(%d): ATIO with error " "status %x received\n", vha->vp_idx,@@ -4720,7 +4717,7 @@ static void qlt_response_pkt(struct scsi_qla_host *vha, response_t *pkt) le16_to_cpu(entry->u.isp2x.status)); tgt->notify_ack_expected--;if (entry->u.isp2x.status != -__constant_cpu_to_le16 (NOTIFY_ACK_SUCCESS )) { +cpu_to_le16 (NOTIFY_ACK_SUCCESS )) { ql_dbg(ql_dbg_tgt, vha, 0xe061, "qla_target(%d): NOTIFY_ACK " "failed %x\n", vha->vp_idx,@@ -5583,19 +5580,19 @@ qlt_24xx_config_nvram_stage1(struct scsi_qla_host *vha, struct nvram_24xx *nv) ha->tgt.saved_set =1 ; } - nv->exchange_count =__constant_cpu_to_le16 (0xFFFF ); + nv->exchange_count =cpu_to_le16 (0xFFFF );/* Enable target mode */ - nv->firmware_options_1 |=__constant_cpu_to_le32 (BIT_4 ); + nv->firmware_options_1 |=cpu_to_le32 (BIT_4 );/* Disable ini mode, if requested */ if (!qla_ini_mode_enabled (vha)) - nv->firmware_options_1 |=__constant_cpu_to_le32 (BIT_5 ); + nv->firmware_options_1 |=cpu_to_le32 (BIT_5 );/* Disable Full Login after LIP */ - nv->firmware_options_1 &=__constant_cpu_to_le32 (~BIT_13 ); + nv->firmware_options_1 &=cpu_to_le32 (~BIT_13 );/* Enable initial LIP */ - nv->firmware_options_1 &=__constant_cpu_to_le32 (~BIT_9 ); + nv->firmware_options_1 &=cpu_to_le32 (~BIT_9 );if (ql2xtgt_tape_enable)/* Enable FC Tape support */ nv->firmware_options_2 |=cpu_to_le32 (BIT_12 );@@ -5604,9 +5601,9 @@ qlt_24xx_config_nvram_stage1(struct scsi_qla_host *vha, struct nvram_24xx *nv) nv->firmware_options_2 &=cpu_to_le32 (~BIT_12 );/* Disable Full Login after LIP */ - nv->host_p &=__constant_cpu_to_le32 (~BIT_10 ); + nv->host_p &=cpu_to_le32 (~BIT_10 );/* Enable target PRLI control */ - nv->firmware_options_2 |=__constant_cpu_to_le32 (BIT_14 ); + nv->firmware_options_2 |=cpu_to_le32 (BIT_14 ); }else {if (ha->tgt.saved_set) { nv->exchange_count = ha->tgt.saved_exchange_count;@@ -5628,12 +5625,12 @@ qlt_24xx_config_nvram_stage1(struct scsi_qla_host *vha, struct nvram_24xx *nv)fc_host_supported_classes (vha->host) =FC_COS_CLASS2 |FC_COS_CLASS3 ; - nv->firmware_options_2 |=__constant_cpu_to_le32 (BIT_8 ); + nv->firmware_options_2 |=cpu_to_le32 (BIT_8 ); }else {if (vha->flags.init_done)fc_host_supported_classes (vha->host) =FC_COS_CLASS3 ; - nv->firmware_options_2 &= ~__constant_cpu_to_le32 (BIT_8 ); + nv->firmware_options_2 &= ~cpu_to_le32 (BIT_8 ); } }@@ -5645,7 +5642,7 @@ qlt_24xx_config_nvram_stage2(struct scsi_qla_host *vha,if (ha->tgt.node_name_set) {memcpy (icb->node_name, ha->tgt.tgt_node_name,WWN_SIZE ); - icb->firmware_options_1 |=__constant_cpu_to_le32 (BIT_14 ); + icb->firmware_options_1 |=cpu_to_le32 (BIT_14 ); } }@@ -5670,20 +5667,19 @@ qlt_81xx_config_nvram_stage1(struct scsi_qla_host *vha, struct nvram_81xx *nv) ha->tgt.saved_set =1 ; } - nv->exchange_count =__constant_cpu_to_le16 (0xFFFF ); + nv->exchange_count =cpu_to_le16 (0xFFFF );/* Enable target mode */ - nv->firmware_options_1 |=__constant_cpu_to_le32 (BIT_4 ); + nv->firmware_options_1 |=cpu_to_le32 (BIT_4 );/* Disable ini mode, if requested */ if (!qla_ini_mode_enabled (vha)) - nv->firmware_options_1 |= -__constant_cpu_to_le32 (BIT_5 ); + nv->firmware_options_1 |=cpu_to_le32 (BIT_5 );/* Disable Full Login after LIP */ - nv->firmware_options_1 &=__constant_cpu_to_le32 (~BIT_13 ); + nv->firmware_options_1 &=cpu_to_le32 (~BIT_13 );/* Enable initial LIP */ - nv->firmware_options_1 &=__constant_cpu_to_le32 (~BIT_9 ); + nv->firmware_options_1 &=cpu_to_le32 (~BIT_9 );if (ql2xtgt_tape_enable)/* Enable FC tape support */ nv->firmware_options_2 |=cpu_to_le32 (BIT_12 );@@ -5692,9 +5688,9 @@ qlt_81xx_config_nvram_stage1(struct scsi_qla_host *vha, struct nvram_81xx *nv) nv->firmware_options_2 &=cpu_to_le32 (~BIT_12 );/* Disable Full Login after LIP */ - nv->host_p &=__constant_cpu_to_le32 (~BIT_10 ); + nv->host_p &=cpu_to_le32 (~BIT_10 );/* Enable target PRLI control */ - nv->firmware_options_2 |=__constant_cpu_to_le32 (BIT_14 ); + nv->firmware_options_2 |=cpu_to_le32 (BIT_14 ); }else {if (ha->tgt.saved_set) { nv->exchange_count = ha->tgt.saved_exchange_count;@@ -5716,12 +5712,12 @@ qlt_81xx_config_nvram_stage1(struct scsi_qla_host *vha, struct nvram_81xx *nv)fc_host_supported_classes (vha->host) =FC_COS_CLASS2 |FC_COS_CLASS3 ; - nv->firmware_options_2 |=__constant_cpu_to_le32 (BIT_8 ); + nv->firmware_options_2 |=cpu_to_le32 (BIT_8 ); }else {if (vha->flags.init_done)fc_host_supported_classes (vha->host) =FC_COS_CLASS3 ; - nv->firmware_options_2 &= ~__constant_cpu_to_le32 (BIT_8 ); + nv->firmware_options_2 &= ~cpu_to_le32 (BIT_8 ); } }@@ -5736,7 +5732,7 @@ qlt_81xx_config_nvram_stage2(struct scsi_qla_host *vha,if (ha->tgt.node_name_set) {memcpy (icb->node_name, ha->tgt.tgt_node_name,WWN_SIZE ); - icb->firmware_options_1 |=__constant_cpu_to_le32 (BIT_14 ); + icb->firmware_options_1 |=cpu_to_le32 (BIT_14 ); } }
PATCH v3 6/10 qla2xxx: Avoid that sparse complains about duplicate [noderef] attributes
In reply to Bart Van Assche--- drivers/scsi/qla2xxx/qla_dbg.c | 2 +- drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +1 -1
@@ -627,7 +627,7 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)uint32_t cnt, que_idx;uint8_t que_cnt;struct qla2xxx_mq_chain *mq = ptr; -device_reg_t __iomem *reg; +device_reg_t *reg;if (!ha->mqenable ||IS_QLA83XX (ha) ||IS_QLA27XX (ha))return ptr;
drivers/scsi/qla2xxx/qla_init.c +1 -1
@@ -2085,7 +2085,7 @@ void qla24xx_config_rings(struct scsi_qla_host *vha) {struct qla_hw_data *ha = vha->hw; -device_reg_t __iomem *reg =ISP_QUE_REG (ha,0 ); +device_reg_t *reg =ISP_QUE_REG (ha,0 );struct device_reg_2xxx __iomem *ioreg = &ha->iobase->isp;struct qla_msix_entry *msix;struct init_cb_24xx *icb;
drivers/scsi/qla2xxx/qla_iocb.c +2 -2
@@ -451,7 +451,7 @@ void qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req) { struct qla_hw_data *ha = vha->hw; -device_reg_t __iomem *reg =ISP_QUE_REG (ha, req->id); +device_reg_t *reg =ISP_QUE_REG (ha, req->id);if (IS_P3P_TYPE (ha)) {qla82xx_start_iocbs (vha);
@@ -1795,7 +1795,7 @@ qla2x00_alloc_iocbs(scsi_qla_host_t *vha, srb_t *sp) {struct qla_hw_data *ha = vha->hw;struct req_que *req = ha->req_q_map[0 ]; -device_reg_t __iomem *reg =ISP_QUE_REG (ha, req->id); +device_reg_t *reg =ISP_QUE_REG (ha, req->id);uint32_t index, handle;request_t *pkt;uint16_t cnt, req_cnt;
Signature · 1 line
2.1.4
PATCH v3 7/10 qla2xxx: Fix sparse annotations
In reply to Bart Van AsscheThis patch removes 21 casts between an __iomem pointer type and another data type but also introduces five new casts (see also the casts with "__force"). Although this patch does not change any functionality, IMHO the code with __force casts needs further review.
--- drivers/scsi/qla2xxx/qla_def.h | 6 +-- drivers/scsi/qla2xxx/qla_iocb.c | 12 ++--- drivers/scsi/qla2xxx/qla_mbx.c | 2 +- drivers/scsi/qla2xxx/qla_mr.c | 6 +-- drivers/scsi/qla2xxx/qla_nx.c | 107 +++++++++++++++++++--------------------- drivers/scsi/qla2xxx/qla_tmpl.c | 20 ++++---- 6 files changed, 71 insertions(+), 82 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +3 -3
@@ -3418,9 +3418,9 @@ struct qla_hw_data {mempool_t *ctx_mempool;#define FCP_CMND_DMA_POOL_SIZE 512 -unsigned long nx_pcibase;/* Base I/O address */ -uint8_t *nxdb_rd_ptr;/* Doorbell read pointer */ -unsigned long nxdb_wr_ptr;/* Door bell write pointer */ +void __iomem *nx_pcibase;/* Base I/O address */ +void __iomem *nxdb_rd_ptr;/* Doorbell read pointer */ +void __iomem *nxdb_wr_ptr;/* Door bell write pointer */ uint32_t crb_win;uint32_t curr_window;
drivers/scsi/qla2xxx/qla_iocb.c +4 -8
@@ -2507,16 +2507,12 @@ sufficient_dsds:/* write, read and verify logic */ dbval = dbval | (req->id <<8 ) | (req->ring_index <<16 );if (ql2xdbwr) -qla82xx_wr_32 (ha, ha->nxdb_wr_ptr, dbval); +qla82xx_wr_32 (ha, (uintptr_t __force )ha->nxdb_wr_ptr, dbval);else { -WRT_REG_DWORD ( - (unsigned long __iomem *)ha->nxdb_wr_ptr, - dbval); +WRT_REG_DWORD (ha->nxdb_wr_ptr, dbval);wmb (); -while (RD_REG_DWORD ((void __iomem *)ha->nxdb_rd_ptr) != dbval) { -WRT_REG_DWORD ( - (unsigned long __iomem *)ha->nxdb_wr_ptr, - dbval); +while (RD_REG_DWORD (ha->nxdb_rd_ptr) != dbval) { +WRT_REG_DWORD (ha->nxdb_wr_ptr, dbval);wmb (); } }
drivers/scsi/qla2xxx/qla_mbx.c +1 -1
@@ -1239,7 +1239,7 @@ qla2x00_init_firmware(scsi_qla_host_t *vha, uint16_t size) "Entered %s.\n", __func__);if (IS_P3P_TYPE (ha) && ql2xdbwr) -qla82xx_wr_32 (ha, ha->nxdb_wr_ptr, +qla82xx_wr_32 (ha, (uintptr_t __force )ha->nxdb_wr_ptr, (0x04 | (ha->portnum <<5 ) | (0 <<8 ) | (0 <<16 )));if (ha->flags.npiv_supported)
drivers/scsi/qla2xxx/qla_mr.c +3 -3
@@ -862,7 +862,7 @@ qlafx00_config_queues(struct scsi_qla_host *vha)dma_addr_t bar2_hdl =pci_resource_start (ha->pdev,2 ); req->length = ha->req_que_len; - req->ring = (void *)ha->iobase + ha->req_que_off; + req->ring = (void __force *)ha->iobase + ha->req_que_off; req->dma = bar2_hdl + ha->req_que_off;if ((!req->ring) || (req->length ==0 )) { ql_log_pci(ql_log_info, ha->pdev, 0x012f,
@@ -877,7 +877,7 @@ qlafx00_config_queues(struct scsi_qla_host *vha) ha->req_que_off, (u64)req->dma); rsp->length = ha->rsp_que_len; - rsp->ring = (void *)ha->iobase + ha->rsp_que_off; + rsp->ring = (void __force *)ha->iobase + ha->rsp_que_off; rsp->dma = bar2_hdl + ha->rsp_que_off;if ((!rsp->ring) || (rsp->length ==0 )) { ql_log_pci(ql_log_info, ha->pdev, 0x0131,
@@ -1425,7 +1425,7 @@ qlafx00_init_response_q_entries(struct rsp_que *rsp) pkt = rsp->ring_ptr;for (cnt =0 ; cnt < rsp->length; cnt++) { pkt->signature =RESPONSE_PROCESSED ; -WRT_REG_DWORD ((void __iomem *)&pkt->signature, +WRT_REG_DWORD ((void __force __iomem *)&pkt->signature,RESPONSE_PROCESSED ); pkt++; }
drivers/scsi/qla2xxx/qla_nx.c +50 -57
249 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_tmpl.c +10 -10
@@ -137,39 +137,39 @@ qla27xx_insertbuf(void *mem, ulong size, void *buf, ulong *len) }static inline void -qla27xx_read8 (void *window,void *buf,ulong *len) +qla27xx_read8 (void __iomem *window,void *buf,ulong *len) {uint8_t value = ~0 ;if (buf) { - value =RD_REG_BYTE ((__iomem void *)window); + value =RD_REG_BYTE (window); }qla27xx_insert32 (value, buf, len); }static inline void -qla27xx_read16 (void *window,void *buf,ulong *len) +qla27xx_read16 (void __iomem *window,void *buf,ulong *len) {uint16_t value = ~0 ;if (buf) { - value =RD_REG_WORD ((__iomem void *)window); + value =RD_REG_WORD (window); }qla27xx_insert32 (value, buf, len); }static inline void -qla27xx_read32 (void *window,void *buf,ulong *len) +qla27xx_read32 (void __iomem *window,void *buf,ulong *len) {uint32_t value = ~0 ;if (buf) { - value =RD_REG_DWORD ((__iomem void *)window); + value =RD_REG_DWORD (window); }qla27xx_insert32 (value, buf, len); } -static inline void (*qla27xx_read_vector (uint width))(void *,void *,ulong *) +static inline void (*qla27xx_read_vector (uint width))(void __iomem *,void *,ulong *) {return (width == 1) ? qla27xx_read8 :
@@ -181,7 +181,7 @@ static inline void qla27xx_read_reg(__iomem struct device_reg_24xx *reg, uint offset, void *buf, ulong *len) { - void *window = (void *)reg + offset; + void __iomem *window = (void __iomem *)reg + offset;qla27xx_read32 (window, buf, len); }
@@ -202,8 +202,8 @@ qla27xx_read_window(__iomem struct device_reg_24xx *reg, uint32_t addr, uint offset, uint count, uint width, void *buf, ulong *len) { - void *window = (void *)reg + offset; -void (*readn)(void *,void *,ulong *) =qla27xx_read_vector (width); + void __iomem *window = (void __iomem *)reg + offset; +void (*readn)(void __iomem *,void *,ulong *) =qla27xx_read_vector (width);qla27xx_write_reg (reg,IOBASE_ADDR , addr, buf);while (count--) {
Signature · 1 line
2.1.4
PATCH v3 8/10 qla2xxx: Remove a superfluous test
In reply to Bart Van AsscheAvoid that smatch reports the following warning:
drivers/scsi/qla2xxx/qla_attr.c:1081: qla2x00_model_desc_show() warn: this array is probably non-NULL. 'vha->hw->model_desc'
--- drivers/scsi/qla2xxx/qla_attr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/qla2xxx/qla_attr.c +1 -2
@@ -1077,8 +1077,7 @@ qla2x00_model_desc_show(struct device *dev, struct device_attribute *attr, char *buf) {scsi_qla_host_t *vha =shost_priv (class_to_shost (dev)); -return scnprintf (buf,PAGE_SIZE ,"%s\n" , - vha->hw->model_desc ? vha->hw->model_desc :"" ); +return scnprintf (buf,PAGE_SIZE ,"%s\n" , vha->hw->model_desc); } static ssize_t
Signature · 1 line
2.1.4
PATCH v3 9/10 qla2xxx: Remove dead code
In reply to Bart Van AsscheThe "return QLA_SUCCESS" statement just above the "fw_load_failed" label cannot be reached, hence remove it. Additionally remove the "else" keyword since the code block below the if-statement ends with a return statement.
--- drivers/scsi/qla2xxx/qla_nx.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/scsi/qla2xxx/qla_nx.c +5 -7
@@ -2473,14 +2473,12 @@ try_blob_fw:ql_log (ql_log_info, vha,0x00a5 ,"Firmware loaded successfully from binary blob.\n" );return QLA_SUCCESS ; - }else { -ql_log (ql_log_fatal, vha,0x00a6 , -"Firmware load failed for binary blob.\n" ); - blob->fw =NULL ; - blob =NULL ; - goto fw_load_failed; } -return QLA_SUCCESS ; + +ql_log (ql_log_fatal, vha,0x00a6 , +"Firmware load failed for binary blob.\n" ); + blob->fw =NULL ; + blob =NULL ; fw_load_failed:return QLA_FUNCTION_FAILED ;
Signature · 1 line
2.1.4
PATCH v3 10/10 qla2xxx: Avoid that sparse complains about context imbalances
In reply to Bart Van AsscheSurround conditional locking statements with "#ifndef __CHECKER__" / "#endif" to hide these for the sparse static source code analysis tool.
--- drivers/scsi/qla2xxx/qla_dbg.c | 36 ++++++++++++++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_nx.c | 8 ++++++++ drivers/scsi/qla2xxx/qla_target.c | 4 ++++ drivers/scsi/qla2xxx/qla_tmpl.c | 4 ++++ 4 files changed, 52 insertions(+)
drivers/scsi/qla2xxx/qla_dbg.c +36 -0
@@ -695,8 +695,10 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked) flags =0 ; +#ifndef __CHECKER__if (!hardware_locked)spin_lock_irqsave (&ha->hardware_lock, flags); +#endif if (!ha->fw_dump) { ql_log(ql_log_warn, vha, 0xd002,
@@ -832,8 +834,12 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)qla2xxx_dump_post_process (base_vha, rval); qla2300_fw_dump_failed: +#ifndef __CHECKER__if (!hardware_locked)spin_unlock_irqrestore (&ha->hardware_lock, flags); +#else + ; +#endif }/**
@@ -859,8 +865,10 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked) mb0 = mb2 =0 ; flags =0 ; +#ifndef __CHECKER__if (!hardware_locked)spin_lock_irqsave (&ha->hardware_lock, flags); +#endif if (!ha->fw_dump) { ql_log(ql_log_warn, vha, 0xd004,
@@ -1030,8 +1038,12 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)qla2xxx_dump_post_process (base_vha, rval); qla2100_fw_dump_failed: +#ifndef __CHECKER__if (!hardware_locked)spin_unlock_irqrestore (&ha->hardware_lock, flags); +#else + ; +#endif }void
@@ -1057,8 +1069,10 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) flags =0 ; ha->fw_dump_cap_flags =0 ; +#ifndef __CHECKER__if (!hardware_locked)spin_lock_irqsave (&ha->hardware_lock, flags); +#endif if (!ha->fw_dump) { ql_log(ql_log_warn, vha, 0xd006,
@@ -1282,8 +1296,12 @@ qla24xx_fw_dump_failed_0:qla2xxx_dump_post_process (base_vha, rval); qla24xx_fw_dump_failed: +#ifndef __CHECKER__if (!hardware_locked)spin_unlock_irqrestore (&ha->hardware_lock, flags); +#else + ; +#endif }void
@@ -1305,8 +1323,10 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) flags =0 ; ha->fw_dump_cap_flags =0 ; +#ifndef __CHECKER__if (!hardware_locked)spin_lock_irqsave (&ha->hardware_lock, flags); +#endif if (!ha->fw_dump) { ql_log(ql_log_warn, vha, 0xd008,
@@ -1598,8 +1618,12 @@ qla25xx_fw_dump_failed_0:qla2xxx_dump_post_process (base_vha, rval); qla25xx_fw_dump_failed: +#ifndef __CHECKER__if (!hardware_locked)spin_unlock_irqrestore (&ha->hardware_lock, flags); +#else + ; +#endif }void
@@ -1621,8 +1645,10 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) flags =0 ; ha->fw_dump_cap_flags =0 ; +#ifndef __CHECKER__if (!hardware_locked)spin_lock_irqsave (&ha->hardware_lock, flags); +#endif if (!ha->fw_dump) { ql_log(ql_log_warn, vha, 0xd00a,
@@ -1916,8 +1942,12 @@ qla81xx_fw_dump_failed_0:qla2xxx_dump_post_process (base_vha, rval); qla81xx_fw_dump_failed: +#ifndef __CHECKER__if (!hardware_locked)spin_unlock_irqrestore (&ha->hardware_lock, flags); +#else + ; +#endif }void
@@ -1939,8 +1969,10 @@ qla83xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked) flags =0 ; ha->fw_dump_cap_flags =0 ; +#ifndef __CHECKER__if (!hardware_locked)spin_lock_irqsave (&ha->hardware_lock, flags); +#endif if (!ha->fw_dump) { ql_log(ql_log_warn, vha, 0xd00c,
@@ -2419,8 +2451,12 @@ qla83xx_fw_dump_failed_0:qla2xxx_dump_post_process (base_vha, rval); qla83xx_fw_dump_failed: +#ifndef __CHECKER__if (!hardware_locked)spin_unlock_irqrestore (&ha->hardware_lock, flags); +#else + ; +#endif }/****************************************************************************/
drivers/scsi/qla2xxx/qla_nx.c +8 -0
@@ -476,7 +476,9 @@ qla82xx_wr_32(struct qla_hw_data *ha, ulong off_in, u32 data)BUG_ON (rv ==-1 );if (rv ==1 ) { +#ifndef __CHECKER__write_lock_irqsave (&ha->hw_lock, flags); +#endif qla82xx_crb_win_lock (ha);qla82xx_pci_set_crbwindow_2M (ha, off_in, &off); }
@@ -485,7 +487,9 @@ qla82xx_wr_32(struct qla_hw_data *ha, ulong off_in, u32 data)if (rv ==1 ) {qla82xx_rd_32 (ha,QLA82XX_PCIE_REG (PCIE_SEM7_UNLOCK )); +#ifndef __CHECKER__write_unlock_irqrestore (&ha->hw_lock, flags); +#endif }return 0 ; }
@@ -503,7 +507,9 @@ qla82xx_rd_32(struct qla_hw_data *ha, ulong off_in)BUG_ON (rv ==-1 );if (rv ==1 ) { +#ifndef __CHECKER__write_lock_irqsave (&ha->hw_lock, flags); +#endif qla82xx_crb_win_lock (ha);qla82xx_pci_set_crbwindow_2M (ha, off_in, &off); }
@@ -511,7 +517,9 @@ qla82xx_rd_32(struct qla_hw_data *ha, ulong off_in)if (rv ==1 ) {qla82xx_rd_32 (ha,QLA82XX_PCIE_REG (PCIE_SEM7_UNLOCK )); +#ifndef __CHECKER__write_unlock_irqrestore (&ha->hw_lock, flags); +#endif }return data; }
drivers/scsi/qla2xxx/qla_target.c +4 -0
@@ -3955,16 +3955,20 @@ static void qlt_reject_free_srr_imm(struct scsi_qla_host *vha,struct qla_hw_data *ha = vha->hw;unsigned long flags =0 ; +#ifndef __CHECKER__if (!ha_locked)spin_lock_irqsave (&ha->hardware_lock, flags); +#endif qlt_send_notify_ack (vha, (void *)&imm->imm_ntfy,0 ,0 ,0 ,NOTIFY_ACK_SRR_FLAGS_REJECT ,NOTIFY_ACK_SRR_REJECT_REASON_UNABLE_TO_PERFORM ,NOTIFY_ACK_SRR_FLAGS_REJECT_EXPL_NO_EXPL ); +#ifndef __CHECKER__if (!ha_locked)spin_unlock_irqrestore (&ha->hardware_lock, flags); +#endif kfree (imm); }
drivers/scsi/qla2xxx/qla_tmpl.c +4 -0
@@ -939,8 +939,10 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked) {ulong flags =0 ; +#ifndef __CHECKER__if (!hardware_locked)spin_lock_irqsave (&vha->hw->hardware_lock, flags); +#endif if (!vha->hw->fw_dump)ql_log (ql_log_warn, vha,0xd01e ,"fwdump buffer missing.\n" );
@@ -953,6 +955,8 @@ qla27xx_fwdump(scsi_qla_host_t *vha, int hardware_locked)else qla27xx_execute_fwdt_template (vha); +#ifndef __CHECKER__if (!hardware_locked)spin_unlock_irqrestore (&vha->hw->hardware_lock, flags); +#endif }
Signature · 1 line
2.1.4
James Bottomley
maintainerRe: [PATCH v3 10/10] qla2xxx: Avoid that sparse complains about context imbalances
Quoted 3 lines · Bart Van Assche
Surround conditional locking statements with "#ifndef
__CHECKER__" / "#endif" to hide these for the sparse static source code analysis tool.
Thanks! I know I whine alot about checkpatch but having drivers sparse clean like this one now is really helps in the compile phase of patch checking.
James
Quoted 15 lines · Bart Van Assche
This patch series addresses several warnings reported by static source code analysis tools for the qla2xxx driver (gcc (W=1), sparse (C=2) and smatch (C=2 CHECK="smatch -p=kernel")). The patches in this series are:
0001-qla2xxx-Report-both-rsp_info-and-rsp_info_len.patch 0002-qla2xxx-Declare-local-functions-static.patch 0003-qla2xxx-Remove-set-but-not-used-variables.patch 0004-qla2xxx-Replace-two-macros-with-an-inline-function.patch 0005-qla2xxx-Remove-__constant_-prefix.patch 0006-qla2xxx-Avoid-that-sparse-complains-about-duplicate-.patch 0007-qla2xxx-Fix-sparse-annotations.patch 0008-qla2xxx-Remove-a-superfluous-test.patch 0009-qla2xxx-Remove-dead-code.patch 0010-qla2xxx-Avoid-that-sparse-complains-about-context-im.patch
Quoted 6 lines
Version 3 is a resend of the patches from v2 that are not yet upstream.
The changes compared to v1 of this series are:
- Rebased this patch series onto kernel v4.1-rc6.
- Also removed variable 'd2' in patch 3.
- Also remove the recently introduced dead code in patch 10.
Series Looks good