]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qla2xxx: Remove __constant_ prefix
authorBart Van Assche <bart.vanassche@sandisk.com>
Tue, 6 Oct 2015 08:23:48 +0000 (13:53 +0530)
committerDan Duval <dan.duval@oracle.com>
Thu, 15 Oct 2015 21:37:42 +0000 (17:37 -0400)
Orabug: 21946579

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.

[jejb: checkpatch fixes]
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Acked-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_gs.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_mr.c
drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_sup.c

index 6e595b7dd9e0e64f80a93f828ff21649af32e180..cf3f84e404259bb174fce42d64678da86656e3c4 100644 (file)
@@ -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));
@@ -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;
@@ -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(&reg->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. */
index dccc4dcc39c888cdfa51b78c86fb536cb38b1453..94e8a8592f6904be9b4bbe408f705b0e28a342f8 100644 (file)
@@ -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);
 
index 4795578013f77a4ab13baa5f3cae710c530302a7..9d74399ebafa41afe0cbb47f67cdcc97e2b9ea58 100644 (file)
@@ -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));
@@ -2112,11 +2112,11 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
 
        if (IS_SHADOW_REG_CAPABLE(ha))
                icb->firmware_options_2 |=
-                   __constant_cpu_to_le32(BIT_30|BIT_29);
+                   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 +2126,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(&reg->isp25mq.req_q_in, 0);
                WRT_REG_DWORD(&reg->isp25mq.req_q_out, 0);
@@ -2243,7 +2239,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 */
@@ -2658,22 +2654,22 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
                        nv->firmware_options[1] = BIT_7 | BIT_5;
                        nv->add_firmware_options[0] = BIT_5;
                        nv->add_firmware_options[1] = BIT_5 | BIT_4;
-                       nv->frame_payload_size = 2048;
+                       nv->frame_payload_size = cpu_to_le16(2048_;
                        nv->special_options[1] = BIT_7;
                } else if (IS_QLA2200(ha)) {
                        nv->firmware_options[0] = BIT_2 | BIT_1;
                        nv->firmware_options[1] = BIT_7 | BIT_5;
                        nv->add_firmware_options[0] = BIT_5;
                        nv->add_firmware_options[1] = BIT_5 | BIT_4;
-                       nv->frame_payload_size = 1024;
+                       nv->frame_payload_size = cpu_to_le16(1024);
                } else if (IS_QLA2100(ha)) {
                        nv->firmware_options[0] = BIT_3 | BIT_1;
                        nv->firmware_options[1] = BIT_5;
-                       nv->frame_payload_size = 1024;
+                       nv->frame_payload_size = cpu_to_le16(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 +2687,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;
@@ -2705,7 +2701,7 @@ qla2x00_nvram_config(scsi_qla_host_t *vha)
         * are valid.
         */
        if (ia64_platform_is("sn2")) {
-               nv->frame_payload_size = 2048;
+               nv->frame_payload_size = cpu_to_le16(2048);
                if (IS_QLA23XX(ha))
                        nv->special_options[1] = BIT_7;
        }
@@ -2819,7 +2815,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 +2867,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 */
@@ -5094,7 +5090,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 "
@@ -5107,12 +5103,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->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->nvram_version = cpu_to_le16(ICB_VERSION);
+               nv->version = cpu_to_le16(ICB_VERSION);
+               nv->frame_payload_size = cpu_to_le16(2048);
+               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;
@@ -5130,20 +5126,20 @@ 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;
        }
@@ -5186,14 +5182,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.
@@ -5225,7 +5221,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);
 
@@ -5233,7 +5229,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;
 
