[SCSI] qla2xxx: Fix sparse warning from qla_mr.c and qla_iocb.c.
authorSaurav Kashyap <saurav.kashyap@qlogic.com>
Tue, 25 Jun 2013 15:27:21 +0000 (11:27 -0400)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 8 Jul 2013 16:22:52 +0000 (17:22 +0100)
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_inline.h
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_mr.c
drivers/scsi/qla2xxx/qla_mr.h

index c32efc75322922460cf713a04771d2a0c4c55f6c..95ca32a71e753412e82b2dd87affe1bd05c9f0d7 100644 (file)
@@ -323,7 +323,7 @@ struct srb_iocb {
                        uint32_t lun;
                        uint32_t data;
                        struct completion comp;
-                       uint32_t comp_status;
+                       __le16 comp_status;
                } tmf;
                struct {
 #define SRB_FXDISC_REQ_DMA_VALID       BIT_0
@@ -338,21 +338,21 @@ struct srb_iocb {
                        void *rsp_addr;
                        dma_addr_t req_dma_handle;
                        dma_addr_t rsp_dma_handle;
-                       uint32_t adapter_id;
-                       uint32_t adapter_id_hi;
-                       uint32_t req_func_type;
-                       uint32_t req_data;
-                       uint32_t req_data_extra;
-                       uint32_t result;
-                       uint32_t seq_number;
-                       uint32_t fw_flags;
+                       __le32 adapter_id;
+                       __le32 adapter_id_hi;
+                       __le16 req_func_type;
+                       __le32 req_data;
+                       __le32 req_data_extra;
+                       __le32 result;
+                       __le32 seq_number;
+                       __le16 fw_flags;
                        struct completion fxiocb_comp;
-                       uint32_t reserved_0;
+                       __le32 reserved_0;
                        uint8_t reserved_1;
                } fxiocb;
                struct {
                        uint32_t cmd_hndl;
-                       uint32_t comp_status;
+                       __le16 comp_status;
                        struct completion comp;
                } abt;
        } u;
@@ -1196,14 +1196,14 @@ typedef struct {
 struct init_cb_fx {
        uint16_t        version;
        uint16_t        reserved_1[13];
-       uint16_t        request_q_outpointer;
-       uint16_t        response_q_inpointer;
+       __le16          request_q_outpointer;
+       __le16          response_q_inpointer;
        uint16_t        reserved_2[2];
-       uint16_t        response_q_length;
-       uint16_t        request_q_length;
+       __le16          response_q_length;
+       __le16          request_q_length;
        uint16_t        reserved_3[2];
-       uint32_t        request_q_address[2];
-       uint32_t        response_q_address[2];
+       __le32          request_q_address[2];
+       __le32          response_q_address[2];
        uint16_t        reserved_4[4];
        uint8_t         response_q_msivec;
        uint8_t         reserved_5[19];
index 026bfde33e67357b8149f0738607044a99a97b1d..2d98232a08ebe0a08a64a94c74c7c7b484786295 100644 (file)
@@ -587,7 +587,7 @@ extern int qlafx00_init_firmware(scsi_qla_host_t *, uint16_t);
 extern int qlafx00_fw_ready(scsi_qla_host_t *);
 extern int qlafx00_configure_devices(scsi_qla_host_t *);
 extern int qlafx00_reset_initialize(scsi_qla_host_t *);
-extern int qlafx00_fx_disc(scsi_qla_host_t *, fc_port_t *, uint8_t);
+extern int qlafx00_fx_disc(scsi_qla_host_t *, fc_port_t *, uint16_t);
 extern int qlafx00_process_aen(struct scsi_qla_host *, struct qla_work_evt *);
 extern int qlafx00_post_aenfx_work(struct scsi_qla_host *,  uint32_t,
                                   uint32_t *, int);
index 0a5c8951cebb4ef0e345bdf4b5a8fc1cd35e2ed6..28c38b4929ce64807130f61e9176e2f84d04c688 100644 (file)
@@ -83,7 +83,7 @@ static inline void
 host_to_adap(uint8_t *src, uint8_t *dst, uint32_t bsize)
 {
        uint32_t *isrc = (uint32_t *) src;
-       uint32_t *odest = (uint32_t *) dst;
+       __le32 *odest = (__le32 *) dst;
        uint32_t iter = bsize >> 2;
 
        for (; iter ; iter--)
index 15e4080b347cd1ed69c9b905125d2001332d3ae9..9de372f00d4a48dd6dda3ab6f51e18f4a360d4a0 100644 (file)
@@ -1863,8 +1863,8 @@ skip_cmd_array:
        pkt = req->ring_ptr;
        memset(pkt, 0, REQUEST_ENTRY_SIZE);
        if (IS_QLAFX00(ha)) {
-               WRT_REG_BYTE(&pkt->entry_count, req_cnt);
-               WRT_REG_WORD(&pkt->handle, handle);
+               WRT_REG_BYTE((void __iomem *)&pkt->entry_count, req_cnt);
+               WRT_REG_WORD((void __iomem *)&pkt->handle, handle);
        } else {
                pkt->entry_count = req_cnt;
                pkt->handle = handle;
index a6df55838365e2ebac0c15abe52cecb462518f48..d7993797f46e1339d4a36e05b88c6a49905c1d96 100644 (file)
@@ -707,7 +707,7 @@ qlafx00_tmf_iocb_timeout(void *data)
        srb_t *sp = (srb_t *)data;
        struct srb_iocb *tmf = &sp->u.iocb_cmd;
 
-       tmf->u.tmf.comp_status = CS_TIMEOUT;
+       tmf->u.tmf.comp_status = cpu_to_le16((uint16_t)CS_TIMEOUT);
        complete(&tmf->u.tmf.comp);
 }
 
@@ -1418,7 +1418,8 @@ 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(&pkt->signature, RESPONSE_PROCESSED);
+               WRT_REG_DWORD((void __iomem *)&pkt->signature,
+                   RESPONSE_PROCESSED);
                pkt++;
        }
 }
@@ -1733,7 +1734,7 @@ qla2x00_fxdisc_sp_done(void *data, void *ptr, int res)
 }
 
 int
-qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type)
+qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type)
 {
        srb_t *sp;
        struct srb_iocb *fdisc;
@@ -1759,13 +1760,13 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type)
                fdisc->u.fxiocb.flags =
                    SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID;
                fdisc->u.fxiocb.rsp_len = QLAFX00_PORT_DATA_INFO;
-               fdisc->u.fxiocb.req_data = fcport->port_id;
+               fdisc->u.fxiocb.req_data = cpu_to_le32(fcport->port_id);
                break;
        case FXDISC_GET_TGT_NODE_INFO:
                fdisc->u.fxiocb.flags =
                    SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID;
                fdisc->u.fxiocb.rsp_len = QLAFX00_TGT_NODE_INFO;
-               fdisc->u.fxiocb.req_data = fcport->tgt_id;
+               fdisc->u.fxiocb.req_data = cpu_to_le32(fcport->tgt_id);
                break;
        case FXDISC_GET_TGT_NODE_LIST:
                fdisc->u.fxiocb.flags =
@@ -1851,7 +1852,7 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type)
        sp->name = "fxdisc";
        qla2x00_init_timer(sp, FXDISC_TIMEOUT);
        fdisc->timeout = qla2x00_fxdisc_iocb_timeout;
-       fdisc->u.fxiocb.req_func_type = fx_type;
+       fdisc->u.fxiocb.req_func_type = cpu_to_le16(fx_type);
        sp->done = qla2x00_fxdisc_sp_done;
 
        rval = qla2x00_start_sp(sp);
@@ -1904,7 +1905,7 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type)
                    (uint8_t *)pinfo, 16);
                memcpy(vha->hw->gid_list, pinfo, QLAFX00_TGT_NODE_LIST_SIZE);
        }
-       rval = fdisc->u.fxiocb.result;
+       rval = le32_to_cpu(fdisc->u.fxiocb.result);
 
 done_unmap_dma:
        if (fdisc->u.fxiocb.rsp_addr)
@@ -1927,7 +1928,7 @@ qlafx00_abort_iocb_timeout(void *data)
        srb_t *sp = (srb_t *)data;
        struct srb_iocb *abt = &sp->u.iocb_cmd;
 
-       abt->u.abt.comp_status = CS_TIMEOUT;
+       abt->u.abt.comp_status = cpu_to_le16((uint16_t)CS_TIMEOUT);
        complete(&abt->u.abt.comp);
 }
 
@@ -2169,14 +2170,14 @@ qlafx00_handle_sense(srb_t *sp, uint8_t *sense_data, uint32_t par_sense_len,
 static void
 qlafx00_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
                      struct tsk_mgmt_entry_fx00 *pkt, srb_t *sp,
-                     uint16_t sstatus, uint16_t cpstatus)
+                     __le16 sstatus, __le16 cpstatus)
 {
        struct srb_iocb *tmf;
 
        tmf = &sp->u.iocb_cmd;
-       if (cpstatus != CS_COMPLETE ||
-           (sstatus & SS_RESPONSE_INFO_LEN_VALID))
-               cpstatus = CS_INCOMPLETE;
+       if (cpstatus != cpu_to_le16((uint16_t)CS_COMPLETE) ||
+           (sstatus & cpu_to_le16((uint16_t)SS_RESPONSE_INFO_LEN_VALID)))
+               cpstatus = cpu_to_le16((uint16_t)CS_INCOMPLETE);
        tmf->u.tmf.comp_status = cpstatus;
        sp->done(vha, sp, 0);
 }
