From: Sean Hefty Date: Mon, 31 Aug 2015 19:31:14 +0000 (-0700) Subject: commit X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=33efaa19b249ce42ffae1f199b39872626be8411;p=~shefty%2Flibrdmacm.git commit --- diff --git a/meta b/meta index 397fcd03..32d49e6e 100644 --- a/meta +++ b/meta @@ -1,8 +1,7 @@ Version: 1 -Previous: 9333797b6f7dd90e82e3f24a3328a63423815695 +Previous: f2afade12d945f726ecd1f5fe64e78bb6aed7c81 Head: fe4cc839e08a300b25592d16018bc904784e27ca Applied: - parens: fe4cc839e08a300b25592d16018bc904784e27ca Unapplied: raccept-invalid: 8d5251952074622e8be0c9828d5eb573b4a1c6d2 old-af-ib: aaa0d9ca917c8c361a978e5a116963c2cceac5ba diff --git a/patches/parens b/patches/parens deleted file mode 100644 index 4a34a81e..00000000 --- a/patches/parens +++ /dev/null @@ -1,276 +0,0 @@ -Bottom: cb45ab0049788b30deefcbf1754ba0a292fd83a6 -Top: e67fb3e005c80605dc4de4f7a7b0db6221336c4b -Author: Sean Hefty -Date: 2015-08-31 11:24:46 -0700 - -Add parens to sizeof operator to clarify usage - -Convert sizeof *ptr -> sizeof(*ptr) to avoid confusion. This -is in response to the (false) bug report 2568. - -Signed-off-by: Sean Hefty - - ---- - -diff --git a/src/acm.c b/src/acm.c -index fa06d31..f0da01e 100644 ---- a/src/acm.c -+++ b/src/acm.c -@@ -176,11 +176,11 @@ static int ucma_ib_set_addr(struct rdma_addrinfo *ib_rai, - struct sockaddr_ib *src, *dst; - struct ibv_path_record *path; - -- src = calloc(1, sizeof *src); -+ src = calloc(1, sizeof(*src)); - if (!src) - return ERR(ENOMEM); - -- dst = calloc(1, sizeof *dst); -+ dst = calloc(1, sizeof(*dst)); - if (!dst) { - free(src); - return ERR(ENOMEM); -@@ -217,7 +217,7 @@ static int ucma_ib_set_connect(struct rdma_addrinfo *ib_rai, - if (rai->ai_family == AF_IB) - return 0; - -- hdr = calloc(1, sizeof *hdr); -+ hdr = calloc(1, sizeof(*hdr)); - if (!hdr) - return ERR(ENOMEM); - -diff --git a/src/addrinfo.c b/src/addrinfo.c -index cdeb663..046b8be 100644 ---- a/src/addrinfo.c -+++ b/src/addrinfo.c -@@ -49,7 +49,7 @@ struct rdma_addrinfo nohints; - - static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai) - { -- memset(ai, 0, sizeof *ai); -+ memset(ai, 0, sizeof(*ai)); - if (rai->ai_flags & RAI_PASSIVE) - ai->ai_flags = AI_PASSIVE; - if (rai->ai_flags & RAI_NUMERICHOST) -diff --git a/src/cma.c b/src/cma.c -index 3e6262c..a89e663 100644 ---- a/src/cma.c -+++ b/src/cma.c -@@ -241,7 +241,7 @@ int ucma_init(void) - goto err2; - } - -- cma_dev_array = calloc(dev_cnt, sizeof *cma_dev_array); -+ cma_dev_array = calloc(dev_cnt, sizeof(*cma_dev_array)); - if (!cma_dev_array) { - ret = ERR(ENOMEM); - goto err2; -@@ -305,7 +305,7 @@ static int ucma_init_device(struct cma_device *cma_dev) - goto err; - } - -- cma_dev->port = malloc(sizeof *cma_dev->port * attr.phys_port_cnt); -+ cma_dev->port = malloc(sizeof(*cma_dev->port) * attr.phys_port_cnt); - if (!cma_dev->port) { - ret = ERR(ENOMEM); - goto err; -@@ -362,7 +362,7 @@ struct ibv_context **rdma_get_devices(int *num_devices) - if (ucma_init_all()) - goto out; - -- devs = malloc(sizeof *devs * (cma_dev_cnt + 1)); -+ devs = malloc(sizeof(*devs) * (cma_dev_cnt + 1)); - if (!devs) - goto out; - -@@ -392,7 +392,7 @@ struct rdma_event_channel *rdma_create_event_channel(void) - if (ucma_init()) - return NULL; - -- channel = malloc(sizeof *channel); -+ channel = malloc(sizeof(*channel)); - if (!channel) - return NULL; - -@@ -514,7 +514,7 @@ static struct cma_id_private *ucma_alloc_id(struct rdma_event_channel *channel, - { - struct cma_id_private *id_priv; - -- id_priv = calloc(1, sizeof *id_priv); -+ id_priv = calloc(1, sizeof(*id_priv)); - if (!id_priv) - return NULL; - -@@ -791,7 +791,7 @@ static int ucma_query_route(struct rdma_cm_id *id) - VALGRIND_MAKE_MEM_DEFINED(&resp, sizeof resp); - - if (resp.num_paths) { -- id->route.path_rec = malloc(sizeof *id->route.path_rec * -+ id->route.path_rec = malloc(sizeof(*id->route.path_rec) * - resp.num_paths); - if (!id->route.path_rec) - return ERR(ENOMEM); -@@ -1333,7 +1333,7 @@ int rdma_create_srq(struct rdma_cm_id *id, struct ibv_pd *pd, - struct ibv_srq_init_attr_ex attr_ex; - int ret; - -- memcpy(&attr_ex, attr, sizeof *attr); -+ memcpy(&attr_ex, attr, sizeof(*attr)); - attr_ex.comp_mask = IBV_SRQ_INIT_ATTR_TYPE | IBV_SRQ_INIT_ATTR_PD; - if (id->qp_type == IBV_QPT_XRC_RECV) { - attr_ex.srq_type = IBV_SRQT_XRC; -@@ -1342,7 +1342,7 @@ int rdma_create_srq(struct rdma_cm_id *id, struct ibv_pd *pd, - } - attr_ex.pd = pd; - ret = rdma_create_srq_ex(id, &attr_ex); -- memcpy(attr, &attr_ex, sizeof *attr); -+ memcpy(attr, &attr_ex, sizeof(*attr)); - return ret; - } - -@@ -1423,11 +1423,11 @@ int rdma_create_qp(struct rdma_cm_id *id, struct ibv_pd *pd, - struct ibv_qp_init_attr_ex attr_ex; - int ret; - -- memcpy(&attr_ex, qp_init_attr, sizeof *qp_init_attr); -+ memcpy(&attr_ex, qp_init_attr, sizeof(*qp_init_attr)); - attr_ex.comp_mask = IBV_QP_INIT_ATTR_PD; - attr_ex.pd = pd ? pd : id->pd; - ret = rdma_create_qp_ex(id, &attr_ex); -- memcpy(qp_init_attr, &attr_ex, sizeof *qp_init_attr); -+ memcpy(qp_init_attr, &attr_ex, sizeof(*qp_init_attr)); - return ret; - } - -@@ -1751,7 +1751,7 @@ static int rdma_join_multicast2(struct rdma_cm_id *id, struct sockaddr *addr, - int ret; - - id_priv = container_of(id, struct cma_id_private, id); -- mc = calloc(1, sizeof *mc); -+ mc = calloc(1, sizeof(*mc)); - if (!mc) - return ERR(ENOMEM); - -@@ -2096,12 +2096,12 @@ int rdma_get_cm_event(struct rdma_event_channel *channel, - if (!event) - return ERR(EINVAL); - -- evt = malloc(sizeof *evt); -+ evt = malloc(sizeof(*evt)); - if (!evt) - return ERR(ENOMEM); - - retry: -- memset(evt, 0, sizeof *evt); -+ memset(evt, 0, sizeof(*evt)); - CMA_INIT_CMD_RESP(&cmd, sizeof cmd, GET_EVENT, &resp, sizeof resp); - ret = write(channel->fd, &cmd, sizeof cmd); - if (ret != sizeof cmd) { -@@ -2354,7 +2354,7 @@ static int ucma_passive_ep(struct rdma_cm_id *id, struct rdma_addrinfo *res, - id->pd = pd; - - if (qp_init_attr) { -- id_priv->qp_init_attr = malloc(sizeof *qp_init_attr); -+ id_priv->qp_init_attr = malloc(sizeof(*qp_init_attr)); - if (!id_priv->qp_init_attr) - return ERR(ENOMEM); - -diff --git a/src/preload.c b/src/preload.c -index e7822ae..3a0bc4c 100644 ---- a/src/preload.c -+++ b/src/preload.c -@@ -260,7 +260,7 @@ static int fd_open(void) - struct fd_info *fdi; - int ret, index; - -- fdi = calloc(1, sizeof *fdi); -+ fdi = calloc(1, sizeof(*fdi)); - if (!fdi) - return ERR(ENOMEM); - -@@ -876,7 +876,7 @@ static struct pollfd *fds_alloc(nfds_t nfds) - if (rfds) - free(rfds); - -- rfds = malloc(sizeof *rfds * nfds); -+ rfds = malloc(sizeof(*rfds) * nfds); - rnfds = rfds ? nfds : 0; - } - -@@ -1132,7 +1132,7 @@ int dup2(int oldfd, int newfd) - if (!oldfdi || ret != newfd) - return ret; - -- newfdi = calloc(1, sizeof *newfdi); -+ newfdi = calloc(1, sizeof(*newfdi)); - if (!newfdi) { - close(newfd); - return ERR(ENOMEM); -diff --git a/src/rsocket.c b/src/rsocket.c -index 95d791c..c4f1b57 100644 ---- a/src/rsocket.c -+++ b/src/rsocket.c -@@ -568,7 +568,7 @@ static struct rsocket *rs_alloc(struct rsocket *inherited_rs, int type) - { - struct rsocket *rs; - -- rs = calloc(1, sizeof *rs); -+ rs = calloc(1, sizeof(*rs)); - if (!rs) - return NULL; - -@@ -1396,7 +1396,7 @@ static int ds_get_src_addr(struct rsocket *rs, - int sock, ret; - uint16_t port; - -- *src_len = sizeof *src_addr; -+ *src_len = sizeof(*src_addr); - ret = getsockname(rs->udp_sock, &src_addr->sa, src_len); - if (ret || !rs_any_addr(src_addr)) - return ret; -@@ -1410,7 +1410,7 @@ static int ds_get_src_addr(struct rsocket *rs, - if (ret) - goto out; - -- *src_len = sizeof *src_addr; -+ *src_len = sizeof(*src_addr); - ret = getsockname(sock, &src_addr->sa, src_len); - src_addr->sin.sin_port = port; - out: -@@ -2600,7 +2600,7 @@ static ssize_t ds_sendv_udp(struct rsocket *rs, const struct iovec *iov, - miov[0].iov_base = &hdr; - miov[0].iov_len = hdr.length; - if (iov && iovcnt) -- memcpy(&miov[1], iov, sizeof *iov * iovcnt); -+ memcpy(&miov[1], iov, sizeof(*iov) * iovcnt); - - memset(&msg, 0, sizeof msg); - msg.msg_name = &rs->conn_dest->addr; -@@ -2910,7 +2910,7 @@ static struct pollfd *rs_fds_alloc(nfds_t nfds) - if (rfds) - free(rfds); - -- rfds = malloc(sizeof *rfds * nfds); -+ rfds = malloc(sizeof(*rfds) * nfds); - rnfds = rfds ? nfds : 0; - } - -@@ -3110,7 +3110,7 @@ rs_select_to_poll(int *nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfd - struct pollfd *fds; - int fd, i = 0; - -- fds = calloc(*nfds, sizeof *fds); -+ fds = calloc(*nfds, sizeof(*fds)); - if (!fds) - return NULL; - -@@ -3754,7 +3754,7 @@ off_t riomap(int socket, void *buf, size_t len, int prot, int flags, off_t offse - iomr = rs_get_iomap_mr(rs); - access |= IBV_ACCESS_REMOTE_WRITE; - } else { -- iomr = calloc(1, sizeof *iomr); -+ iomr = calloc(1, sizeof(*iomr)); - iomr->index = -1; - } - if (!iomr) {