@@ -5284,7 +5280,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) {
@@ -6040,7 +6036,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 "
@@ -6054,11 +6050,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->frame_payload_size = 2048;
-               nv->execution_throttle = __constant_cpu_to_le16(0xFFFF);
-               nv->exchange_count = __constant_cpu_to_le16(0);
+               nv->nvram_version = cpu_to_le16(ICB_VERSION);
+               nv->version = cpu_to_le16(ICB_VERSION);
+               nv->frame_payload_size = cpu_to_le16(2048);
+               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;
@@ -6075,20 +6071,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;
@@ -6100,7 +6096,7 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
        }
 
        if (IS_T10_PI_CAPABLE(ha))
-               nv->frame_payload_size &= ~7;
+               nv->frame_payload_size &= cpu_to_le16(~7);
 
        qlt_81xx_config_nvram_stage1(vha, nv);
 
@@ -6147,13 +6143,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.
@@ -6182,7 +6178,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);
 
@@ -6190,7 +6186,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;
 
@@ -6236,7 +6232,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) {
@@ -6245,7 +6241,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) {
index 90e22896709f8ecfe5ce93a2f743c749dbcae1a9..a543f18c355fd6ae76683e8b085c786356b0a3a8 100644 (file)
@@ -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;
 
@@ -1244,8 +1236,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;
@@ -1253,7 +1244,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;
        }
 
@@ -1262,10 +1253,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) ||
@@ -1387,7 +1378,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 +
@@ -1395,13 +1386,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,
@@ -1414,7 +1404,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);
+                       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))
@@ -1746,7 +1736,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. */
@@ -2034,10 +2024,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 ?
@@ -2088,13 +2078,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 =
@@ -2167,13 +2157,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 =
@@ -2667,7 +2657,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
@@ -2675,8 +2665,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;
index f0ff9944bc9368d63c33c0adb444d227b24956b5..79f69899b71f24a453b95ba3c9f9829c8977696a 100644 (file)
@@ -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);
index 65c2dc1e929a95aaf66015e11010d19b3c0f7c08..635b23ee0c4d630a1680dcb64d911e0e28dcc83b 100644 (file)
@@ -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]);
 
@@ -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));
index 8a0f1c9e8516d302a5b3617de7a28f1ed6b242e1..c3f69f4bc150323571b7d058ed29f10301cb73db 100644 (file)
@@ -1869,7 +1869,7 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type)
                                fdisc->u.fxiocb.req_addr;
                        phost_info = &preg_hsi->hsi;
                        memset(preg_hsi, 0, sizeof(struct register_host_info));
-                       phost_info->os_type = OS_TYPE_LINUX;
+                       phost_info->os_type = cpu_to_le32(OS_TYPE_LINUX);
                        strncpy(phost_info->sysname,
                            p_sysid->sysname, SYSNAME_LENGTH);
                        strncpy(phost_info->nodename,
@@ -1887,7 +1887,7 @@ qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type)
                        strncpy(phost_info->hostdriver,
                            QLA2XXX_VERSION, VERSION_LENGTH);
                        do_gettimeofday(&tv);
-                       preg_hsi->utc = (uint64_t)tv.tv_sec;
+                       preg_hsi->utc = cpu_to_le64(tv.tv_sec);
                        ql_dbg(ql_dbg_init, vha, 0x0149,
                            "ISP%04X: Host registration with firmware\n",
                            ha->pdev->device);
@@ -2976,7 +2976,7 @@ qlafx00_prep_cont_type1_iocb(struct req_que *req,
        cont_pkt = (cont_a64_entry_t *)req->ring_ptr;
 
        /* Load packet defaults. */
-       lcont_pkt->entry_type = CONTINUE_A64_TYPE_FX00;
+       lcont_pkt->entry_type = cpu_to_le32(CONTINUE_A64_TYPE_FX00);
 
        return cont_pkt;
 }
@@ -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;
        }
 
index d4027fb6e41029cba9f32ea51deab307d399fd78..287a182c913385c21808112d51c7c1d460f4a947 100644 (file)
@@ -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;
index 028e8c8a7de9a897ac68ad8c09a2d47be0276f5c..e44d54231cdc06a86609891d0da1a491bd3f51b1 100644 (file)
@@ -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",