@@ -2194,7 +2195,7 @@ qlafx00_abort_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,
                return;
 
        abt = &sp->u.iocb_cmd;
-       abt->u.abt.comp_status = le32_to_cpu(pkt->tgt_id_sts);
+       abt->u.abt.comp_status = pkt->tgt_id_sts;
        sp->done(vha, sp, 0);
 }
 
@@ -2216,12 +2217,12 @@ qlafx00_ioctl_iosb_entry(scsi_qla_host_t *vha, struct req_que *req,
 
        if (sp->type == SRB_FXIOCB_DCMD) {
                iocb_job = &sp->u.iocb_cmd;
-               iocb_job->u.fxiocb.seq_number = le32_to_cpu(pkt->seq_no);
-               iocb_job->u.fxiocb.fw_flags = le32_to_cpu(pkt->fw_iotcl_flags);
-               iocb_job->u.fxiocb.result = le32_to_cpu(pkt->status);
+               iocb_job->u.fxiocb.seq_number = pkt->seq_no;
+               iocb_job->u.fxiocb.fw_flags = pkt->fw_iotcl_flags;
+               iocb_job->u.fxiocb.result = pkt->status;
                if (iocb_job->u.fxiocb.flags & SRB_FXDISC_RSP_DWRD_VALID)
                        iocb_job->u.fxiocb.req_data =
-                           le32_to_cpu(pkt->dataword_r);
+                           pkt->dataword_r;
        } else {
                bsg_job = sp->u.bsg_job;
 
@@ -2275,10 +2276,10 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
        fc_port_t       *fcport;
        struct scsi_cmnd *cp;
        struct sts_entry_fx00 *sts;
-       uint16_t        comp_status;
-       uint16_t        scsi_status;
+       __le16          comp_status;
+       __le16          scsi_status;
        uint16_t        ox_id;
-       uint8_t         lscsi_status;
+       __le16          lscsi_status;
        int32_t         resid;
        uint32_t        sense_len, par_sense_len, rsp_info_len, resid_len,
            fw_resid_len;
@@ -2292,8 +2293,8 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
 
        sts = (struct sts_entry_fx00 *) pkt;
 
-       comp_status = le16_to_cpu(sts->comp_status);
-       scsi_status = le16_to_cpu(sts->scsi_status) & SS_MASK;
+       comp_status = sts->comp_status;
+       scsi_status = sts->scsi_status & cpu_to_le16((uint16_t)SS_MASK);
        hindex = sts->handle;
        handle = LSW(hindex);
 
@@ -2339,38 +2340,40 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                return;
        }
 
-       lscsi_status = scsi_status & STATUS_MASK;
+       lscsi_status = scsi_status & cpu_to_le16((uint16_t)STATUS_MASK);
 
        fcport = sp->fcport;
 
        ox_id = 0;
        sense_len = par_sense_len = rsp_info_len = resid_len =
                fw_resid_len = 0;
-       if (scsi_status & SS_SENSE_LEN_VALID)
-               sense_len = le32_to_cpu(sts->sense_len);
-       if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER))
+       if (scsi_status & cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID))
+               sense_len = sts->sense_len;
+       if (scsi_status & cpu_to_le16(((uint16_t)SS_RESIDUAL_UNDER
+           | (uint16_t)SS_RESIDUAL_OVER)))
                resid_len = le32_to_cpu(sts->residual_len);
-       if (comp_status == CS_DATA_UNDERRUN)
+       if (comp_status == cpu_to_le16((uint16_t)CS_DATA_UNDERRUN))
                fw_resid_len = le32_to_cpu(sts->residual_len);
        rsp_info = sense_data = sts->data;
        par_sense_len = sizeof(sts->data);
 
        /* Check for overrun. */
        if (comp_status == CS_COMPLETE &&
-           scsi_status & SS_RESIDUAL_OVER)
-               comp_status = CS_DATA_OVERRUN;
+           scsi_status & cpu_to_le16((uint16_t)SS_RESIDUAL_OVER))
+               comp_status = cpu_to_le16((uint16_t)CS_DATA_OVERRUN);
 
        /*
         * Based on Host and scsi status generate status code for Linux
         */
