[Pkg-ofed-commits] [librdmacm] 01/06: Imported Upstream version 1.1.0

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Tue Mar 29 17:02:39 UTC 2016


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to branch master
in repository librdmacm.

commit b96455a7a66d4a17168ed950414c2b8219e604db
Author: Ana Beatriz Guerrero Lopez <ana at debian.org>
Date:   Tue Mar 29 16:38:08 2016 +0200

    Imported Upstream version 1.1.0
---
 configure               | 20 ++++++++++----------
 configure.ac            |  2 +-
 examples/cmatose.c      |  4 ++--
 examples/cmtime.c       |  4 ++--
 examples/mckey.c        |  2 +-
 examples/rcopy.c        |  4 ++--
 examples/rdma_client.c  |  3 ++-
 examples/rdma_server.c  |  2 +-
 examples/rdma_xclient.c |  3 ++-
 examples/rdma_xserver.c |  2 +-
 examples/riostream.c    | 20 +++++++++++++-------
 examples/rping.c        |  2 +-
 examples/rstream.c      | 24 +++++++++++++++---------
 examples/udaddy.c       |  4 ++--
 examples/udpong.c       |  4 ++--
 librdmacm.spec          |  4 ++--
 librdmacm.spec.in       |  2 +-
 src/acm.c               |  6 +++---
 src/addrinfo.c          |  2 +-
 src/cma.c               | 28 ++++++++++++++--------------
 src/preload.c           |  6 +++---
 src/rsocket.c           | 14 +++++++-------
 22 files changed, 88 insertions(+), 74 deletions(-)

diff --git a/configure b/configure
index 3154434..7280cb7 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for librdmacm 1.0.21.
+# Generated by GNU Autoconf 2.67 for librdmacm 1.1.0.
 #
 # Report bugs to <linux-rdma at vger.kernel.org>.
 #
@@ -701,8 +701,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='librdmacm'
 PACKAGE_TARNAME='librdmacm'
-PACKAGE_VERSION='1.0.21'
-PACKAGE_STRING='librdmacm 1.0.21'
+PACKAGE_VERSION='1.1.0'
+PACKAGE_STRING='librdmacm 1.1.0'
 PACKAGE_BUGREPORT='linux-rdma at vger.kernel.org'
 PACKAGE_URL=''
 
@@ -1423,7 +1423,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures librdmacm 1.0.21 to adapt to many kinds of systems.
+\`configure' configures librdmacm 1.1.0 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1493,7 +1493,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of librdmacm 1.0.21:";;
+     short | recursive ) echo "Configuration of librdmacm 1.1.0:";;
    esac
   cat <<\_ACEOF
 
@@ -1597,7 +1597,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-librdmacm configure 1.0.21
+librdmacm configure 1.1.0
 generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2190,7 +2190,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by librdmacm $as_me 1.0.21, which was
+It was created by librdmacm $as_me 1.1.0, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
@@ -3009,7 +3009,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='librdmacm'
- VERSION='1.0.21'
+ VERSION='1.1.0'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -12362,7 +12362,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by librdmacm $as_me 1.0.21, which was
+This file was extended by librdmacm $as_me 1.1.0, which was
 generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -12428,7 +12428,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-librdmacm config.status 1.0.21
+librdmacm config.status 1.1.0
 configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 768e257..4a43995 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.63])
-AC_INIT([librdmacm],[1.0.21],[linux-rdma at vger.kernel.org])
+AC_INIT([librdmacm],[1.1.0],[linux-rdma at vger.kernel.org])
 AC_CONFIG_SRCDIR([src/cma.c])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
diff --git a/examples/cmatose.c b/examples/cmatose.c
index ab3e746..d7bd92d 100644
--- a/examples/cmatose.c
+++ b/examples/cmatose.c
@@ -509,7 +509,7 @@ static int run_server(void)
 
 	ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
 	if (ret) {
-		perror("cmatose: getrdmaaddr error");
+		printf("cmatose: getrdmaaddr error: %s\n", gai_strerror(ret));
 		goto out;
 	}
 
@@ -582,7 +582,7 @@ static int run_client(void)
 
 	ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
 	if (ret) {
-		perror("cmatose: getaddrinfo error");
+		printf("cmatose: getaddrinfo error: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/cmtime.c b/examples/cmtime.c
index ebc660b..e45980b 100644
--- a/examples/cmtime.c
+++ b/examples/cmtime.c
@@ -479,7 +479,7 @@ static int run_server(void)
 
 	ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &rai);
 	if (ret) {
-		perror("getrdmaaddr error");
+		printf("getrdmaaddr error: %s\n", gai_strerror(ret));
 		goto out;
 	}
 
@@ -508,7 +508,7 @@ static int run_client(void)
 
 	ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &rai);
 	if (ret) {
-		perror("getaddrinfo error");
+		printf("getaddrinfo error: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/mckey.c b/examples/mckey.c
index a6b5c4d..2032aa9 100644
--- a/examples/mckey.c
+++ b/examples/mckey.c
@@ -452,7 +452,7 @@ static int get_addr(char *dst, struct sockaddr *addr)
 
 	ret = getaddrinfo(dst, NULL, NULL, &res);
 	if (ret) {
-		printf("getaddrinfo failed - invalid hostname or IP address\n");
+		printf("getaddrinfo failed (%s) - invalid hostname or IP address\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/rcopy.c b/examples/rcopy.c
index 152acef..085b017 100644
--- a/examples/rcopy.c
+++ b/examples/rcopy.c
@@ -186,7 +186,7 @@ static int server_listen(void)
 	hints.ai_flags = RAI_PASSIVE;
  	ret = getaddrinfo(NULL, port, &hints, &res);
 	if (ret) {
-		perror("getaddrinfo failed\n");
+		printf("getaddrinfo failed: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
@@ -396,7 +396,7 @@ static int client_connect(void)
 
  	ret = getaddrinfo(dst_addr, port, NULL, &res);
 	if (ret) {
-		perror("getaddrinfo failed\n");
+		printf("getaddrinfo failed: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/rdma_client.c b/examples/rdma_client.c
index f676b70..d7f65f5 100644
--- a/examples/rdma_client.c
+++ b/examples/rdma_client.c
@@ -30,6 +30,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <netdb.h>
 #include <errno.h>
 #include <getopt.h>
 #include <rdma/rdma_cma.h>
@@ -55,7 +56,7 @@ static int run(void)
 	hints.ai_port_space = RDMA_PS_TCP;
 	ret = rdma_getaddrinfo(server, port, &hints, &res);
 	if (ret) {
-		perror("rdma_getaddrinfo");
+		printf("rdma_getaddrinfo: %s\n", gai_strerror(ret));
 		goto out;
 	}
 
diff --git a/examples/rdma_server.c b/examples/rdma_server.c
index 129cf42..d98d11a 100644
--- a/examples/rdma_server.c
+++ b/examples/rdma_server.c
@@ -57,7 +57,7 @@ static int run(void)
 	hints.ai_port_space = RDMA_PS_TCP;
 	ret = rdma_getaddrinfo(NULL, port, &hints, &res);
 	if (ret) {
-		perror("rdma_getaddrinfo");
+		printf("rdma_getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/rdma_xclient.c b/examples/rdma_xclient.c
index 6510408..8dba266 100644
--- a/examples/rdma_xclient.c
+++ b/examples/rdma_xclient.c
@@ -30,6 +30,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <netdb.h>
 #include <errno.h>
 #include <getopt.h>
 #include <ctype.h>
@@ -80,7 +81,7 @@ static int test(void)
 
 	ret = rdma_getaddrinfo(server, port, &hints, &res);
 	if (ret) {
-		perror("rdma_getaddrinfo");
+		printf("rdma_getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/rdma_xserver.c b/examples/rdma_xserver.c
index d30c88e..69f170b 100644
--- a/examples/rdma_xserver.c
+++ b/examples/rdma_xserver.c
@@ -78,7 +78,7 @@ static int test(void)
 
 	ret = rdma_getaddrinfo(NULL, port, &hints, &res);
 	if (ret) {
-		perror("rdma_getaddrinfo");
+		printf("rdma_getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/riostream.c b/examples/riostream.c
index c12dd0d..bdc1eec 100644
--- a/examples/riostream.c
+++ b/examples/riostream.c
@@ -86,7 +86,7 @@ static int size_option;
 static int iterations = 1;
 static int transfer_size = 1000;
 static int transfer_count = 1000;
-static int buffer_size;
+static int buffer_size, inline_size = 64;
 static char test_name[10] = "custom";
 static char *port = "7471";
 static char *dst_addr;
@@ -341,8 +341,8 @@ static void set_options(int rs)
 
 	/* Inline size based on experimental data */
 	if (optimization == opt_latency) {
-		val = 384;
-		rsetsockopt(rs, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
+		rsetsockopt(rs, SOL_RDMA, RDMA_INLINE, &inline_size,
+			    sizeof inline_size);
 	} else if (optimization == opt_bandwidth) {
 		val = 0;
 		rsetsockopt(rs, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
@@ -363,7 +363,7 @@ static int server_listen(void)
 		ret = getaddrinfo(src_addr, port, &ai_hints, &ai);
 	}
 	if (ret) {
-		perror("getaddrinfo");
+		printf("getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
@@ -444,7 +444,7 @@ static int client_connect(void)
 	ret = use_rgai ? rdma_getaddrinfo(dst_addr, port, &rai_hints, &rai) :
 			 getaddrinfo(dst_addr, port, &ai_hints, &ai);
 	if (ret) {
-		perror("getaddrinfo");
+		printf("getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
@@ -470,8 +470,10 @@ static int client_connect(void)
 		fds.fd = rs;
 		fds.events = POLLOUT;
 		ret = do_poll(&fds, poll_timeout);
-		if (ret)
+		if (ret) {
+			perror("rpoll");
 			goto close;
+		}
 
 		len = sizeof err;
 		ret = rgetsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len);
@@ -594,7 +596,7 @@ int main(int argc, char **argv)
 
 	ai_hints.ai_socktype = SOCK_STREAM;
 	rai_hints.ai_port_space = RDMA_PS_TCP;
-	while ((op = getopt(argc, argv, "s:b:f:B:I:C:S:p:T:")) != -1) {
+	while ((op = getopt(argc, argv, "s:b:f:B:i:I:C:S:p:T:")) != -1) {
 		switch (op) {
 		case 's':
 			dst_addr = optarg;
@@ -616,6 +618,9 @@ int main(int argc, char **argv)
 		case 'B':
 			buffer_size = atoi(optarg);
 			break;
+		case 'i':
+			inline_size = atoi(optarg);
+			break;
 		case 'I':
 			custom = 1;
 			iterations = atoi(optarg);
@@ -646,6 +651,7 @@ int main(int argc, char **argv)
 			printf("\t[-f address_format]\n");
 			printf("\t    name, ip, ipv6, or gid\n");
 			printf("\t[-B buffer_size]\n");
+			printf("\t[-i inline_size]\n");
 			printf("\t[-I iterations]\n");
 			printf("\t[-C transfer_count]\n");
 			printf("\t[-S transfer_size or all]\n");
diff --git a/examples/rping.c b/examples/rping.c
index 9486314..a5aa8c5 100644
--- a/examples/rping.c
+++ b/examples/rping.c
@@ -1122,7 +1122,7 @@ static int get_addr(char *dst, struct sockaddr *addr)
 
 	ret = getaddrinfo(dst, NULL, NULL, &res);
 	if (ret) {
-		printf("getaddrinfo failed - invalid hostname or IP address\n");
+		printf("getaddrinfo failed (%s) - invalid hostname or IP address\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/rstream.c b/examples/rstream.c
index d93e9aa..98b9d3f 100644
--- a/examples/rstream.c
+++ b/examples/rstream.c
@@ -88,7 +88,7 @@ static int size_option;
 static int iterations = 1;
 static int transfer_size = 1000;
 static int transfer_count = 1000;
-static int buffer_size;
+static int buffer_size, inline_size = 64;
 static char test_name[10] = "custom";
 static char *port = "7471";
 static int keepalive;
@@ -301,8 +301,8 @@ static void set_options(int rs)
 	if (use_rs) {
 		/* Inline size based on experimental data */
 		if (optimization == opt_latency) {
-			val = 384;
-			rs_setsockopt(rs, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
+			rs_setsockopt(rs, SOL_RDMA, RDMA_INLINE, &inline_size,
+				      sizeof inline_size);
 		} else if (optimization == opt_bandwidth) {
 			val = 0;
 			rs_setsockopt(rs, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
@@ -327,7 +327,7 @@ static int server_listen(void)
 		ret = getaddrinfo(src_addr, port, &ai_hints, &ai);
 	}
 	if (ret) {
-		perror("getaddrinfo");
+		printf("getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
@@ -412,7 +412,7 @@ static int client_connect(void)
 			 getaddrinfo(dst_addr, port, &ai_hints, &ai);
 
 	if (ret) {
-		perror("getaddrinfo");
+		printf("getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
@@ -421,11 +421,11 @@ static int client_connect(void)
 			rai_hints.ai_flags |= RAI_PASSIVE;
 			ret = rdma_getaddrinfo(src_addr, port, &rai_hints, &rai_src);
 		} else {
-			ai_hints.ai_flags |= RAI_PASSIVE;
+			ai_hints.ai_flags |= AI_PASSIVE;
 			ret = getaddrinfo(src_addr, port, &ai_hints, &ai_src);
 		}
 		if (ret) {
-			perror("getaddrinfo src_addr");
+			printf("getaddrinfo src_addr: %s\n", gai_strerror(ret));
 			return ret;
 		}
 	}
@@ -469,8 +469,10 @@ static int client_connect(void)
 		fds.fd = rs;
 		fds.events = POLLOUT;
 		ret = do_poll(&fds, poll_timeout);
-		if (ret)
+		if (ret) {
+			perror("rpoll");
 			goto close;
+		}
 
 		len = sizeof err;
 		ret = rs_getsockopt(rs, SOL_SOCKET, SO_ERROR, &err, &len);
@@ -620,7 +622,7 @@ int main(int argc, char **argv)
 
 	ai_hints.ai_socktype = SOCK_STREAM;
 	rai_hints.ai_port_space = RDMA_PS_TCP;
-	while ((op = getopt(argc, argv, "s:b:f:B:I:C:S:p:k:T:")) != -1) {
+	while ((op = getopt(argc, argv, "s:b:f:B:i:I:C:S:p:k:T:")) != -1) {
 		switch (op) {
 		case 's':
 			dst_addr = optarg;
@@ -642,6 +644,9 @@ int main(int argc, char **argv)
 		case 'B':
 			buffer_size = atoi(optarg);
 			break;
+		case 'i':
+			inline_size = atoi(optarg);
+			break;
 		case 'I':
 			custom = 1;
 			iterations = atoi(optarg);
@@ -675,6 +680,7 @@ int main(int argc, char **argv)
 			printf("\t[-f address_format]\n");
 			printf("\t    name, ip, ipv6, or gid\n");
 			printf("\t[-B buffer_size]\n");
+			printf("\t[-i inline_size]\n");
 			printf("\t[-I iterations]\n");
 			printf("\t[-C transfer_count]\n");
 			printf("\t[-S transfer_size or all]\n");
diff --git a/examples/udaddy.c b/examples/udaddy.c
index 6e68944..5e89ca1 100644
--- a/examples/udaddy.c
+++ b/examples/udaddy.c
@@ -516,7 +516,7 @@ static int run_server(void)
 
 	ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
 	if (ret) {
-		perror("cmatose: getrdmaaddr error");
+		printf("udaddy: getrdmaaddr error: %s\n", gai_strerror(ret));
 		goto out;
 	}
 
@@ -565,7 +565,7 @@ static int run_client(void)
 
 	ret = get_rdma_addr(src_addr, dst_addr, port, &hints, &test.rai);
 	if (ret) {
-		perror("udaddy: getaddrinfo error");
+		printf("udaddy: getaddrinfo error: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/examples/udpong.c b/examples/udpong.c
index 7ec11e8..97713a2 100644
--- a/examples/udpong.c
+++ b/examples/udpong.c
@@ -266,7 +266,7 @@ static int svr_bind(void)
 	hints.ai_socktype = SOCK_DGRAM;
  	ret = getaddrinfo(src_addr, port, &hints, &res);
 	if (ret) {
-		perror("getaddrinfo");
+		printf("getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
@@ -411,7 +411,7 @@ static int client_connect(void)
 	hints.ai_socktype = SOCK_DGRAM;
  	ret = getaddrinfo(dst_addr, port, &hints, &res);
 	if (ret) {
-		perror("getaddrinfo");
+		printf("getaddrinfo: %s\n", gai_strerror(ret));
 		return ret;
 	}
 
diff --git a/librdmacm.spec b/librdmacm.spec
index 101f77f..b838909 100644
--- a/librdmacm.spec
+++ b/librdmacm.spec
@@ -1,7 +1,7 @@
-%define ver 1.0.21
+%define ver 1.1.0
 
 Name: librdmacm
-Version: 1.0.21
+Version: 1.1.0
 Release: 1%{?dist}
 Summary: Userspace RDMA Connection Manager
 
diff --git a/librdmacm.spec.in b/librdmacm.spec.in
index 53a39e6..e89aa16 100644
--- a/librdmacm.spec.in
+++ b/librdmacm.spec.in
@@ -1,7 +1,7 @@
 %define ver @VERSION@
 
 Name: librdmacm
-Version: 1.0.21
+Version: 1.1.0
 Release: 1%{?dist}
 Summary: Userspace RDMA Connection Manager
 
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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/librdmacm.git



More information about the Pkg-ofed-commits mailing list