mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
ib_srpt: Convert sizeof e into sizeof(e) (merge r4540 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@5154 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -426,7 +426,7 @@ static void srpt_get_class_port_info(struct ib_dm_mad *mad)
|
||||
struct ib_class_port_info *cif;
|
||||
|
||||
cif = (struct ib_class_port_info *)mad->data;
|
||||
memset(cif, 0, sizeof *cif);
|
||||
memset(cif, 0, sizeof(*cif));
|
||||
cif->base_version = 1;
|
||||
cif->class_version = 1;
|
||||
cif->resp_time_value = 20;
|
||||
@@ -482,7 +482,7 @@ static void srpt_get_ioc(struct srpt_device *sdev, u32 slot,
|
||||
return;
|
||||
}
|
||||
|
||||
memset(iocp, 0, sizeof *iocp);
|
||||
memset(iocp, 0, sizeof(*iocp));
|
||||
strcpy(iocp->id_string, SRPT_ID_STRING);
|
||||
iocp->guid = cpu_to_be64(srpt_service_guid);
|
||||
iocp->vendor_id = cpu_to_be32(sdev->dev_attr.vendor_id);
|
||||
@@ -530,7 +530,7 @@ static void srpt_get_svc_entries(u64 ioc_guid,
|
||||
}
|
||||
|
||||
svc_entries = (struct ib_dm_svc_entries *)mad->data;
|
||||
memset(svc_entries, 0, sizeof *svc_entries);
|
||||
memset(svc_entries, 0, sizeof(*svc_entries));
|
||||
svc_entries->service_entries[0].id = cpu_to_be64(ioc_guid);
|
||||
snprintf(svc_entries->service_entries[0].name,
|
||||
sizeof(svc_entries->service_entries[0].name),
|
||||
@@ -622,7 +622,7 @@ static void srpt_mad_recv_handler(struct ib_mad_agent *mad_agent,
|
||||
rsp->ah = ah;
|
||||
|
||||
dm_mad = rsp->mad;
|
||||
memcpy(dm_mad, mad_wc->recv_buf.mad, sizeof *dm_mad);
|
||||
memcpy(dm_mad, mad_wc->recv_buf.mad, sizeof(*dm_mad));
|
||||
dm_mad->mad_hdr.method = IB_MGMT_METHOD_GET_RESP;
|
||||
dm_mad->mad_hdr.status = 0;
|
||||
|
||||
@@ -672,7 +672,7 @@ static int srpt_refresh_port(struct srpt_port *sport)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
memset(&port_modify, 0, sizeof port_modify);
|
||||
memset(&port_modify, 0, sizeof(port_modify));
|
||||
port_modify.set_port_cap_mask = IB_PORT_DEVICE_MGMT_SUP;
|
||||
port_modify.clr_port_cap_mask = 0;
|
||||
|
||||
@@ -692,7 +692,7 @@ static int srpt_refresh_port(struct srpt_port *sport)
|
||||
goto err_query_port;
|
||||
|
||||
if (!sport->mad_agent) {
|
||||
memset(®_req, 0, sizeof reg_req);
|
||||
memset(®_req, 0, sizeof(reg_req));
|
||||
reg_req.mgmt_class = IB_MGMT_CLASS_DEVICE_MGMT;
|
||||
reg_req.mgmt_class_version = IB_MGMT_BASE_VERSION;
|
||||
set_bit(IB_MGMT_METHOD_GET, reg_req.method_mask);
|
||||
@@ -1043,14 +1043,14 @@ static int srpt_get_desc_tbl(struct srpt_send_ioctx *ioctx,
|
||||
|
||||
db = (struct srp_direct_buf *)(srp_cmd->add_data
|
||||
+ add_cdb_offset);
|
||||
memcpy(ioctx->rbufs, db, sizeof *db);
|
||||
memcpy(ioctx->rbufs, db, sizeof(*db));
|
||||
*data_len = be32_to_cpu(db->len);
|
||||
} else if (((srp_cmd->buf_fmt & 0xf) == SRP_DATA_DESC_INDIRECT) ||
|
||||
((srp_cmd->buf_fmt >> 4) == SRP_DATA_DESC_INDIRECT)) {
|
||||
idb = (struct srp_indirect_buf *)(srp_cmd->add_data
|
||||
+ add_cdb_offset);
|
||||
|
||||
ioctx->n_rbuf = be32_to_cpu(idb->table_desc.len) / sizeof *db;
|
||||
ioctx->n_rbuf = be32_to_cpu(idb->table_desc.len) / sizeof(*db);
|
||||
|
||||
if (ioctx->n_rbuf >
|
||||
(srp_cmd->data_out_desc_cnt + srp_cmd->data_in_desc_cnt)) {
|
||||
@@ -1069,7 +1069,7 @@ static int srpt_get_desc_tbl(struct srpt_send_ioctx *ioctx,
|
||||
ioctx->rbufs = &ioctx->single_rbuf;
|
||||
else {
|
||||
ioctx->rbufs =
|
||||
kmalloc(ioctx->n_rbuf * sizeof *db, GFP_ATOMIC);
|
||||
kmalloc(ioctx->n_rbuf * sizeof(*db), GFP_ATOMIC);
|
||||
if (!ioctx->rbufs) {
|
||||
ioctx->n_rbuf = 0;
|
||||
ret = -ENOMEM;
|
||||
@@ -1078,7 +1078,7 @@ static int srpt_get_desc_tbl(struct srpt_send_ioctx *ioctx,
|
||||
}
|
||||
|
||||
db = idb->desc_list;
|
||||
memcpy(ioctx->rbufs, db, ioctx->n_rbuf * sizeof *db);
|
||||
memcpy(ioctx->rbufs, db, ioctx->n_rbuf * sizeof(*db));
|
||||
*data_len = be32_to_cpu(idb->len);
|
||||
}
|
||||
out:
|
||||
@@ -1096,7 +1096,7 @@ static int srpt_init_ch_qp(struct srpt_rdma_ch *ch, struct ib_qp *qp)
|
||||
struct ib_qp_attr *attr;
|
||||
int ret;
|
||||
|
||||
attr = kzalloc(sizeof *attr, GFP_KERNEL);
|
||||
attr = kzalloc(sizeof(*attr), GFP_KERNEL);
|
||||
if (!attr)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1127,7 +1127,7 @@ static int srpt_ch_qp_rtr(struct srpt_rdma_ch *ch, struct ib_qp *qp)
|
||||
int attr_mask;
|
||||
int ret;
|
||||
|
||||
attr = kzalloc(sizeof *attr, GFP_KERNEL);
|
||||
attr = kzalloc(sizeof(*attr), GFP_KERNEL);
|
||||
if (!attr)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1160,7 +1160,7 @@ static int srpt_ch_qp_rts(struct srpt_rdma_ch *ch, struct ib_qp *qp)
|
||||
uint64_t T_tr_ns, max_compl_time_ms;
|
||||
uint32_t T_tr_ms;
|
||||
|
||||
attr = kzalloc(sizeof *attr, GFP_KERNEL);
|
||||
attr = kzalloc(sizeof(*attr), GFP_KERNEL);
|
||||
if (!attr)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1211,7 +1211,7 @@ static int srpt_ch_qp_err(struct srpt_rdma_ch *ch)
|
||||
struct ib_qp_attr *attr;
|
||||
int ret;
|
||||
|
||||
attr = kzalloc(sizeof *attr, GFP_KERNEL);
|
||||
attr = kzalloc(sizeof(*attr), GFP_KERNEL);
|
||||
if (!attr)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1563,7 +1563,7 @@ static int srpt_build_cmd_rsp(struct srpt_rdma_ch *ch,
|
||||
|
||||
srp_rsp = ioctx->ioctx.buf;
|
||||
BUG_ON(!srp_rsp);
|
||||
memset(srp_rsp, 0, sizeof *srp_rsp);
|
||||
memset(srp_rsp, 0, sizeof(*srp_rsp));
|
||||
|
||||
srp_rsp->opcode = SRP_RSP;
|
||||
srp_rsp->req_lim_delta = cpu_to_be32(ioctx->req_lim_delta);
|
||||
@@ -1615,7 +1615,7 @@ static int srpt_build_tskmgmt_rsp(struct srpt_rdma_ch *ch,
|
||||
|
||||
srp_rsp = ioctx->ioctx.buf;
|
||||
BUG_ON(!srp_rsp);
|
||||
memset(srp_rsp, 0, sizeof *srp_rsp);
|
||||
memset(srp_rsp, 0, sizeof(*srp_rsp));
|
||||
|
||||
srp_rsp->opcode = SRP_RSP;
|
||||
srp_rsp->req_lim_delta = cpu_to_be32(ioctx->req_lim_delta);
|
||||
@@ -1650,8 +1650,8 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch,
|
||||
atomic = context == SCST_CONTEXT_TASKLET ? SCST_ATOMIC
|
||||
: SCST_NON_ATOMIC;
|
||||
scmnd = scst_rx_cmd(ch->scst_sess, (u8 *) &srp_cmd->lun,
|
||||
sizeof srp_cmd->lun, srp_cmd->cdb,
|
||||
sizeof srp_cmd->cdb, atomic);
|
||||
sizeof(srp_cmd->lun), srp_cmd->cdb,
|
||||
sizeof(srp_cmd->cdb), atomic);
|
||||
if (!scmnd) {
|
||||
PRINT_ERROR("0x%llx: allocation of an SCST command failed",
|
||||
srp_cmd->tag);
|
||||
@@ -2124,7 +2124,7 @@ static int srpt_create_ch_ib(struct srpt_rdma_ch *ch)
|
||||
EXTRACHECKS_WARN_ON(ch->rq_size < 1);
|
||||
|
||||
ret = -ENOMEM;
|
||||
qp_init = kzalloc(sizeof *qp_init, GFP_KERNEL);
|
||||
qp_init = kzalloc(sizeof(*qp_init), GFP_KERNEL);
|
||||
if (!qp_init)
|
||||
goto out;
|
||||
|
||||
@@ -2414,9 +2414,9 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id,
|
||||
be64_to_cpu(*(__be64 *)&sdev->port[param->port - 1].gid.raw[8]));
|
||||
|
||||
ret = -ENOMEM;
|
||||
rsp = kzalloc(sizeof *rsp, GFP_KERNEL);
|
||||
rej = kzalloc(sizeof *rej, GFP_KERNEL);
|
||||
rep_param = kzalloc(sizeof *rep_param, GFP_KERNEL);
|
||||
rsp = kzalloc(sizeof(*rsp), GFP_KERNEL);
|
||||
rej = kzalloc(sizeof(*rej), GFP_KERNEL);
|
||||
rep_param = kzalloc(sizeof(*rep_param), GFP_KERNEL);
|
||||
if (!rsp || !rej || !rep_param)
|
||||
goto out;
|
||||
|
||||
@@ -2450,7 +2450,7 @@ static int srpt_cm_req_recv(struct ib_cm_id *cm_id,
|
||||
}
|
||||
|
||||
ret = -ENOMEM;
|
||||
ch = kzalloc(sizeof *ch, GFP_KERNEL);
|
||||
ch = kzalloc(sizeof(*ch), GFP_KERNEL);
|
||||
if (!ch) {
|
||||
rej->reason = cpu_to_be32(SRP_LOGIN_REJ_INSUFFICIENT_RESOURCES);
|
||||
PRINT_ERROR("%s",
|
||||
@@ -2611,7 +2611,7 @@ restart:
|
||||
/* create cm reply */
|
||||
rep_param->qp_num = ch->qp->qp_num;
|
||||
rep_param->private_data = (void *)rsp;
|
||||
rep_param->private_data_len = sizeof *rsp;
|
||||
rep_param->private_data_len = sizeof(*rsp);
|
||||
rep_param->rnr_retry_count = 7;
|
||||
rep_param->flow_control = 1;
|
||||
rep_param->failover_accepted = 0;
|
||||
@@ -3052,7 +3052,7 @@ static int srpt_perform_rdmas(struct srpt_rdma_ch *ch,
|
||||
ioctx->rdma_aborted = false;
|
||||
ret = 0;
|
||||
riu = ioctx->rdma_ius;
|
||||
memset(&wr, 0, sizeof wr);
|
||||
memset(&wr, 0, sizeof(wr));
|
||||
|
||||
for (i = 0; i < n_rdma; ++i, ++riu) {
|
||||
if (dir == SCST_DATA_READ) {
|
||||
@@ -3737,7 +3737,7 @@ static void srpt_add_one(struct ib_device *device)
|
||||
|
||||
TRACE_DBG("device = %p, device->dma_ops = %p", device, device->dma_ops);
|
||||
|
||||
sdev = kzalloc(sizeof *sdev, GFP_KERNEL);
|
||||
sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
|
||||
if (!sdev)
|
||||
goto err;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user