-       switch (comp_status) {
+       switch (le16_to_cpu(comp_status)) {
        case CS_COMPLETE:
        case CS_QUEUE_FULL:
                if (scsi_status == 0) {
                        res = DID_OK << 16;
                        break;
                }
-               if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) {
+               if (scsi_status & cpu_to_le16(((uint16_t)SS_RESIDUAL_UNDER
+                   | (uint16_t)SS_RESIDUAL_OVER))) {
                        resid = resid_len;
                        scsi_set_resid(cp, resid);
 
@@ -2386,19 +2389,20 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                                break;
                        }
                }
-               res = DID_OK << 16 | lscsi_status;
+               res = DID_OK << 16 | le16_to_cpu(lscsi_status);
 
-               if (lscsi_status == SAM_STAT_TASK_SET_FULL) {
+               if (lscsi_status ==
+                   cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL)) {
                        ql_dbg(ql_dbg_io, fcport->vha, 0x3051,
                            "QUEUE FULL detected.\n");
                        break;
                }
                logit = 0;
-               if (lscsi_status != SS_CHECK_CONDITION)
+               if (lscsi_status != cpu_to_le16((uint16_t)SS_CHECK_CONDITION))
                        break;
 
                memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
-               if (!(scsi_status & SS_SENSE_LEN_VALID))
+               if (!(scsi_status & cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID)))
                        break;
 
                qlafx00_handle_sense(sp, sense_data, par_sense_len, sense_len,
@@ -2412,7 +2416,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                else
                        resid = resid_len;
                scsi_set_resid(cp, resid);
-               if (scsi_status & SS_RESIDUAL_UNDER) {
+               if (scsi_status & cpu_to_le16((uint16_t)SS_RESIDUAL_UNDER)) {
                        if ((IS_FWI2_CAPABLE(ha) || IS_QLAFX00(ha))
                            && fw_resid_len != resid_len) {
                                ql_dbg(ql_dbg_io, fcport->vha, 0x3052,
@@ -2420,7 +2424,8 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                                    "(0x%x of 0x%x bytes).\n",
                                    resid, scsi_bufflen(cp));
 
-                               res = DID_ERROR << 16 | lscsi_status;
+                               res = DID_ERROR << 16 |
+                                   le16_to_cpu(lscsi_status);
                                goto check_scsi_status;
                        }
 
@@ -2436,8 +2441,9 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                                res = DID_ERROR << 16;
                                break;
                        }
-               } else if (lscsi_status != SAM_STAT_TASK_SET_FULL &&
-                           lscsi_status != SAM_STAT_BUSY) {
+               } else if (lscsi_status !=
+                   cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL) &&
+                   lscsi_status != cpu_to_le16((uint16_t)SAM_STAT_BUSY)) {
                        /*
                         * scsi status of task set and busy are considered
                         * to be task not completed.
@@ -2448,7 +2454,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                            "of 0x%x bytes).\n", resid,
                            scsi_bufflen(cp));
 
-                       res = DID_ERROR << 16 | lscsi_status;
+                       res = DID_ERROR << 16 | le16_to_cpu(lscsi_status);
                        goto check_scsi_status;
                } else {
                        ql_dbg(ql_dbg_io, fcport->vha, 0x3055,
@@ -2456,7 +2462,7 @@ qlafx00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
                            scsi_status, lscsi_status);
                }
 
-               res = DID_OK << 16 | lscsi_status;
+               res = DID_OK << 16 | le16_to_cpu(lscsi_status);
                logit = 0;
 
 check_scsi_status:
@@ -2465,17 +2471,20 @@ check_scsi_status:
                 * Status.
                 */
                if (lscsi_status != 0) {
-                       if (lscsi_status == SAM_STAT_TASK_SET_FULL) {
+                       if (lscsi_status ==
+                           cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL)) {
                                ql_dbg(ql_dbg_io, fcport->vha, 0x3056,
                                    "QUEUE FULL detected.\n");
                                logit = 1;
                                break;
                        }
-                       if (lscsi_status != SS_CHECK_CONDITION)
+                       if (lscsi_status !=
+                           cpu_to_le16((uint16_t)SS_CHECK_CONDITION))
                                break;
 
                        memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
-                       if (!(scsi_status & SS_SENSE_LEN_VALID))
+                       if (!(scsi_status &
+                           cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID)))
                                break;
 
                        qlafx00_handle_sense(sp, sense_data, par_sense_len,
@@ -2629,7 +2638,7 @@ qlafx00_multistatus_entry(struct scsi_qla_host *vha,
        uint32_t handle, hindex, handle_count, i;
        uint16_t que;
        struct req_que *req;
-       uint32_t *handle_ptr;
+       __le32 *handle_ptr;
 
        stsmfx = (struct multi_sts_entry_fx00 *) pkt;
 
@@ -2643,7 +2652,7 @@ qlafx00_multistatus_entry(struct scsi_qla_host *vha,
                return;
        }
 
-       handle_ptr = (uint32_t *) &stsmfx->handles[0];
+       handle_ptr =  &stsmfx->handles[0];
 
        for (i = 0; i < handle_count; i++) {
                hindex = le32_to_cpu(*handle_ptr);
@@ -2714,10 +2723,11 @@ qlafx00_process_response_queue(struct scsi_qla_host *vha,
        if (!vha->flags.online)
                return;
 
-       while (RD_REG_DWORD(&(rsp->ring_ptr->signature)) !=
+       while (RD_REG_DWORD((void __iomem *)&(rsp->ring_ptr->signature)) !=
            RESPONSE_PROCESSED) {
                lptr = rsp->ring_ptr;
-               memcpy_fromio(rsp->rsp_pkt, lptr, sizeof(rsp->rsp_pkt));
+               memcpy_fromio(rsp->rsp_pkt, (void __iomem *)lptr,
+                   sizeof(rsp->rsp_pkt));
                pkt = (struct sts_entry_fx00 *)rsp->rsp_pkt;
 
                rsp->ring_index++;
@@ -2768,7 +2778,8 @@ qlafx00_process_response_queue(struct scsi_qla_host *vha,
                        break;
                }
 next_iter:
-               WRT_REG_DWORD(&lptr->signature, RESPONSE_PROCESSED);
+               WRT_REG_DWORD((void __iomem *)&lptr->signature,
+                   RESPONSE_PROCESSED);
                wmb();
        }
 
@@ -2958,8 +2969,7 @@ qlafx00_prep_cont_type1_iocb(struct req_que *req,
        cont_pkt = (cont_a64_entry_t *)req->ring_ptr;
 
        /* Load packet defaults. */
-       *((uint32_t *)(&lcont_pkt->entry_type)) =
-           __constant_cpu_to_le32(CONTINUE_A64_TYPE_FX00);
+       lcont_pkt->entry_type = CONTINUE_A64_TYPE_FX00;
 
        return cont_pkt;
 }
@@ -2969,7 +2979,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt,
                         uint16_t tot_dsds, struct cmd_type_7_fx00 *lcmd_pkt)
 {
        uint16_t        avail_dsds;
-       uint32_t        *cur_dsd;
+       __le32 *cur_dsd;
        scsi_qla_host_t *vha;
        struct scsi_cmnd *cmd;
        struct scatterlist *sg;
@@ -2986,8 +2996,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt,
        cont_pkt = NULL;
 
        /* Update entry type to indicate Command Type 3 IOCB */
-       *((uint32_t *)(&lcmd_pkt->entry_type)) =
-           __constant_cpu_to_le32(FX00_COMMAND_TYPE_7);
+       lcmd_pkt->entry_type = FX00_COMMAND_TYPE_7;
 
        /* No data transfer */
        if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) {
@@ -3006,7 +3015,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt,
 
        /* One DSD is available in the Command Type 3 IOCB */
        avail_dsds = 1;
-       cur_dsd = (uint32_t *)&lcmd_pkt->dseg_0_address;
+       cur_dsd = (__le32 *)&lcmd_pkt->dseg_0_address;
 
        /* Load data segments */
        scsi_for_each_sg(cmd, sg, tot_dsds, i) {
@@ -3021,7 +3030,7 @@ qlafx00_build_scsi_iocbs(srb_t *sp, struct cmd_type_7_fx00 *cmd_pkt,
                        memset(&lcont_pkt, 0, REQUEST_ENTRY_SIZE);
                        cont_pkt =
                            qlafx00_prep_cont_type1_iocb(req, &lcont_pkt);
-                       cur_dsd = (uint32_t *)lcont_pkt.dseg_0_address;
+                       cur_dsd = (__le32 *)lcont_pkt.dseg_0_address;
                        avail_dsds = 5;
                        cont = 1;
                }
@@ -3224,13 +3233,13 @@ qlafx00_tm_iocb(srb_t *sp, struct tsk_mgmt_entry_fx00 *ptm_iocb)
        tm_iocb.timeout = cpu_to_le16(qla2x00_get_async_timeout(vha) + 2);
        tm_iocb.tgt_id = cpu_to_le16(sp->fcport->tgt_id);
        tm_iocb.control_flags = cpu_to_le32(fxio->u.tmf.flags);
-       if (tm_iocb.control_flags == TCF_LUN_RESET) {
+       if (tm_iocb.control_flags == cpu_to_le32((uint32_t)TCF_LUN_RESET)) {
                int_to_scsilun(fxio->u.tmf.lun, &llun);
                host_to_adap((uint8_t *)&llun, (uint8_t *)&tm_iocb.lun,
                    sizeof(struct scsi_lun));
        }
 
-       memcpy((void __iomem *)ptm_iocb, &tm_iocb,
+       memcpy((void *)ptm_iocb, &tm_iocb,
            sizeof(struct tsk_mgmt_entry_fx00));
        wmb();
 }
@@ -3252,7 +3261,7 @@ qlafx00_abort_iocb(srb_t *sp, struct abort_iocb_entry_fx00 *pabt_iocb)
        abt_iocb.tgt_id_sts = cpu_to_le16(sp->fcport->tgt_id);
        abt_iocb.req_que_no = cpu_to_le16(req->id);
 
-       memcpy((void __iomem *)pabt_iocb, &abt_iocb,
+       memcpy((void *)pabt_iocb, &abt_iocb,
            sizeof(struct abort_iocb_entry_fx00));
        wmb();
 }
@@ -3273,13 +3282,12 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
 
        if (sp->type == SRB_FXIOCB_DCMD) {
                fx_iocb.func_num =
-                   cpu_to_le16(sp->u.iocb_cmd.u.fxiocb.req_func_type);
-               fx_iocb.adapid = cpu_to_le32(fxio->u.fxiocb.adapter_id);
-               fx_iocb.adapid_hi = cpu_to_le32(fxio->u.fxiocb.adapter_id_hi);
-               fx_iocb.reserved_0 = cpu_to_le32(fxio->u.fxiocb.reserved_0);
-               fx_iocb.reserved_1 = cpu_to_le32(fxio->u.fxiocb.reserved_1);
-               fx_iocb.dataword_extra =
-                   cpu_to_le32(fxio->u.fxiocb.req_data_extra);
+                   sp->u.iocb_cmd.u.fxiocb.req_func_type;
+               fx_iocb.adapid = fxio->u.fxiocb.adapter_id;
+               fx_iocb.adapid_hi = fxio->u.fxiocb.adapter_id_hi;
+               fx_iocb.reserved_0 = fxio->u.fxiocb.reserved_0;
+               fx_iocb.reserved_1 = fxio->u.fxiocb.reserved_1;
+               fx_iocb.dataword_extra = fxio->u.fxiocb.req_data_extra;
 
                if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DMA_VALID) {
                        fx_iocb.req_dsdcnt = cpu_to_le16(1);
@@ -3306,8 +3314,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
                }
 
                if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DWRD_VALID) {
-                       fx_iocb.dataword =
-                           cpu_to_le32(fxio->u.fxiocb.req_data);
+                       fx_iocb.dataword = fxio->u.fxiocb.req_data;
                }
                fx_iocb.flags = fxio->u.fxiocb.flags;
        } else {
@@ -3323,21 +3330,21 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
                fx_iocb.reserved_1 = piocb_rqst->reserved_1;
                fx_iocb.dataword_extra = piocb_rqst->dataword_extra;
                fx_iocb.dataword = piocb_rqst->dataword;
-               fx_iocb.req_xfrcnt = cpu_to_le16(piocb_rqst->req_len);
-               fx_iocb.rsp_xfrcnt = cpu_to_le16(piocb_rqst->rsp_len);
+               fx_iocb.req_xfrcnt = piocb_rqst->req_len;
+               fx_iocb.rsp_xfrcnt = piocb_rqst->rsp_len;
 
                if (piocb_rqst->flags & SRB_FXDISC_REQ_DMA_VALID) {
                        int avail_dsds, tot_dsds;
                        cont_a64_entry_t lcont_pkt;
                        cont_a64_entry_t *cont_pkt = NULL;
-                       uint32_t *cur_dsd;
+                       __le32 *cur_dsd;
                        int index = 0, cont = 0;
 
                        fx_iocb.req_dsdcnt =
                            cpu_to_le16(bsg_job->request_payload.sg_cnt);
                        tot_dsds =
-                           cpu_to_le32(bsg_job->request_payload.sg_cnt);
-                       cur_dsd = (uint32_t *)&fx_iocb.dseg_rq_address[0];
+                           bsg_job->request_payload.sg_cnt;
+                       cur_dsd = (__le32 *)&fx_iocb.dseg_rq_address[0];
                        avail_dsds = 1;
                        for_each_sg(bsg_job->request_payload.sg_list, sg,
                            tot_dsds, index) {
@@ -3355,7 +3362,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
                                            qlafx00_prep_cont_type1_iocb(
                                                sp->fcport->vha->req,
                                                &lcont_pkt);
-                                       cur_dsd = (uint32_t *)
+                                       cur_dsd = (__le32 *)
                                            lcont_pkt.dseg_0_address;
                                        avail_dsds = 5;
                                        cont = 1;
@@ -3393,13 +3400,13 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
                        int avail_dsds, tot_dsds;
                        cont_a64_entry_t lcont_pkt;
                        cont_a64_entry_t *cont_pkt = NULL;
-                       uint32_t *cur_dsd;
+                       __le32 *cur_dsd;
                        int index = 0, cont = 0;
 
                        fx_iocb.rsp_dsdcnt =
                           cpu_to_le16(bsg_job->reply_payload.sg_cnt);
-                       tot_dsds = cpu_to_le32(bsg_job->reply_payload.sg_cnt);
-                       cur_dsd = (uint32_t *)&fx_iocb.dseg_rsp_address[0];
+                       tot_dsds = bsg_job->reply_payload.sg_cnt;
+                       cur_dsd = (__le32 *)&fx_iocb.dseg_rsp_address[0];
                        avail_dsds = 1;
 
                        for_each_sg(bsg_job->reply_payload.sg_list, sg,
@@ -3418,7 +3425,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
                                            qlafx00_prep_cont_type1_iocb(
                                                sp->fcport->vha->req,
                                                &lcont_pkt);
-                                       cur_dsd = (uint32_t *)
+                                       cur_dsd = (__le32 *)
                                            lcont_pkt.dseg_0_address;
                                        avail_dsds = 5;
                                        cont = 1;
@@ -3453,7 +3460,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
                }
 
                if (piocb_rqst->flags & SRB_FXDISC_REQ_DWRD_VALID)
-                       fx_iocb.dataword = cpu_to_le32(piocb_rqst->dataword);
+                       fx_iocb.dataword = piocb_rqst->dataword;
                fx_iocb.flags = piocb_rqst->flags;
                fx_iocb.entry_count = entry_cnt;
        }
@@ -3462,7 +3469,7 @@ qlafx00_fxdisc_iocb(srb_t *sp, struct fxdisc_entry_fx00 *pfxiocb)
            sp->fcport->vha, 0x3047,
            (uint8_t *)&fx_iocb, sizeof(struct fxdisc_entry_fx00));
 
-       memcpy((void __iomem *)pfxiocb, &fx_iocb,
+       memcpy((void *)pfxiocb, &fx_iocb,
            sizeof(struct fxdisc_entry_fx00));
        wmb();
 }
index cc327dc2fd10467cfe46171bde6be2edcbcbcc67..1a092af0e2c353a5126e8cc8ca96f3c15fff3ec7 100644 (file)
@@ -24,10 +24,10 @@ struct cmd_type_7_fx00 {
        uint32_t handle;                /* System handle. */
        uint32_t handle_hi;
 
-       uint16_t tgt_idx;               /* Target Idx. */
+       __le16 tgt_idx;         /* Target Idx. */
        uint16_t timeout;               /* Command timeout. */
 
-       uint16_t dseg_count;            /* Data segment count. */
+       __le16 dseg_count;              /* Data segment count. */
        uint16_t scsi_rsp_dsd_len;
 
        struct scsi_lun lun;            /* LUN (LE). */
@@ -41,7 +41,7 @@ struct cmd_type_7_fx00 {
        uint8_t crn;
 
        uint8_t fcp_cdb[MAX_CMDSZ];     /* SCSI command words. */
-       uint32_t byte_count;            /* Total byte count. */
+       __le32 byte_count;              /* Total byte count. */
 
        uint32_t dseg_0_address[2];     /* Data segment 0 address. */
        uint32_t dseg_0_len;            /* Data segment 0 length. */
@@ -81,16 +81,16 @@ struct sts_entry_fx00 {
        uint32_t handle;                /* System handle. */
        uint32_t handle_hi;             /* System handle. */
 
-       uint16_t comp_status;           /* Completion status. */
+       __le16 comp_status;             /* Completion status. */
        uint16_t reserved_0;            /* OX_ID used by the firmware. */
 
-       uint32_t residual_len;          /* FW calc residual transfer length. */
+       __le32 residual_len;            /* FW calc residual transfer length. */
 
        uint16_t reserved_1;
        uint16_t state_flags;           /* State flags. */
 
        uint16_t reserved_2;
-       uint16_t scsi_status;           /* SCSI status. */
+       __le16 scsi_status;             /* SCSI status. */
 
        uint32_t sense_len;             /* FCP SENSE length. */
        uint8_t data[32];               /* FCP response/sense information. */
@@ -106,7 +106,7 @@ struct multi_sts_entry_fx00 {
        uint8_t handle_count;
        uint8_t entry_status;
 
-       uint32_t handles[MAX_HANDLE_COUNT];
+       __le32 handles[MAX_HANDLE_COUNT];
 };
 
 #define TSK_MGMT_IOCB_TYPE_FX00                0x05
@@ -116,21 +116,21 @@ struct tsk_mgmt_entry_fx00 {
        uint8_t sys_define;
        uint8_t entry_status;           /* Entry Status. */
 
-       uint32_t handle;                /* System handle. */
+       __le32 handle;          /* System handle. */
 
        uint32_t handle_hi;             /* System handle. */
 
-       uint16_t tgt_id;                /* Target Idx. */
+       __le16 tgt_id;          /* Target Idx. */
 
        uint16_t reserved_1;
 
        uint16_t delay;                 /* Activity delay in seconds. */
 
-       uint16_t timeout;               /* Command timeout. */
+       __le16 timeout;         /* Command timeout. */
 
        struct scsi_lun lun;            /* LUN (LE). */
 
-       uint32_t control_flags;         /* Control Flags. */
+       __le32 control_flags;           /* Control Flags. */
 
        uint8_t reserved_2[32];
 };
@@ -143,16 +143,16 @@ struct abort_iocb_entry_fx00 {
        uint8_t sys_define;             /* System defined. */
        uint8_t entry_status;           /* Entry Status. */
 
-       uint32_t handle;                /* System handle. */
-       uint32_t handle_hi;             /* System handle. */
+       __le32 handle;          /* System handle. */
+       __le32 handle_hi;               /* System handle. */
 
-       uint16_t tgt_id_sts;            /* Completion status. */
-       uint16_t options;
+       __le16 tgt_id_sts;              /* Completion status. */
+       __le16 options;
 
-       uint32_t abort_handle;          /* System handle. */
-       uint32_t abort_handle_hi;       /* System handle. */
+       __le32 abort_handle;            /* System handle. */
+       __le32 abort_handle_hi; /* System handle. */
 
-       uint16_t req_que_no;
+       __le16 req_que_no;
        uint8_t reserved_1[38];
 };
 
@@ -167,17 +167,17 @@ struct ioctl_iocb_entry_fx00 {
        uint32_t reserved_0;            /* System handle. */
 
        uint16_t comp_func_num;
-       uint16_t fw_iotcl_flags;
+       __le16 fw_iotcl_flags;
 
-       uint32_t dataword_r;            /* Data word returned */
+       __le32 dataword_r;              /* Data word returned */
        uint32_t adapid;                /* Adapter ID */
        uint32_t adapid_hi;             /* Adapter ID high */
        uint32_t reserved_1;
 
-       uint32_t seq_no;
+       __le32 seq_no;
        uint8_t reserved_2[20];
        uint32_t residuallen;
-       uint32_t status;
+       __le32 status;
 };
 
 #define STATUS_CONT_TYPE_FX00 0x04
@@ -189,26 +189,26 @@ struct fxdisc_entry_fx00 {
        uint8_t sys_define;             /* System Defined. */
        uint8_t entry_status;           /* Entry Status. */
 
-       uint32_t handle;                /* System handle. */
-       uint32_t reserved_0;            /* System handle. */
+       __le32 handle;          /* System handle. */
+       __le32 reserved_0;              /* System handle. */
 
-       uint16_t func_num;
-       uint16_t req_xfrcnt;
-       uint16_t req_dsdcnt;
-       uint16_t rsp_xfrcnt;
-       uint16_t rsp_dsdcnt;
+       __le16 func_num;
+       __le16 req_xfrcnt;
+       __le16 req_dsdcnt;
+       __le16 rsp_xfrcnt;
+       __le16 rsp_dsdcnt;
        uint8_t flags;
        uint8_t reserved_1;
 
-       uint32_t dseg_rq_address[2];    /* Data segment 0 address. */
-       uint32_t dseg_rq_len;           /* Data segment 0 length. */
-       uint32_t dseg_rsp_address[2];   /* Data segment 1 address. */
-       uint32_t dseg_rsp_len;          /* Data segment 1 length. */
+       __le32 dseg_rq_address[2];      /* Data segment 0 address. */
+       __le32 dseg_rq_len;             /* Data segment 0 length. */
+       __le32 dseg_rsp_address[2];     /* Data segment 1 address. */
+       __le32 dseg_rsp_len;            /* Data segment 1 length. */
 
-       uint32_t dataword;
-       uint32_t adapid;
-       uint32_t adapid_hi;
-       uint32_t dataword_extra;
+       __le32 dataword;
+       __le32 adapid;
+       __le32 adapid_hi;
+       __le32 dataword_extra;
 };
 
 struct qlafx00_tgt_node_info {
@@ -421,43 +421,43 @@ struct config_info_data {
        WRT_REG_DWORD((ha)->cregbase + off, val)
 
 struct qla_mt_iocb_rqst_fx00 {
-       uint32_t reserved_0;
+       __le32 reserved_0;
 
-       uint16_t func_type;
+       __le16 func_type;
        uint8_t flags;
        uint8_t reserved_1;
 
-       uint32_t dataword;
+       __le32 dataword;
 
-       uint32_t adapid;
-       uint32_t adapid_hi;
+       __le32 adapid;
+       __le32 adapid_hi;
 
-       uint32_t dataword_extra;
+       __le32 dataword_extra;
 
-       uint32_t req_len;
+       __le32 req_len;
 
-       uint32_t rsp_len;
+       __le32 rsp_len;
 };
 
 struct qla_mt_iocb_rsp_fx00 {
        uint32_t reserved_1;
 
        uint16_t func_type;
-       uint16_t ioctl_flags;
+       __le16 ioctl_flags;
 
-       uint32_t ioctl_data;
+       __le32 ioctl_data;
 
        uint32_t adapid;
        uint32_t adapid_hi;
 
        uint32_t reserved_2;
-       uint32_t seq_number;
+       __le32 seq_number;
 
        uint8_t reserved_3[20];
 
        int32_t res_count;
 
-       uint32_t status;
+       __le32 status;
 };