Change __constant_cpu_... into cpu_... since the latter is also evaluated at compile time.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3806 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2011-08-14 19:03:03 +00:00
parent 0042639266
commit 49147b3d8d
6 changed files with 72 additions and 84 deletions

View File

@@ -227,7 +227,7 @@ static int send_rsp(struct iu_entry *iue, struct scst_cmd *sc,
memset(iu, 0, sizeof(struct srp_rsp));
iu->srp.rsp.opcode = SRP_RSP;
iu->srp.rsp.req_lim_delta = __constant_cpu_to_be32(1
iu->srp.rsp.req_lim_delta = cpu_to_be32(1
+ atomic_xchg(&vport->req_lim_delta, 0));
iu->srp.rsp.tag = tag;
@@ -262,7 +262,7 @@ static int send_rsp(struct iu_entry *iue, struct scst_cmd *sc,
iu->srp.rsp.status = SAM_STAT_CHECK_CONDITION;
iu->srp.rsp.flags |= SRP_RSP_FLAG_SNSVALID;
iu->srp.rsp.sense_data_len
= __constant_cpu_to_be32(SRP_RSP_SENSE_DATA_LEN);
= cpu_to_be32(SRP_RSP_SENSE_DATA_LEN);
/* Valid bit and 'current errors' */
sense[0] = (0x1 << 7 | 0x70);
@@ -577,8 +577,7 @@ static void process_login(struct iu_entry *iue)
snprintf(name, sizeof(name), "%x", vport->dma_dev->unit_address);
if (!ibmvstgt_is_target_enabled(target->tgt)) {
rej->reason =
__constant_cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
PRINT_ERROR("rejected SRP_LOGIN_REQ because the target %s"
" has not yet been enabled", name);
goto reject;
@@ -593,8 +592,7 @@ static void process_login(struct iu_entry *iue)
sess = scst_register_session(target->tgt, 0, name, vport, NULL, NULL);
if (!sess) {
rej->reason =
__constant_cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
TRACE_DBG("%s", "Failed to create SCST session");
goto reject;
}
@@ -612,11 +610,11 @@ static void process_login(struct iu_entry *iue)
rsp->req_lim_delta = cpu_to_be32(min(SRP_REQ_LIM,
scst_get_max_lun_commands(NULL, 0)));
rsp->tag = tag;
rsp->max_it_iu_len = __constant_cpu_to_be32(sizeof(union srp_iu));
rsp->max_ti_iu_len = __constant_cpu_to_be32(sizeof(union srp_iu));
rsp->max_it_iu_len = cpu_to_be32(sizeof(union srp_iu));
rsp->max_ti_iu_len = cpu_to_be32(sizeof(union srp_iu));
/* direct and indirect */
rsp->buf_fmt = __constant_cpu_to_be16(SRP_BUF_FORMAT_DIRECT
| SRP_BUF_FORMAT_INDIRECT);
rsp->buf_fmt = cpu_to_be16(SRP_BUF_FORMAT_DIRECT
| SRP_BUF_FORMAT_INDIRECT);
send_iu(iue, sizeof(*rsp), VIOSRP_SRP_FORMAT);
@@ -625,8 +623,8 @@ static void process_login(struct iu_entry *iue)
reject:
rej->opcode = SRP_LOGIN_REJ;
rej->tag = tag;
rej->buf_fmt = __constant_cpu_to_be16(SRP_BUF_FORMAT_DIRECT
| SRP_BUF_FORMAT_INDIRECT);
rej->buf_fmt = cpu_to_be16(SRP_BUF_FORMAT_DIRECT
| SRP_BUF_FORMAT_INDIRECT);
send_iu(iue, sizeof *rsp, VIOSRP_SRP_FORMAT);
}

View File

@@ -3617,7 +3617,7 @@ static int iscsi_scsi_aen(struct scst_aen *aen)
rsp_hdr->opcode = ISCSI_OP_ASYNC_MSG;
rsp_hdr->flags = ISCSI_FLG_FINAL;
rsp_hdr->lun = lun; /* it's already in SCSI form */
rsp_hdr->ffffffff = __constant_cpu_to_be32(0xffffffff);
rsp_hdr->ffffffff = cpu_to_be32(0xffffffff);
rsp_hdr->async_event = ISCSI_ASYNC_SCSI;
sg = rsp->sg = rsp->rsp_sg;

View File

@@ -517,7 +517,7 @@ struct iscsi_nop_in_hdr {
} __packed;
#define ISCSI_RESERVED_TAG_CPU32 (0xffffffffU)
#define ISCSI_RESERVED_TAG (__constant_cpu_to_be32(ISCSI_RESERVED_TAG_CPU32))
#define ISCSI_RESERVED_TAG (cpu_to_be32(ISCSI_RESERVED_TAG_CPU32))
#define cmnd_hdr(cmnd) ((struct iscsi_scsi_cmd_hdr *) (&((cmnd)->pdu.bhs)))
#define cmnd_opcode(cmnd) ((cmnd)->pdu.bhs.opcode & ISCSI_OPCODE_MASK)

View File

@@ -1561,7 +1561,7 @@ static void q2x_send_notify_ack(scsi_qla_host_t *ha, notify_entry_t *iocb,
ntfy->task_flags = iocb->task_flags;
ntfy->seq_id = iocb->seq_id;
/* Do not increment here, the chip isn't decrementing */
/* ntfy->flags = __constant_cpu_to_le16(NOTIFY_ACK_RES_COUNT); */
/* ntfy->flags = cpu_to_le16(NOTIFY_ACK_RES_COUNT); */
ntfy->flags |= cpu_to_le16(add_flags);
ntfy->srr_rx_id = iocb->srr_rx_id;
ntfy->srr_rel_offs = iocb->srr_rel_offs;
@@ -1573,8 +1573,7 @@ static void q2x_send_notify_ack(scsi_qla_host_t *ha, notify_entry_t *iocb,
if (resp_code_valid) {
ntfy->resp_code = cpu_to_le16(resp_code);
ntfy->flags |= __constant_cpu_to_le16(
NOTIFY_ACK_TM_RESP_CODE_VALID);
ntfy->flags |= cpu_to_le16(NOTIFY_ACK_TM_RESP_CODE_VALID);
}
TRACE(TRACE_SCSI, "qla2x00t(%ld): Sending Notify Ack Seq %#x -> I %#x "
@@ -1623,7 +1622,7 @@ static void q24_send_abts_resp(scsi_qla_host_t *ha,
resp->sof_type = abts->sof_type;
resp->exchange_address = abts->exchange_address;
resp->fcp_hdr_le = abts->fcp_hdr_le;
f_ctl = __constant_cpu_to_le32(F_CTL_EXCH_CONTEXT_RESP |
f_ctl = cpu_to_le32(F_CTL_EXCH_CONTEXT_RESP |
F_CTL_LAST_SEQ | F_CTL_END_SEQ |
F_CTL_SEQ_INITIATIVE);
p = (uint8_t *)&f_ctl;
@@ -1703,13 +1702,13 @@ static void q24_retry_term_exchange(scsi_qla_host_t *ha,
ctio->common.entry_count = 1;
ctio->common.nport_handle = entry->nport_handle;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = ha->vp_idx;
ctio->common.initiator_id[0] = entry->fcp_hdr_le.d_id[0];
ctio->common.initiator_id[1] = entry->fcp_hdr_le.d_id[1];
ctio->common.initiator_id[2] = entry->fcp_hdr_le.d_id[2];
ctio->common.exchange_addr = entry->exchange_addr_to_abort;
ctio->flags = __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE);
ctio->flags = cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE);
ctio->ox_id = entry->fcp_hdr_le.ox_id;
TRACE_BUFFER("CTIO7 retry TERM EXCH packet data", ctio, REQUEST_ENTRY_SIZE);
@@ -1852,17 +1851,17 @@ static void q24_send_task_mgmt_ctio(scsi_qla_host_t *ha,
ctio->common.entry_count = 1;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.nport_handle = mcmd->sess->loop_id;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = ha->vp_idx;
ctio->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
ctio->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
ctio->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
ctio->common.exchange_addr = atio->exchange_addr;
ctio->flags = (atio->attr << 9) | __constant_cpu_to_le16(
ctio->flags = (atio->attr << 9) | cpu_to_le16(
CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_SEND_STATUS);
ctio->ox_id = swab16(atio->fcp_hdr.ox_id);
ctio->scsi_status = __constant_cpu_to_le16(SS_RESPONSE_INFO_LEN_VALID);
ctio->response_len = __constant_cpu_to_le16(8);
ctio->scsi_status = cpu_to_le16(SS_RESPONSE_INFO_LEN_VALID);
ctio->response_len = cpu_to_le16(8);
((uint32_t *)ctio->sense_data)[0] = cpu_to_be32(resp_code);
TRACE_BUFFER("CTIO7 TASK MGMT packet data", ctio, REQUEST_ENTRY_SIZE);
@@ -1906,7 +1905,7 @@ static void q24_send_notify_ack(scsi_qla_host_t *ha,
nack->nport_handle = iocb->nport_handle;
if (le16_to_cpu(iocb->status) == IMM_NTFY_ELS) {
nack->flags = iocb->flags &
__constant_cpu_to_le32(NOTIFY24XX_FLAGS_PUREX_IOCB);
cpu_to_le32(NOTIFY24XX_FLAGS_PUREX_IOCB);
}
nack->srr_rx_id = iocb->srr_rx_id;
nack->status = iocb->status;
@@ -2168,7 +2167,7 @@ static void q2x_build_ctio_pkt(struct q2t_prm *prm)
ha->cmds[h-1] = prm->cmd;
pkt->common.handle = h | CTIO_COMPLETION_HANDLE_MARK;
pkt->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
pkt->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
/* Set initiator ID */
h = GET_TARGET_ID(ha, &prm->cmd->atio.atio2x);
@@ -2217,7 +2216,7 @@ static int q24_build_ctio_pkt(struct q2t_prm *prm)
pkt->common.handle = h | CTIO_COMPLETION_HANDLE_MARK;
pkt->common.nport_handle = prm->cmd->loop_id;
pkt->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
pkt->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
pkt->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
pkt->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
pkt->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
@@ -2347,8 +2346,7 @@ static void q2x_load_data_segments(struct q2t_prm *prm)
cpu_to_le32(pci_dma_lo32(sg_dma_address(prm->sg)));
if (enable_64bit_addressing) {
*dword_ptr++ =
cpu_to_le32(pci_dma_hi32
(sg_dma_address(prm->sg)));
cpu_to_le32(pci_dma_hi32(sg_dma_address(prm->sg)));
}
*dword_ptr++ = cpu_to_le32(sg_dma_len(prm->sg));
@@ -2411,8 +2409,7 @@ static void q24_load_data_segments(struct q2t_prm *prm)
cpu_to_le32(pci_dma_lo32(sg_dma_address(prm->sg)));
if (enable_64bit_addressing) {
*dword_ptr++ =
cpu_to_le32(pci_dma_hi32(
sg_dma_address(prm->sg)));
cpu_to_le32(pci_dma_hi32(sg_dma_address(prm->sg)));
}
*dword_ptr++ = cpu_to_le32(sg_dma_len(prm->sg));
@@ -2580,22 +2577,20 @@ static void q2x_init_ctio_ret_entry(ctio_ret_entry_t *ctio_m1,
prm->sense_buffer_len = min((uint32_t)prm->sense_buffer_len,
(uint32_t)sizeof(ctio_m1->sense_data));
ctio_m1->flags = __constant_cpu_to_le16(OF_SSTS | OF_FAST_POST |
ctio_m1->flags = cpu_to_le16(OF_SSTS | OF_FAST_POST |
OF_NO_DATA | OF_SS_MODE_1);
ctio_m1->flags |= __constant_cpu_to_le16(OF_INC_RC);
ctio_m1->flags |= cpu_to_le16(OF_INC_RC);
if (q2t_need_explicit_conf(prm->tgt->ha, prm->cmd, 0)) {
ctio_m1->flags |= __constant_cpu_to_le16(OF_EXPL_CONF |
OF_CONF_REQ);
ctio_m1->flags |= cpu_to_le16(OF_EXPL_CONF | OF_CONF_REQ);
}
ctio_m1->scsi_status = cpu_to_le16(prm->rq_result);
ctio_m1->residual = cpu_to_le32(prm->residual);
if (SCST_SENSE_VALID(prm->sense_buffer)) {
if (q2t_need_explicit_conf(prm->tgt->ha, prm->cmd, 1)) {
ctio_m1->flags |= __constant_cpu_to_le16(OF_EXPL_CONF |
OF_CONF_REQ);
ctio_m1->flags |= cpu_to_le16(OF_EXPL_CONF |
OF_CONF_REQ);
}
ctio_m1->scsi_status |= __constant_cpu_to_le16(
SS_SENSE_LEN_VALID);
ctio_m1->scsi_status |= cpu_to_le16(SS_SENSE_LEN_VALID);
ctio_m1->sense_length = cpu_to_le16(prm->sense_buffer_len);
memcpy(ctio_m1->sense_data, prm->sense_buffer,
prm->sense_buffer_len);
@@ -2638,8 +2633,8 @@ static int __q2x_xmit_response(struct q2t_cmd *cmd, int xmit_type)
pkt = (ctio_common_entry_t *)prm.pkt;
if (q2t_has_data(cmd) && (xmit_type & Q2T_XMIT_DATA)) {
pkt->flags |= __constant_cpu_to_le16(OF_FAST_POST | OF_DATA_IN);
pkt->flags |= __constant_cpu_to_le16(OF_INC_RC);
pkt->flags |= cpu_to_le16(OF_FAST_POST | OF_DATA_IN);
pkt->flags |= cpu_to_le16(OF_INC_RC);
q2x_load_data_segments(&prm);
@@ -2647,9 +2642,9 @@ static int __q2x_xmit_response(struct q2t_cmd *cmd, int xmit_type)
if (xmit_type & Q2T_XMIT_STATUS) {
pkt->scsi_status = cpu_to_le16(prm.rq_result);
pkt->residual = cpu_to_le32(prm.residual);
pkt->flags |= __constant_cpu_to_le16(OF_SSTS);
pkt->flags |= cpu_to_le16(OF_SSTS);
if (q2t_need_explicit_conf(ha, cmd, 0)) {
pkt->flags |= __constant_cpu_to_le16(
pkt->flags |= cpu_to_le16(
OF_EXPL_CONF |
OF_CONF_REQ);
}
@@ -2671,7 +2666,7 @@ static int __q2x_xmit_response(struct q2t_cmd *cmd, int xmit_type)
/* Real finish is ctio_m1's finish */
pkt->handle |= CTIO_INTERMEDIATE_HANDLE_MARK;
pkt->flags &= ~__constant_cpu_to_le16(OF_INC_RC);
pkt->flags &= ~cpu_to_le16(OF_INC_RC);
q2x_init_ctio_ret_entry(ctio_m1, &prm);
TRACE_BUFFER("Status CTIO packet data", ctio_m1,
@@ -2790,9 +2785,9 @@ static void q24_init_ctio_ret_entry(ctio7_status0_entry_t *ctio,
prm->sense_buffer_len = min((uint32_t)prm->sense_buffer_len,
(uint32_t)sizeof(ctio1->sense_data));
ctio->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_SEND_STATUS);
ctio->flags |= cpu_to_le16(CTIO7_FLAGS_SEND_STATUS);
if (q2t_need_explicit_conf(prm->tgt->ha, prm->cmd, 0)) {
ctio->flags |= __constant_cpu_to_le16(
ctio->flags |= cpu_to_le16(
CTIO7_FLAGS_EXPLICIT_CONFORM |
CTIO7_FLAGS_CONFORM_REQ);
}
@@ -2802,13 +2797,13 @@ static void q24_init_ctio_ret_entry(ctio7_status0_entry_t *ctio,
int i;
ctio1 = (ctio7_status1_entry_t *)ctio;
if (q2t_need_explicit_conf(prm->tgt->ha, prm->cmd, 1)) {
ctio1->flags |= __constant_cpu_to_le16(
ctio1->flags |= cpu_to_le16(
CTIO7_FLAGS_EXPLICIT_CONFORM |
CTIO7_FLAGS_CONFORM_REQ);
}
ctio1->flags &= ~__constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->scsi_status |= __constant_cpu_to_le16(SS_SENSE_LEN_VALID);
ctio1->flags &= ~cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->scsi_status |= cpu_to_le16(SS_SENSE_LEN_VALID);
ctio1->sense_length = cpu_to_le16(prm->sense_buffer_len);
for (i = 0; i < prm->sense_buffer_len/4; i++)
((uint32_t *)ctio1->sense_data)[i] =
@@ -2826,8 +2821,8 @@ static void q24_init_ctio_ret_entry(ctio7_status0_entry_t *ctio,
#endif
} else {
ctio1 = (ctio7_status1_entry_t *)ctio;
ctio1->flags &= ~__constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->flags &= ~cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_0);
ctio1->flags |= cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1);
ctio1->sense_length = 0;
memset(ctio1->sense_data, 0, sizeof(ctio1->sense_data));
}
@@ -2869,8 +2864,8 @@ static int __q24_xmit_response(struct q2t_cmd *cmd, int xmit_type)
pkt = (ctio7_status0_entry_t *)prm.pkt;
if (q2t_has_data(cmd) && (xmit_type & Q2T_XMIT_DATA)) {
pkt->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_DATA_IN |
CTIO7_FLAGS_STATUS_MODE_0);
pkt->flags |= cpu_to_le16(CTIO7_FLAGS_DATA_IN |
CTIO7_FLAGS_STATUS_MODE_0);
q24_load_data_segments(&prm);
@@ -2878,10 +2873,10 @@ static int __q24_xmit_response(struct q2t_cmd *cmd, int xmit_type)
if (xmit_type & Q2T_XMIT_STATUS) {
pkt->scsi_status = cpu_to_le16(prm.rq_result);
pkt->residual = cpu_to_le32(prm.residual);
pkt->flags |= __constant_cpu_to_le16(
pkt->flags |= cpu_to_le16(
CTIO7_FLAGS_SEND_STATUS);
if (q2t_need_explicit_conf(ha, cmd, 0)) {
pkt->flags |= __constant_cpu_to_le16(
pkt->flags |= cpu_to_le16(
CTIO7_FLAGS_EXPLICIT_CONFORM |
CTIO7_FLAGS_CONFORM_REQ);
}
@@ -2900,13 +2895,11 @@ static int __q24_xmit_response(struct q2t_cmd *cmd, int xmit_type)
memcpy(ctio, pkt, sizeof(*ctio));
ctio->common.entry_count = 1;
ctio->common.dseg_count = 0;
ctio->flags &= ~__constant_cpu_to_le16(
CTIO7_FLAGS_DATA_IN);
ctio->flags &= ~cpu_to_le16(CTIO7_FLAGS_DATA_IN);
/* Real finish is ctio_m1's finish */
pkt->common.handle |= CTIO_INTERMEDIATE_HANDLE_MARK;
pkt->flags |= __constant_cpu_to_le16(
CTIO7_FLAGS_DONT_RET_CTIO);
pkt->flags |= cpu_to_le16(CTIO7_FLAGS_DONT_RET_CTIO);
q24_init_ctio_ret_entry((ctio7_status0_entry_t *)ctio,
&prm);
TRACE_BUFFER("Status CTIO7", ctio, REQUEST_ENTRY_SIZE);
@@ -2981,15 +2974,15 @@ static int __q2t_rdy_to_xfer(struct q2t_cmd *cmd)
if (unlikely(res != SCST_TGT_RES_SUCCESS))
goto out_unlock_free_unmap;
pkt = (ctio7_status0_entry_t *)prm.pkt;
pkt->flags |= __constant_cpu_to_le16(CTIO7_FLAGS_DATA_OUT |
CTIO7_FLAGS_STATUS_MODE_0);
pkt->flags |= cpu_to_le16(CTIO7_FLAGS_DATA_OUT |
CTIO7_FLAGS_STATUS_MODE_0);
q24_load_data_segments(&prm);
p = pkt;
} else {
ctio_common_entry_t *pkt;
q2x_build_ctio_pkt(&prm);
pkt = (ctio_common_entry_t *)prm.pkt;
pkt->flags = __constant_cpu_to_le16(OF_FAST_POST | OF_DATA_OUT);
pkt->flags = cpu_to_le16(OF_FAST_POST | OF_DATA_OUT);
q2x_load_data_segments(&prm);
p = pkt;
}
@@ -3083,9 +3076,9 @@ static void q2x_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd,
if (ctio->residual != 0)
ctio->scsi_status |= SS_RESIDUAL_UNDER;
ctio->flags = __constant_cpu_to_le16(OF_FAST_POST | OF_TERM_EXCH |
OF_NO_DATA | OF_SS_MODE_1);
ctio->flags |= __constant_cpu_to_le16(OF_INC_RC);
ctio->flags = cpu_to_le16(OF_FAST_POST | OF_TERM_EXCH |
OF_NO_DATA | OF_SS_MODE_1);
ctio->flags |= cpu_to_le16(OF_INC_RC);
TRACE_BUFFER("CTIO TERM EXCH packet data", ctio, REQUEST_ENTRY_SIZE);
@@ -3149,13 +3142,13 @@ static void q24_send_term_exchange(scsi_qla_host_t *ha, struct q2t_cmd *cmd,
} else
ctio->common.nport_handle = CTIO7_NHANDLE_UNRECOGNIZED;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = ha->vp_idx;
ctio->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
ctio->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
ctio->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
ctio->common.exchange_addr = atio->exchange_addr;
ctio->flags = (atio->attr << 9) | __constant_cpu_to_le16(
ctio->flags = (atio->attr << 9) | cpu_to_le16(
CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_TERMINATE);
ctio->ox_id = swab16(atio->fcp_hdr.ox_id);
@@ -3310,8 +3303,7 @@ static int q2t_term_ctio_exchange(scsi_qla_host_t *ha, void *ctio,
if (IS_FWI2_CAPABLE(ha)) {
if (ctio != NULL) {
ctio7_fw_entry_t *c = (ctio7_fw_entry_t *)ctio;
term = !(c->flags &
__constant_cpu_to_le16(OF_TERM_EXCH));
term = !(c->flags & cpu_to_le16(OF_TERM_EXCH));
} else
term = 1;
if (term) {
@@ -3324,9 +3316,7 @@ static int q2t_term_ctio_exchange(scsi_qla_host_t *ha, void *ctio,
#if 0 /* seems, it isn't needed */
if (ctio != NULL) {
ctio_common_entry_t *c = (ctio_common_entry_t *)ctio;
term = !(c->flags &
__constant_cpu_to_le16(
CTIO7_FLAGS_TERMINATE));
term = !(c->flags & cpu_to_le16(CTIO7_FLAGS_TERMINATE));
} else
term = 1;
if (term) {
@@ -4825,7 +4815,7 @@ static void q2x_send_busy(scsi_qla_host_t *ha, atio_entry_t *atio)
ctio->entry_type = CTIO_RET_TYPE;
ctio->entry_count = 1;
ctio->handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->scsi_status = __constant_cpu_to_le16(SAM_STAT_BUSY);
ctio->scsi_status = cpu_to_le16(SAM_STAT_BUSY);
ctio->residual = atio->data_length;
if (ctio->residual != 0)
ctio->scsi_status |= SS_RESIDUAL_UNDER;
@@ -4834,9 +4824,9 @@ static void q2x_send_busy(scsi_qla_host_t *ha, atio_entry_t *atio)
SET_TARGET_ID(ha, ctio->target, GET_TARGET_ID(ha, atio));
ctio->rx_id = atio->rx_id;
ctio->flags = __constant_cpu_to_le16(OF_SSTS | OF_FAST_POST |
ctio->flags = cpu_to_le16(OF_SSTS | OF_FAST_POST |
OF_NO_DATA | OF_SS_MODE_1);
ctio->flags |= __constant_cpu_to_le16(OF_INC_RC);
ctio->flags |= cpu_to_le16(OF_INC_RC);
/*
* CTIO from fw w/o scst_cmd doesn't provide enough info to retry it,
* if the explicit conformation is used.
@@ -4889,13 +4879,13 @@ static void q24_send_busy(scsi_qla_host_t *ha, atio7_entry_t *atio,
ctio->common.entry_count = 1;
ctio->common.handle = Q2T_SKIP_HANDLE | CTIO_COMPLETION_HANDLE_MARK;
ctio->common.nport_handle = loop_id;
ctio->common.timeout = __constant_cpu_to_le16(Q2T_TIMEOUT);
ctio->common.timeout = cpu_to_le16(Q2T_TIMEOUT);
ctio->common.vp_index = ha->vp_idx;
ctio->common.initiator_id[0] = atio->fcp_hdr.s_id[2];
ctio->common.initiator_id[1] = atio->fcp_hdr.s_id[1];
ctio->common.initiator_id[2] = atio->fcp_hdr.s_id[0];
ctio->common.exchange_addr = atio->exchange_addr;
ctio->flags = (atio->attr << 9) | __constant_cpu_to_le16(
ctio->flags = (atio->attr << 9) | cpu_to_le16(
CTIO7_FLAGS_STATUS_MODE_1 | CTIO7_FLAGS_SEND_STATUS |
CTIO7_FLAGS_DONT_RET_CTIO);
/*
@@ -5079,7 +5069,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, response_t *pkt)
GET_TARGET_ID(ha, atio), atio->rx_id);
TRACE_BUFFER("Incoming ATIO packet data", atio,
REQUEST_ENTRY_SIZE);
if (atio->status != __constant_cpu_to_le16(ATIO_CDB_VALID)) {
if (atio->status != cpu_to_le16(ATIO_CDB_VALID)) {
PRINT_ERROR("qla2x00t(%ld): ATIO with error "
"status %x received", ha->instance,
le16_to_cpu(atio->status));
@@ -5144,7 +5134,7 @@ static void q2t_response_pkt(scsi_qla_host_t *ha, response_t *pkt)
TRACE_BUFFER("Incoming NOTIFY_ACK packet data", pkt,
RESPONSE_ENTRY_SIZE);
tgt->notify_ack_expected--;
if (entry->status != __constant_cpu_to_le16(NOTIFY_ACK_SUCCESS)) {
if (entry->status != cpu_to_le16(NOTIFY_ACK_SUCCESS)) {
PRINT_ERROR("qla2x00t(%ld): NOTIFY_ACK "
"failed %x", ha->instance,
le16_to_cpu(entry->status));

View File

@@ -1621,7 +1621,7 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd)
(uint32_t *)&buf[12]);
if (virt_dev->thin_provisioned) {
/* MAXIMUM UNMAP BLOCK DESCRIPTOR COUNT is UNLIMITED */
put_unaligned(__constant_cpu_to_be32(0xFFFFFFFF),
put_unaligned(cpu_to_be32(0xFFFFFFFF),
(uint32_t *)&buf[24]);
if (virt_dev->blockio) {
/*
@@ -1641,10 +1641,10 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd)
}
} else {
/* MAXIMUM UNMAP LBA COUNT is UNLIMITED */
put_unaligned(__constant_cpu_to_be32(0xFFFFFFFF),
put_unaligned(cpu_to_be32(0xFFFFFFFF),
(uint32_t *)&buf[20]);
/* OPTIMAL UNMAP GRANULARITY is 1 */
put_unaligned(__constant_cpu_to_be32(1),
put_unaligned(cpu_to_be32(1),
(uint32_t *)&buf[28]);
}
}

View File

@@ -5300,7 +5300,7 @@ uint64_t scst_unpack_lun(const uint8_t *lun, int len)
switch (len) {
case 8:
if ((*((__be64 *)lun) &
__constant_cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
cpu_to_be64(0x0000FFFFFFFFFFFFLL)) != 0)
goto out_err;
break;
case 4: