Skip to content

Commit

Permalink
acm: acm_msg::ep_data is not an array
Browse files Browse the repository at this point in the history
There is only ever one of these, and since the acm_ep_config_data ends
in a flex array sparse complains.

Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
jgunthorpe committed Nov 29, 2022
1 parent f264b6b commit adde1df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions ibacm/src/acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,26 +1242,26 @@ static int acm_svr_ep_query(struct acmc_client *client, struct acm_msg **_msg)
ep = acm_get_ep(index - 1, msg->hdr.src_index);
if (ep) {
msg->hdr.status = ACM_STATUS_SUCCESS;
msg->ep_data[0].dev_guid = ep->port->dev->device.dev_guid;
msg->ep_data[0].port_num = ep->port->port.port_num;
msg->ep_data[0].phys_port_cnt = ep->port->dev->port_cnt;
msg->ep_data[0].pkey = htobe16(ep->endpoint.pkey);
strncpy((char *)msg->ep_data[0].prov_name, ep->port->prov->name,
msg->ep_data.dev_guid = ep->port->dev->device.dev_guid;
msg->ep_data.port_num = ep->port->port.port_num;
msg->ep_data.phys_port_cnt = ep->port->dev->port_cnt;
msg->ep_data.pkey = htobe16(ep->endpoint.pkey);
strncpy((char *)msg->ep_data.prov_name, ep->port->prov->name,
ACM_MAX_PROV_NAME - 1);
msg->ep_data[0].prov_name[ACM_MAX_PROV_NAME - 1] = '\0';
msg->ep_data.prov_name[ACM_MAX_PROV_NAME - 1] = '\0';
len = ACM_MSG_HDR_LENGTH + sizeof(struct acm_ep_config_data);
for (i = 0; i < ep->nmbr_ep_addrs; i++) {
if (ep->addr_info[i].addr.type != ACM_ADDRESS_INVALID) {
sts = may_be_realloc(_msg, len, cnt, &cur_msg_siz, max_msg_siz);
msg = *_msg;
if (sts)
break;
memcpy(msg->ep_data[0].addrs[cnt++].name,
memcpy(msg->ep_data.addrs[cnt++].name,
ep->addr_info[i].string_buf,
ACM_MAX_ADDRESS);
}
}
msg->ep_data[0].addr_cnt = htobe16(cnt);
msg->ep_data.addr_cnt = htobe16(cnt);
len += cnt * ACM_MAX_ADDRESS;
} else {
msg->hdr.status = ACM_STATUS_EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion librdmacm/acm.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct acm_msg {
uint8_t data[ACM_MSG_DATA_LENGTH];
struct acm_ep_addr_data resolve_data[0];
uint64_t perf_data[0];
struct acm_ep_config_data ep_data[0];
struct acm_ep_config_data ep_data;
};
};

Expand Down

0 comments on commit adde1df

Please sign in to comment.