linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-core 0/8] More warning fixing
@ 2016-10-14 22:14 Jason Gunthorpe
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

This batch is on top of the series from Christoph Hellwig, it turns on a few
more useful gcc warnings and fixes the fall out.

Whole batch is here now: https://github.com/linux-rdma/rdma-core/pull/19

Jason Gunthorpe (8):
  rdmacm: constify rdma_getaddrinfo public function
  Enable -Wwrite-strings
  verbs: Use cmake to detect if net/if.h vs netling/route/link.h is
    broken
  Enable -Wredundant-decls
  acm: Fix wrong format attributes for error
  acm: Fix format string usage with acm_log
  Enable -Wformat=2
  Enable -Wshadow

 CMakeLists.txt                      | 55 ++++++++++++++++++++++++++++++++
 buildlib/config.h.in                |  2 ++
 ibacm/include/infiniband/acm_prov.h |  7 +++--
 ibacm/prov/acmp/src/acmp.c          | 38 ++++++++++++-----------
 ibacm/src/acm.c                     | 25 ++++++++-------
 ibacm/src/acm_util.h                |  6 ++--
 ibacm/src/acme.c                    |  8 ++---
 ibacm/src/parse.c                   |  2 +-
 iwpmd/iwarp_pm.h                    |  2 +-
 iwpmd/iwarp_pm_common.c             |  7 +++--
 libibverbs/examples/srq_pingpong.c  |  1 -
 libibverbs/examples/xsrq_pingpong.c |  6 ++--
 libibverbs/neigh.c                  |  8 ++---
 libibverbs/sysfs.c                  | 13 ++++----
 libibverbs/verbs.h                  |  6 ++--
 librdmacm/acm.c                     |  3 +-
 librdmacm/addrinfo.c                | 14 +++++----
 librdmacm/cma.h                     |  3 +-
 librdmacm/examples/cmatose.c        |  2 +-
 librdmacm/examples/cmtime.c         |  4 +--
 librdmacm/examples/common.c         |  2 +-
 librdmacm/examples/common.h         |  2 +-
 librdmacm/examples/rcopy.c          |  2 +-
 librdmacm/examples/rdma_client.c    |  4 +--
 librdmacm/examples/rdma_server.c    |  2 +-
 librdmacm/examples/rdma_xclient.c   |  2 +-
 librdmacm/examples/rdma_xserver.c   |  2 +-
 librdmacm/examples/riostream.c      | 36 ++++++++++-----------
 librdmacm/examples/rping.c          |  2 +-
 librdmacm/examples/rstream.c        | 52 +++++++++++++++----------------
 librdmacm/examples/udaddy.c         |  2 +-
 librdmacm/examples/udpong.c         | 62 ++++++++++++++++++-------------------
 librdmacm/man/rdma_getaddrinfo.3    |  6 ++--
 librdmacm/preload.c                 |  2 --
 librdmacm/rdma_cma.h                |  4 +--
 providers/mlx4/mlx4.h               |  6 ----
 providers/mthca/cq.c                |  2 +-
 srp_daemon/srp_daemon.c             | 29 ++++++++++-------
 srp_daemon/srp_daemon.h             |  2 +-
 39 files changed, 247 insertions(+), 186 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 1/8] rdmacm: constify rdma_getaddrinfo public function
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-10-14 22:14   ` Jason Gunthorpe
       [not found]     ` <1476483257-16308-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2016-10-14 22:14   ` [PATCH rdma-core 2/8] Enable -Wwrite-strings Jason Gunthorpe
                     ` (7 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

Like getaddrinfo most of the arguments should be const.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 librdmacm/acm.c                  |  3 ++-
 librdmacm/addrinfo.c             | 14 ++++++++------
 librdmacm/cma.h                  |  3 ++-
 librdmacm/man/rdma_getaddrinfo.3 |  6 +++---
 librdmacm/rdma_cma.h             |  4 ++--
 5 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/librdmacm/acm.c b/librdmacm/acm.c
index ad6706b2592e..ccd5494c631d 100644
--- a/librdmacm/acm.c
+++ b/librdmacm/acm.c
@@ -363,7 +363,8 @@ static int ucma_ib_addr(struct sockaddr *addr, socklen_t len)
 	return len && addr && (addr->sa_family == AF_IB);
 }
 
-void ucma_ib_resolve(struct rdma_addrinfo **rai, struct rdma_addrinfo *hints)
+void ucma_ib_resolve(struct rdma_addrinfo **rai,
+		     const struct rdma_addrinfo *hints)
 {
 	struct acm_msg msg;
 	struct acm_ep_addr_data *data;
diff --git a/librdmacm/addrinfo.c b/librdmacm/addrinfo.c
index 2c515a257a27..ac346438a6d0 100644
--- a/librdmacm/addrinfo.c
+++ b/librdmacm/addrinfo.c
@@ -45,7 +45,8 @@
 
 static struct rdma_addrinfo nohints;
 
-static void ucma_convert_to_ai(struct addrinfo *ai, struct rdma_addrinfo *rai)
+static void ucma_convert_to_ai(struct addrinfo *ai,
+			       const struct rdma_addrinfo *rai)
 {
 	memset(ai, 0, sizeof(*ai));
 	if (rai->ai_flags & RAI_PASSIVE)
@@ -141,7 +142,8 @@ static int ucma_convert_in6(int ps, struct sockaddr_ib **dst, socklen_t *dst_len
 }
 
 static int ucma_convert_to_rai(struct rdma_addrinfo *rai,
-			       struct rdma_addrinfo *hints, struct addrinfo *ai)
+			       const struct rdma_addrinfo *hints,
+			       const struct addrinfo *ai)
 {
 	int ret;
 
@@ -210,8 +212,8 @@ static int ucma_convert_to_rai(struct rdma_addrinfo *rai,
 	return ret;
 }
 
-static int ucma_getaddrinfo(char *node, char *service,
-			    struct rdma_addrinfo *hints,
+static int ucma_getaddrinfo(const char *node, const char *service,
+			    const struct rdma_addrinfo *hints,
 			    struct rdma_addrinfo *rai)
 {
 	struct addrinfo ai_hints;
@@ -232,8 +234,8 @@ static int ucma_getaddrinfo(char *node, char *service,
 	return ret;
 }
 
-int rdma_getaddrinfo(char *node, char *service,
-		     struct rdma_addrinfo *hints,
+int rdma_getaddrinfo(const char *node, const char *service,
+		     const struct rdma_addrinfo *hints,
 		     struct rdma_addrinfo **res)
 {
 	struct rdma_addrinfo *rai;
diff --git a/librdmacm/cma.h b/librdmacm/cma.h
index 1610e178dfdb..6fe786052dff 100644
--- a/librdmacm/cma.h
+++ b/librdmacm/cma.h
@@ -140,7 +140,8 @@ extern int af_ib_support;
 
 void ucma_ib_init(void);
 void ucma_ib_cleanup(void);
-void ucma_ib_resolve(struct rdma_addrinfo **rai, struct rdma_addrinfo *hints);
+void ucma_ib_resolve(struct rdma_addrinfo **rai,
+		     const struct rdma_addrinfo *hints);
 
 struct ib_connect_hdr {
 	uint8_t  cma_version;
diff --git a/librdmacm/man/rdma_getaddrinfo.3 b/librdmacm/man/rdma_getaddrinfo.3
index cd819c6cdf42..9e133ffea0a5 100644
--- a/librdmacm/man/rdma_getaddrinfo.3
+++ b/librdmacm/man/rdma_getaddrinfo.3
@@ -5,9 +5,9 @@ rdma_getaddrinfo \- Provides transport independent address translation.
 .B "#include <rdma/rdma_cma.h>"
 .P
 .B "int" rdma_getaddrinfo
-.BI "(char *" node ","
-.BI "char *" service ","
-.BI "struct rdma_addrinfo *" hints ","
+.BI "(const char *" node ","
+.BI "const char *" service ","
+.BI "const struct rdma_addrinfo *" hints ","
 .BI "struct rdma_addrinfo **" res ");"
 .SH ARGUMENTS
 .IP "node" 12
diff --git a/librdmacm/rdma_cma.h b/librdmacm/rdma_cma.h
index 2055665a1496..45c492ab6217 100644
--- a/librdmacm/rdma_cma.h
+++ b/librdmacm/rdma_cma.h
@@ -668,8 +668,8 @@ int rdma_migrate_id(struct rdma_cm_id *id, struct rdma_event_channel *channel);
 /**
  * rdma_getaddrinfo - RDMA address and route resolution service.
  */
-int rdma_getaddrinfo(char *node, char *service,
-		     struct rdma_addrinfo *hints,
+int rdma_getaddrinfo(const char *node, const char *service,
+		     const struct rdma_addrinfo *hints,
 		     struct rdma_addrinfo **res);
 
 void rdma_freeaddrinfo(struct rdma_addrinfo *res);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 2/8] Enable -Wwrite-strings
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2016-10-14 22:14   ` [PATCH rdma-core 1/8] rdmacm: constify rdma_getaddrinfo public function Jason Gunthorpe
@ 2016-10-14 22:14   ` Jason Gunthorpe
  2016-10-14 22:14   ` [PATCH rdma-core 3/8] verbs: Use cmake to detect if net/if.h vs netling/route/link.h is broken Jason Gunthorpe
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

The is useful to detect possible writing to read only memory.

The compiler places strings in .rodata so they are unwritable and
are technically const.

Add consts as necessary, no casts were added so this should be safe.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt                      |  1 +
 ibacm/include/infiniband/acm_prov.h |  4 ++--
 ibacm/prov/acmp/src/acmp.c          |  2 +-
 ibacm/src/acm.c                     |  8 ++++----
 ibacm/src/acm_util.h                |  2 +-
 ibacm/src/acme.c                    |  8 ++++----
 ibacm/src/parse.c                   |  2 +-
 iwpmd/iwarp_pm.h                    |  2 +-
 iwpmd/iwarp_pm_common.c             |  7 ++++---
 libibverbs/sysfs.c                  | 13 +++++++------
 librdmacm/examples/cmatose.c        |  2 +-
 librdmacm/examples/cmtime.c         |  4 ++--
 librdmacm/examples/common.c         |  2 +-
 librdmacm/examples/common.h         |  2 +-
 librdmacm/examples/rcopy.c          |  2 +-
 librdmacm/examples/rdma_client.c    |  4 ++--
 librdmacm/examples/rdma_server.c    |  2 +-
 librdmacm/examples/rdma_xclient.c   |  2 +-
 librdmacm/examples/rdma_xserver.c   |  2 +-
 librdmacm/examples/riostream.c      |  2 +-
 librdmacm/examples/rping.c          |  2 +-
 librdmacm/examples/rstream.c        |  2 +-
 librdmacm/examples/udaddy.c         |  2 +-
 librdmacm/examples/udpong.c         |  2 +-
 srp_daemon/srp_daemon.c             | 29 +++++++++++++++++------------
 srp_daemon/srp_daemon.h             |  2 +-
 26 files changed, 60 insertions(+), 52 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21a93892c858..bede766adf4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -112,6 +112,7 @@ RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WARNINGS
   "-Wall -Wextra -Wno-sign-compare -Wno-unused-parameter")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_PROTOTYPES "-Wmissing-prototypes")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarations")
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
 
 # At some point around 5.4 gcc fixed missing-field-initializers to ignore this
 # common idiom we use extensively. Since this is a useful warning for
diff --git a/ibacm/include/infiniband/acm_prov.h b/ibacm/include/infiniband/acm_prov.h
index 890e6baeb5e8..00baf582b74e 100644
--- a/ibacm/include/infiniband/acm_prov.h
+++ b/ibacm/include/infiniband/acm_prov.h
@@ -61,7 +61,7 @@ struct acm_address {
 struct acm_provider {
 	size_t    size; 
 	uint32_t  version;
-	char      *name;
+	const char *name;
 	int	(*open_device)(const struct acm_device *device, 
 			void **dev_context);
 	void	(*close_device)(void *dev_context);
@@ -113,7 +113,7 @@ acm_alloc_sa_mad(const struct acm_endpoint *endpoint, void *context,
 extern void acm_free_sa_mad(struct acm_sa_mad *mad);
 extern int acm_send_sa_mad(struct acm_sa_mad *mad);
 
-extern char * acm_get_opts_file(void);
+extern const char *acm_get_opts_file(void);
 extern void acm_increment_counter(int type);
 
 #endif /* ACM_PROV_H */
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index d70501aff8e8..9ec7db44b0d1 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -2868,7 +2868,7 @@ static void acmp_set_options(void)
 	FILE *f;
 	char s[120];
 	char opt[32], value[256];
-	char *opts_file = acm_get_opts_file();
+	const char *opts_file = acm_get_opts_file();
 
 	if (!(f = fopen(opts_file, "r")))
 		return;
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index 9186677fcc6f..e512939dd765 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -221,9 +221,9 @@ static struct sa_data {
 /*
  * Service options - may be set through ibacm_opts.cfg file.
  */
-static char *acme = IBACM_BIN_PATH "/ib_acme -A";
-static char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
-static char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
+static const char *acme = IBACM_BIN_PATH "/ib_acme -A";
+static const char *opts_file = ACM_CONF_DIR "/" ACM_OPTS_FILE;
+static const char *addr_file = ACM_CONF_DIR "/" ACM_ADDR_FILE;
 static char log_file[128] = IBACM_LOG_FILE;
 static int log_level = 0;
 static char lock_file[128] = IBACM_PID_FILE;
@@ -292,7 +292,7 @@ int ib_any_gid(union ibv_gid *gid)
 	return ((gid->global.subnet_prefix | gid->global.interface_id) == 0);
 }
 
-char * acm_get_opts_file(void)
+const char *acm_get_opts_file(void)
 {
 	return opts_file;
 }
diff --git a/ibacm/src/acm_util.h b/ibacm/src/acm_util.h
index 5243f8a7e750..055122cbeb86 100644
--- a/ibacm/src/acm_util.h
+++ b/ibacm/src/acm_util.h
@@ -53,6 +53,6 @@ typedef void (*acm_if_iter_cb)(char *ifname, union ibv_gid *gid, uint16_t pkey,
 				char *ip_str, void *ctx);
 int acm_if_iter_sys(acm_if_iter_cb cb, void *ctx);
 
-char **parse(char *args, int *count);
+char **parse(const char *args, int *count);
 
 #endif /* ACM_IF_H */
diff --git a/ibacm/src/acme.c b/ibacm/src/acme.c
index 6b5b2ecb7f8a..a924dad21089 100644
--- a/ibacm/src/acme.c
+++ b/ibacm/src/acme.c
@@ -44,13 +44,13 @@
 #include "libacm.h"
 #include "acm_util.h"
 
-static char *dest_dir = ACM_CONF_DIR;
-static char *addr_file = ACM_ADDR_FILE;
-static char *opts_file = ACM_OPTS_FILE;
+static const char *dest_dir = ACM_CONF_DIR;
+static const char *addr_file = ACM_ADDR_FILE;
+static const char *opts_file = ACM_OPTS_FILE;
 
 static char *dest_addr;
 static char *src_addr;
-static char *svc_arg = "localhost";
+static const char *svc_arg = "localhost";
 static char *dest_arg;
 static char *src_arg;
 static char addr_type = 'u';
diff --git a/ibacm/src/parse.c b/ibacm/src/parse.c
index 52e66ab814e3..15aab17f8b0a 100644
--- a/ibacm/src/parse.c
+++ b/ibacm/src/parse.c
@@ -70,7 +70,7 @@ static char *expand(char *basename, char *args, int *str_cnt, int *str_size)
 	return str_buf;
 }
 
-char **parse(char *args, int *count)
+char **parse(const char *args, int *count)
 {
 	char **ptrs = NULL;
 	char *str_buf, *cpy, *token, *next;
diff --git a/iwpmd/iwarp_pm.h b/iwpmd/iwarp_pm.h
index 766e34fe03c7..b5a5a457a423 100644
--- a/iwpmd/iwarp_pm.h
+++ b/iwpmd/iwarp_pm.h
@@ -225,7 +225,7 @@ int send_iwpm_nlmsg(int, struct nl_msg *, int);
 
 struct nl_msg *create_iwpm_nlmsg(__u16, int);
 
-void print_iwpm_sockaddr(struct sockaddr_storage *, char *, __u32);
+void print_iwpm_sockaddr(struct sockaddr_storage *, const char *, __u32);
 
 __be16 get_sockaddr_port(struct sockaddr_storage *sockaddr);
 
diff --git a/iwpmd/iwarp_pm_common.c b/iwpmd/iwarp_pm_common.c
index ee9d11953018..58b1089a1998 100644
--- a/iwpmd/iwarp_pm_common.c
+++ b/iwpmd/iwarp_pm_common.c
@@ -39,7 +39,7 @@
 #endif
 
 /* iwpm config params */
-static char * iwpm_param_names[IWPM_PARAM_NUM] =
+static const char * iwpm_param_names[IWPM_PARAM_NUM] =
 	{ "nl_sock_rbuf_size" };
 static int iwpm_param_vals[IWPM_PARAM_NUM] =
 	{ 0 };
@@ -609,8 +609,9 @@ int is_wcard_ipaddr(struct sockaddr_storage *search_addr)
  * print_iwpm_sockaddr - Print socket address (IP address and Port)
  * @sockaddr: socket address to print
  * @msg: message to print
- */ 
-void print_iwpm_sockaddr(struct sockaddr_storage *sockaddr, char *msg, __u32 dbg_flag)
+ */
+void print_iwpm_sockaddr(struct sockaddr_storage *sockaddr, const char *msg,
+			 __u32 dbg_flag)
 {
 	struct sockaddr_in6 *sockaddr_v6;
 	struct sockaddr_in *sockaddr_v4;
diff --git a/libibverbs/sysfs.c b/libibverbs/sysfs.c
index d463241ade08..f45fa1a3614d 100644
--- a/libibverbs/sysfs.c
+++ b/libibverbs/sysfs.c
@@ -42,11 +42,11 @@
 
 #include "ibverbs.h"
 
-static char *sysfs_path;
+static const char *sysfs_path;
 
 const char *ibv_get_sysfs_path(void)
 {
-	char *env = NULL;
+	const char *env = NULL;
 
 	if (sysfs_path)
 		return sysfs_path;
@@ -60,12 +60,13 @@ const char *ibv_get_sysfs_path(void)
 
 	if (env) {
 		int len;
+		char *dup;
 
-		sysfs_path = strndup(env, IBV_SYSFS_PATH_MAX);
-		len = strlen(sysfs_path);
-		while (len > 0 && sysfs_path[len - 1] == '/') {
+		sysfs_path = dup = strndup(env, IBV_SYSFS_PATH_MAX);
+		len = strlen(dup);
+		while (len > 0 && dup[len - 1] == '/') {
 			--len;
-			sysfs_path[len] = '\0';
+			dup[len] = '\0';
 		}
 	} else
 		sysfs_path = "/sys";
diff --git a/librdmacm/examples/cmatose.c b/librdmacm/examples/cmatose.c
index d7bd92d72468..d9b6ca622393 100644
--- a/librdmacm/examples/cmatose.c
+++ b/librdmacm/examples/cmatose.c
@@ -75,7 +75,7 @@ static struct cmatest test;
 static int connections = 1;
 static int message_size = 100;
 static int message_count = 10;
-static char *port = "7471";
+static const char *port = "7471";
 static uint8_t set_tos = 0;
 static uint8_t tos;
 static uint8_t migrate = 0;
diff --git a/librdmacm/examples/cmtime.c b/librdmacm/examples/cmtime.c
index f0b4d0276288..b2a39cedd303 100644
--- a/librdmacm/examples/cmtime.c
+++ b/librdmacm/examples/cmtime.c
@@ -48,7 +48,7 @@
 
 static struct rdma_addrinfo hints, *rai;
 static struct rdma_event_channel *channel;
-static char *port = "7471";
+static const char *port = "7471";
 static char *dst_addr;
 static char *src_addr;
 static int timeout = 2000;
@@ -66,7 +66,7 @@ enum step {
 	STEP_CNT
 };
 
-static char *step_str[] = {
+static const char *step_str[] = {
 	"create id",
 	"bind addr",
 	"resolve addr",
diff --git a/librdmacm/examples/common.c b/librdmacm/examples/common.c
index 09468ce6a03c..8037dd830fa8 100644
--- a/librdmacm/examples/common.c
+++ b/librdmacm/examples/common.c
@@ -47,7 +47,7 @@
 
 int use_rs = 1;
 
-int get_rdma_addr(char *src, char *dst, char *port,
+int get_rdma_addr(const char *src, const char *dst, const char *port,
 		  struct rdma_addrinfo *hints, struct rdma_addrinfo **rai)
 {
 	struct rdma_addrinfo rai_hints, *res;
diff --git a/librdmacm/examples/common.h b/librdmacm/examples/common.h
index ac2d160b0044..28b977a075e6 100644
--- a/librdmacm/examples/common.h
+++ b/librdmacm/examples/common.h
@@ -78,7 +78,7 @@ enum rs_optimization {
 	opt_bandwidth
 };
 
-int get_rdma_addr(char *src, char *dst, char *port,
+int get_rdma_addr(const char *src, const char *dst, const char *port,
 		  struct rdma_addrinfo *hints, struct rdma_addrinfo **rai);
 
 void size_str(char *str, size_t ssize, long long size);
diff --git a/librdmacm/examples/rcopy.c b/librdmacm/examples/rcopy.c
index 38f69291b1f5..9ff7ade29261 100644
--- a/librdmacm/examples/rcopy.c
+++ b/librdmacm/examples/rcopy.c
@@ -52,7 +52,7 @@ union rsocket_address {
 	struct sockaddr_storage storage;
 };
 
-static char *port = "7427";
+static const char *port = "7427";
 static char *dst_addr;
 static char *dst_file;
 static char *src_file;
diff --git a/librdmacm/examples/rdma_client.c b/librdmacm/examples/rdma_client.c
index fd7bbc20aa6a..c27047c5124f 100644
--- a/librdmacm/examples/rdma_client.c
+++ b/librdmacm/examples/rdma_client.c
@@ -36,8 +36,8 @@
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_verbs.h>
 
-static char *server = "127.0.0.1";
-static char *port = "7471";
+static const char *server = "127.0.0.1";
+static const char *port = "7471";
 
 static struct rdma_cm_id *id;
 static struct ibv_mr *mr, *send_mr;
diff --git a/librdmacm/examples/rdma_server.c b/librdmacm/examples/rdma_server.c
index 3c7c15e0d318..bcf649febf5f 100644
--- a/librdmacm/examples/rdma_server.c
+++ b/librdmacm/examples/rdma_server.c
@@ -36,7 +36,7 @@
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_verbs.h>
 
-static char *port = "7471";
+static const char *port = "7471";
 
 static struct rdma_cm_id *listen_id, *id;
 static struct ibv_mr *mr, *send_mr;
diff --git a/librdmacm/examples/rdma_xclient.c b/librdmacm/examples/rdma_xclient.c
index d86fee1b01ee..3518db95442b 100644
--- a/librdmacm/examples/rdma_xclient.c
+++ b/librdmacm/examples/rdma_xclient.c
@@ -37,7 +37,7 @@
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_verbs.h>
 
-static char *server = "127.0.0.1";
+static const char *server = "127.0.0.1";
 static char port[6] = "7471";
 
 static struct rdma_cm_id *id;
diff --git a/librdmacm/examples/rdma_xserver.c b/librdmacm/examples/rdma_xserver.c
index f838e7d5de8b..2fbb4bf5b339 100644
--- a/librdmacm/examples/rdma_xserver.c
+++ b/librdmacm/examples/rdma_xserver.c
@@ -38,7 +38,7 @@
 #include <rdma/rdma_cma.h>
 #include <rdma/rdma_verbs.h>
 
-static char *port = "7471";
+static const char *port = "7471";
 
 static struct rdma_cm_id *listen_id, *id;
 static struct ibv_mr *mr;
diff --git a/librdmacm/examples/riostream.c b/librdmacm/examples/riostream.c
index bdc1eec04ae8..bd8c60cdcb1d 100644
--- a/librdmacm/examples/riostream.c
+++ b/librdmacm/examples/riostream.c
@@ -88,7 +88,7 @@ static int transfer_size = 1000;
 static int transfer_count = 1000;
 static int buffer_size, inline_size = 64;
 static char test_name[10] = "custom";
-static char *port = "7471";
+static const char *port = "7471";
 static char *dst_addr;
 static char *src_addr;
 static struct timeval start, end;
diff --git a/librdmacm/examples/rping.c b/librdmacm/examples/rping.c
index c248e66aaa83..ad38f6da7096 100644
--- a/librdmacm/examples/rping.c
+++ b/librdmacm/examples/rping.c
@@ -1138,7 +1138,7 @@ static int get_addr(char *dst, struct sockaddr *addr)
 	return ret;
 }
 
-static void usage(char *name)
+static void usage(const char *name)
 {
 	printf("%s -s [-vVd] [-S size] [-C count] [-a addr] [-p port]\n", 
 	       basename(name));
diff --git a/librdmacm/examples/rstream.c b/librdmacm/examples/rstream.c
index 98b9d3f91ecb..59a0d4351ef5 100644
--- a/librdmacm/examples/rstream.c
+++ b/librdmacm/examples/rstream.c
@@ -90,7 +90,7 @@ static int transfer_size = 1000;
 static int transfer_count = 1000;
 static int buffer_size, inline_size = 64;
 static char test_name[10] = "custom";
-static char *port = "7471";
+static const char *port = "7471";
 static int keepalive;
 static char *dst_addr;
 static char *src_addr;
diff --git a/librdmacm/examples/udaddy.c b/librdmacm/examples/udaddy.c
index 5e89ca1e1d75..af0d6f713ed1 100644
--- a/librdmacm/examples/udaddy.c
+++ b/librdmacm/examples/udaddy.c
@@ -72,7 +72,7 @@ static struct cmatest test;
 static int connections = 1;
 static int message_size = 100;
 static int message_count = 10;
-static char *port = "7174";
+static const char *port = "7174";
 static uint8_t set_tos = 0;
 static uint8_t tos;
 static char *dst_addr;
diff --git a/librdmacm/examples/udpong.c b/librdmacm/examples/udpong.c
index 0f44f50e6e88..f8d56073012a 100644
--- a/librdmacm/examples/udpong.c
+++ b/librdmacm/examples/udpong.c
@@ -93,7 +93,7 @@ static int transfer_size = 1000;
 static int transfer_count = 1000;
 static int buffer_size;
 static char test_name[10] = "custom";
-static char *port = "7174";
+static const char *port = "7174";
 static char *dst_addr;
 static char *src_addr;
 static union socket_addr addr;
diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c
index 6cb22e4c3f21..e0e550d81ab3 100644
--- a/srp_daemon/srp_daemon.c
+++ b/srp_daemon/srp_daemon.c
@@ -82,7 +82,7 @@ enum log_dest { log_to_syslog, log_to_stderr };
 static int get_lid(struct umad_resources *umad_res, ib_gid_t *gid, uint16_t *lid);
 
 static const int   node_table_response_size = 1 << 18;
-static char *sysfs_path = "/sys";
+static const char *sysfs_path = "/sys";
 static enum log_dest s_log_dest = log_to_syslog;
 static int wakeup_pipe[2] = { -1, -1 };
 
@@ -152,7 +152,7 @@ static int check_process_uniqueness(struct config_t *conf)
 }
 
 static int srpd_sys_read_string(const char *dir_name, const char *file_name,
-			 char *str, int max_len)
+				char *str, int max_len)
 {
 	char path[256], *s;
 	int fd, r;
@@ -177,7 +177,8 @@ static int srpd_sys_read_string(const char *dir_name, const char *file_name,
 	return 0;
 }
 
-static int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
+static int srpd_sys_read_gid(const char *dir_name, const char *file_name,
+			     uint8_t *gid)
 {
 	char buf[64], *str, *s;
 	uint16_t *ugid = (uint16_t *)gid;
@@ -195,7 +196,8 @@ static int srpd_sys_read_gid(char *dir_name, char *file_name, uint8_t *gid)
 	return 0;
 }
 
-static int srpd_sys_read_uint64(char *dir_name, char *file_name, uint64_t *u)
+static int srpd_sys_read_uint64(const char *dir_name, const char *file_name,
+				uint64_t *u)
 {
 	char buf[32];
 	int r;
@@ -234,7 +236,7 @@ static void usage(const char *argv0)
 }
 
 static int
-check_equal_uint64(char *dir_name, char *attr, uint64_t val)
+check_equal_uint64(char *dir_name, const char *attr, uint64_t val)
 {
 	uint64_t attr_value;
 
@@ -245,7 +247,7 @@ check_equal_uint64(char *dir_name, char *attr, uint64_t val)
 }
 
 static int
-check_equal_uint16(char *dir_name, char *attr, uint16_t val)
+check_equal_uint16(char *dir_name, const char *attr, uint16_t val)
 {
 	uint64_t attr_value;
 
@@ -309,7 +311,8 @@ void pr_err(const char *fmt, ...)
 	}
 }
 
-static int check_not_equal_str(char *dir_name, char *attr, char *value)
+static int check_not_equal_str(const char *dir_name, const char *attr,
+			       const char *value)
 {
 	const int MAX_ATTR_STRING_LENGTH=64;
 
@@ -329,7 +332,8 @@ static int check_not_equal_str(char *dir_name, char *attr, char *value)
 	return 0;
 }
 
-static int check_not_equal_int(char *dir_name, char *attr, int value)
+static int check_not_equal_int(const char *dir_name, const char *attr,
+			       int value)
 {
 	const int MAX_ATTR_STRING_LENGTH=64;
 
@@ -654,12 +658,13 @@ static void initialize_sysfs(void)
 	env = getenv("SYSFS_PATH");
 	if (env) {
 		int len;
+		char *dup;
 
-		sysfs_path = strndup(env, 256);
-		len = strlen(sysfs_path);
-		while (len > 0 && sysfs_path[len - 1] == '/') {
+		sysfs_path = dup = strndup(env, 256);
+		len = strlen(dup);
+		while (len > 0 && dup[len - 1] == '/') {
 			--len;
-			sysfs_path[len] = '\0';
+			dup[len] = '\0';
 		}
 	}
 }
diff --git a/srp_daemon/srp_daemon.h b/srp_daemon/srp_daemon.h
index 5d42d51e6d1c..d9d92f10f84c 100644
--- a/srp_daemon/srp_daemon.h
+++ b/srp_daemon/srp_daemon.h
@@ -324,7 +324,7 @@ struct config_t {
 	int		timeout;
 	int		recalc_time;
 	int		print_initiator_ext;
-	char	       *rules_file;
+	const char     *rules_file;
 	struct rule    *rules;
 	int 		retry_timeout;
 	int		tl_retry_count;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 3/8] verbs: Use cmake to detect if net/if.h vs netling/route/link.h is broken
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2016-10-14 22:14   ` [PATCH rdma-core 1/8] rdmacm: constify rdma_getaddrinfo public function Jason Gunthorpe
  2016-10-14 22:14   ` [PATCH rdma-core 2/8] Enable -Wwrite-strings Jason Gunthorpe
@ 2016-10-14 22:14   ` Jason Gunthorpe
       [not found]     ` <1476483257-16308-4-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2016-10-14 22:14   ` [PATCH rdma-core 4/8] Enable -Wredundant-decls Jason Gunthorpe
                     ` (5 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

If not then just use the header directly, otherwise use the work around.

The issue is that old libnl libraries include linux/if.h and the
declarations there conflict with net/if.h. New libraries do not
do this.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt       | 16 ++++++++++++++++
 buildlib/config.h.in |  2 ++
 libibverbs/neigh.c   |  5 +++--
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bede766adf4d..58de78d6cde0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,6 +210,18 @@ else()
   set(NL_LIBRARIES "")
 endif()
 
+# Older stuff blows up if these headers are included together
+if (NOT NL_KIND EQUAL 0)
+  set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+  set(CMAKE_REQUIRED_INCLUDES "${NL_INCLUDE_DIRS}")
+  CHECK_C_SOURCE_COMPILES("
+#include <netlink/route/link.h>
+#include <net/if.h>
+ int main(int argc,const char *argv[]) {return 0;}"
+    HAVE_WORKING_IF_H)
+  set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
+endif()
+
 # Statically determine sizeof(long), this is largely unnecessary, no new code
 # should rely on this.
 check_type_size("long" SIZEOF_LONG BUILTIN_TYPES_ONLY LANGUAGE C)
@@ -325,6 +337,10 @@ if (NL_KIND EQUAL 1)
 endif()
 if (NL_KIND EQUAL 0)
   message(STATUS " neighbour resolution NOT enabled")
+else()
+  if (NOT HAVE_WORKING_IF_H)
+    message(STATUS " netlink/route/link.h and net/if.h NOT co-includable (old headers)")
+  endif()
 endif()
 if (NOT HAVE_RDMA_USER_RXE)
   message(STATUS " rdma/rdma_user_rxe.h NOT found (old system kernel headers)")
diff --git a/buildlib/config.h.in b/buildlib/config.h.in
index 99103b779baf..23781807bce8 100644
--- a/buildlib/config.h.in
+++ b/buildlib/config.h.in
@@ -31,6 +31,8 @@
 // FIXME This has been supported in compilers forever, we should just fail to build on such old systems.
 #cmakedefine HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE 1
 
+#cmakedefine HAVE_WORKING_IF_H 1
+
 @SIZEOF_LONG_CODE@
 
 #if @NL_KIND@ == 3
diff --git a/libibverbs/neigh.c b/libibverbs/neigh.c
index 5acfcf06fcde..67a83eb0fd27 100644
--- a/libibverbs/neigh.c
+++ b/libibverbs/neigh.c
@@ -20,10 +20,11 @@
 #include <ifaddrs.h>
 #include <netdb.h>
 #include <assert.h>
-#ifndef _LINUX_IF_H
+#if HAVE_WORKING_IF_H
 #include <net/if.h>
 #else
-/*Workaround when there's a collision between the includes */
+/* We need this decl from net/if.h but old systems do not let use co-include
+   net/if.h and netlink/route/link.h */
 extern unsigned int if_nametoindex(__const char *__ifname) __THROW;
 #endif
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 4/8] Enable -Wredundant-decls
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-10-14 22:14   ` [PATCH rdma-core 3/8] verbs: Use cmake to detect if net/if.h vs netling/route/link.h is broken Jason Gunthorpe
@ 2016-10-14 22:14   ` Jason Gunthorpe
  2016-10-14 22:14   ` [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error Jason Gunthorpe
                     ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

This is useful to detect possible confusion/mistakes around function
prototypes.

Old libnl includes such a mistake so this warning is only turned on with
new distros.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt        | 20 ++++++++++++++++++++
 ibacm/src/acm_util.h  |  4 ++--
 libibverbs/neigh.c    |  3 ---
 librdmacm/preload.c   |  2 --
 providers/mlx4/mlx4.h |  6 ------
 5 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58de78d6cde0..bd58a7039618 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -269,6 +269,23 @@ endif()
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WSTRICT_PROTOTYPES "-Wstrict-prototypes")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WOLD_STYLE_DEFINITION "-Wold-style-definition")
 
+# Old versions of libnl have a duplicated rtnl_route_put, disbale the warning on those
+# systems
+if (NOT NL_KIND EQUAL 0)
+  set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+  set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+  set(CMAKE_REQUIRED_INCLUDES "${NL_INCLUDE_DIRS}")
+  set(CMAKE_REQUIRED_FLAGS "-Wredundant-decls")
+  CHECK_C_SOURCE_COMPILES("
+ #include <netlink/route/route.h>
+ int main(int argc,const char *argv[]) { return 0; }"
+  HAVE_C_WREDUNDANT_DECLS
+  FAIL_REGEX "warning")
+  set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
+  set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
+endif()
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WREDUNDANT_DECLS "-Wredundant-decls")
+
 #-------------------------
 # Build Prep
 # Write out a git ignore file to the build directory if it isn't the source
@@ -354,3 +371,6 @@ endif()
 if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
   message(STATUS " -Wmissing-field-initializers does NOT work")
 endif()
+if (NOT HAVE_C_WREDUNDANT_DECLS)
+  message(STATUS " -Wredundant-decls does NOT work")
+endif()
diff --git a/ibacm/src/acm_util.h b/ibacm/src/acm_util.h
index 055122cbeb86..a83d915f13e8 100644
--- a/ibacm/src/acm_util.h
+++ b/ibacm/src/acm_util.h
@@ -31,17 +31,17 @@
 #define ACM_IF_H
 
 #include <infiniband/verbs.h>
+#include <infiniband/acm_prov.h>
 
 #ifdef ACME_PRINTS
 
+#undef acm_log
 #define acm_log(level, format, ...) \
 	printf(format, ## __VA_ARGS__)
 
 #else /* !ACME_PRINTS */
 #define acm_log(level, format, ...) \
 	acm_write(level, "%s: "format, __func__, ## __VA_ARGS__)
-
-void acm_write(int level, const char *format, ...);
 #endif /* ACME_PRINTS */
 
 int acm_if_is_ib(char *ifname);
diff --git a/libibverbs/neigh.c b/libibverbs/neigh.c
index 67a83eb0fd27..1856aab74842 100644
--- a/libibverbs/neigh.c
+++ b/libibverbs/neigh.c
@@ -36,9 +36,6 @@ extern unsigned int if_nametoindex(__const char *__ifname) __THROW;
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
 
-/* Workaround - declaration missing */
-extern int		rtnl_link_vlan_get_id(struct rtnl_link *);
-
 #ifndef HAVE_LIBNL1
 #include <netlink/route/link/vlan.h>
 #endif
diff --git a/librdmacm/preload.c b/librdmacm/preload.c
index cf258bf8eb3a..c924f499b7c7 100644
--- a/librdmacm/preload.c
+++ b/librdmacm/preload.c
@@ -132,8 +132,6 @@ struct config_entry {
 
 static struct config_entry *config;
 static int config_cnt;
-extern char *program_invocation_short_name;
-
 
 static void free_config(void)
 {
diff --git a/providers/mlx4/mlx4.h b/providers/mlx4/mlx4.h
index a2d39e169c15..b851e953c36b 100644
--- a/providers/mlx4/mlx4.h
+++ b/providers/mlx4/mlx4.h
@@ -85,12 +85,6 @@ struct mlx4_xsrq_table {
 	int			  mask;
 };
 
-void mlx4_init_xsrq_table(struct mlx4_xsrq_table *xsrq_table, int size);
-struct mlx4_srq *mlx4_find_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn);
-int mlx4_store_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn,
-		    struct mlx4_srq *srq);
-void mlx4_clear_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn);
-
 enum {
 	MLX4_XRC_QPN_BIT     = (1 << 23)
 };
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-10-14 22:14   ` [PATCH rdma-core 4/8] Enable -Wredundant-decls Jason Gunthorpe
@ 2016-10-14 22:14   ` Jason Gunthorpe
       [not found]     ` <1476483257-16308-6-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2016-10-14 22:14   ` [PATCH rdma-core 6/8] acm: Fix format string usage with acm_log Jason Gunthorpe
                     ` (3 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

The arguments were swapped, and totally crash-when-run wrong.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 ibacm/src/acm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index e512939dd765..523b78082ff8 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -2483,7 +2483,7 @@ static void acm_open_dev(struct ibv_device *ibdev)
 
 	ret = ibv_query_device(verbs, &attr);
 	if (ret) {
-		acm_log(0, "ERROR - ibv_query_device (%s) %d\n", ret, ibdev->name);
+		acm_log(0, "ERROR - ibv_query_device (%d) %s\n", ret, ibdev->name);
 		goto err1;
 	}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 6/8] acm: Fix format string usage with acm_log
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
                     ` (4 preceding siblings ...)
  2016-10-14 22:14   ` [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error Jason Gunthorpe
@ 2016-10-14 22:14   ` Jason Gunthorpe
  2016-10-14 22:14   ` [PATCH rdma-core 7/8] Enable -Wformat=2 Jason Gunthorpe
                     ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

Enable format string checking for acm_write and clean up everything.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 ibacm/include/infiniband/acm_prov.h |  3 ++-
 ibacm/prov/acmp/src/acmp.c          | 26 ++++++++++++++------------
 ibacm/src/acm.c                     | 15 ++++++++-------
 3 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/ibacm/include/infiniband/acm_prov.h b/ibacm/include/infiniband/acm_prov.h
index 00baf582b74e..adfcf8162b8c 100644
--- a/ibacm/include/infiniband/acm_prov.h
+++ b/ibacm/include/infiniband/acm_prov.h
@@ -85,7 +85,8 @@ int provider_query(struct acm_provider **info, uint32_t *version);
 /* Functions exported from core */
 #define acm_log(level, format, ...) \
 	acm_write(level, "%s: "format, __func__, ## __VA_ARGS__)
-extern void acm_write(int level, const char *format, ...);
+extern void acm_write(int level, const char *format, ...)
+    __attribute__((format(printf, 2, 3)));
 extern void acm_format_name(int level, char *name, size_t name_size,
 	uint8_t addr_type, const uint8_t *addr, size_t addr_size);
 
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index 9ec7db44b0d1..fd579dff9d4e 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -55,6 +55,7 @@
 #include <netinet/in.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
+#include <inttypes.h>
 #include "acm_util.h"
 #include "acm_mad.h"
 
@@ -383,7 +384,7 @@ acmp_acquire_dest(struct acmp_ep *ep, uint8_t addr_type, const uint8_t *addr)
 			acmp_remove_dest(ep, dest);
 			dest = NULL;
 		} else {
-			acm_log(2, "Record valid for the next %ld minute(s)\n",
+			acm_log(2, "Record valid for the next %" PRId64 " minute(s)\n",
 				rec_expr_minutes);
 		}
 	}
@@ -411,7 +412,7 @@ static struct acmp_request *acmp_alloc_req(uint64_t id, struct acm_msg *msg)
 
 	req->id = id;
 	memcpy(&req->msg, msg, sizeof(req->msg));
-	acm_log(2, "id %llu, req %p\n", id, req);
+	acm_log(2, "id %" PRIu64 ", req %p\n", id, req);
 	return req;
 }
 
@@ -935,7 +936,7 @@ acmp_resolve_response(uint64_t id, struct acm_msg *req_msg,
 {
 	struct acm_msg msg;
 
-	acm_log(2, "client %lld, status 0x%x\n", id, status);
+	acm_log(2, "client %" PRIu64 ", status 0x%x\n", id, status);
 	memset(&msg, 0, sizeof msg);
 
 	if (dest) {
@@ -981,7 +982,7 @@ acmp_complete_queued_req(struct acmp_dest *dest, uint8_t status)
 		req = container_of(entry, struct acmp_request, entry);
 		lock_release(&dest->lock);
 
-		acm_log(2, "completing request, client %d\n", req->id);
+		acm_log(2, "completing request, client %" PRIu64 "\n", req->id);
 		acmp_resolve_response(req->id, &req->msg, dest, status);
 		acmp_free_req(req);
 
@@ -1016,7 +1017,8 @@ acmp_dest_sa_resp(struct acm_sa_mad *mad)
 		acmp_init_path_av(dest->ep->port, dest);
 		dest->addr_timeout = time_stamp_min() + (unsigned) addr_timeout;
 		dest->route_timeout = time_stamp_min() + (unsigned) route_timeout;
-		acm_log(2, "timeout addr %llu route %llu\n", dest->addr_timeout, dest->route_timeout);
+		acm_log(2, "timeout addr %" PRIu64 " route %" PRIu64 "\n",
+			dest->addr_timeout, dest->route_timeout);
 		dest->state = ACMP_READY;
 	} else {
 		dest->state = ACMP_INIT;
@@ -1726,7 +1728,7 @@ static uint8_t acmp_queue_req(struct acmp_dest *dest, uint64_t id, struct acm_ms
 {
 	struct acmp_request *req;
 
-	acm_log(2, "id %llu\n", id);
+	acm_log(2, "id %" PRIu64 "\n", id);
 	req = acmp_alloc_req(id, msg);
 	if (!req) {
 		return ACM_STATUS_ENOMEM;
@@ -2446,8 +2448,8 @@ static struct acmp_port *acmp_get_port(struct acm_endpoint *endpoint)
 	struct acmp_device *dev;
 	DLIST_ENTRY *dev_entry;
 
-	acm_log(1, "dev 0x%llx port %d pkey 0x%x\n",
-		endpoint->port->dev->dev_guid, endpoint->port->port_num, 
+	acm_log(1, "dev 0x%" PRIx64 " port %d pkey 0x%x\n",
+		endpoint->port->dev->dev_guid, endpoint->port->port_num,
 		endpoint->pkey);
 	for (dev_entry = acmp_dev_list.Next; dev_entry != &acmp_dev_list;
 	     dev_entry = dev_entry->Next) {
@@ -2466,7 +2468,7 @@ acmp_get_ep(struct acmp_port *port, struct acm_endpoint *endpoint)
 	struct acmp_ep *ep;
 	DLIST_ENTRY *entry;
 
-	acm_log(1, "dev 0x%llx port %d pkey 0x%x\n",
+	acm_log(1, "dev 0x%" PRIx64 " port %d pkey 0x%x\n",
 		endpoint->port->dev->dev_guid, endpoint->port->port_num, endpoint->pkey);
 	for (entry = port->ep_list.Next; entry != &port->ep_list;
 	     entry = entry->Next) {
@@ -2769,7 +2771,7 @@ static int acmp_open_dev(const struct acm_device *device, void **dev_context)
 	DLIST_ENTRY *dev_entry;
 	struct ibv_context *verbs;
 
-	acm_log(1, "dev_guid 0x%llx %s\n", device->dev_guid, 
+	acm_log(1, "dev_guid 0x%" PRIx64 " %s\n", device->dev_guid,
 		device->verbs->device->name);
 
 	for (dev_entry = acmp_dev_list.Next; dev_entry != &acmp_dev_list;
@@ -2777,7 +2779,7 @@ static int acmp_open_dev(const struct acm_device *device, void **dev_context)
 		dev = container_of(dev_entry, struct acmp_device, entry);
 
 		if (dev->guid == device->dev_guid) {
-			acm_log(2, "dev_guid 0x%llx already exits\n", 
+			acm_log(2, "dev_guid 0x%" PRIx64 " already exits\n",
 				device->dev_guid);
 			*dev_context = dev;
 			dev->device = device;
@@ -2859,7 +2861,7 @@ static void acmp_close_dev(void *dev_context)
 {
 	struct acmp_device *dev = dev_context;
 
-	acm_log(1, "dev_guid 0x%llx\n", dev->device->dev_guid);
+	acm_log(1, "dev_guid 0x%" PRIx64 "\n", dev->device->dev_guid);
 	dev->device = NULL;
 }
 
diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c
index 523b78082ff8..befe94203dd3 100644
--- a/ibacm/src/acm.c
+++ b/ibacm/src/acm.c
@@ -62,6 +62,7 @@
 #include <rdma/ib_user_sa.h>
 #endif
 #include <poll.h>
+#include <inttypes.h>
 #include "acm_mad.h"
 #include "acm_util.h"
 #ifdef HAVE_NETLINK
@@ -1471,7 +1472,7 @@ static int acm_nl_parse_path_attr(struct nlattr *attr,
 	case LS_NLA_TYPE_SERVICE_ID:
 		sid = (uint64_t *) NLA_DATA(attr);
 		if (NLA_LEN(attr) == sizeof(*sid)) {
-			acm_log(2, "service_id 0x%llx\n", *sid);
+			acm_log(2, "service_id 0x%" PRIx64 "\n", *sid);
 			path->service_id = htonll(*sid);
 		} else {
 			ret = -1;
@@ -2207,7 +2208,7 @@ static void acm_port_get_gid_tbl(struct acmc_port *port)
 					    &port->gid_tbl[j]);
 			if (ret || !port->gid_tbl[j].global.interface_id)
 				break;
-			acm_log(2, "guid %d: 0x%llx %llx\n", j,
+			acm_log(2, "guid %d: 0x%" PRIx64 " %" PRIx64 "\n", j,
 				port->gid_tbl[j].global.subnet_prefix, 
 				port->gid_tbl[j].global.interface_id);
 		}
@@ -2577,8 +2578,8 @@ static void acm_load_prov_config(void)
 			continue;
 		}
 		prefix = strtoull(p, NULL, 0);
-		acm_log(2, "provider %s subnet_prefix 0x%llx\n", prov_name, 
-			prefix);
+		acm_log(2, "provider %s subnet_prefix 0x%" PRIx64 "\n",
+			prov_name, prefix);
 		/* Convert it into network byte order */
 		prefix = htonll(prefix);
 
@@ -2667,8 +2668,8 @@ static int acm_open_providers(void)
 
 		if (version != ACM_PROV_VERSION ||
 		    provider->size != sizeof(struct acm_provider)) {
-			acm_log(0, "Error -unmatched provider version 0x%08x (size %d)"
-				" core 0x%08x (size %d)\n", version, provider->size,
+			acm_log(0, "Error -unmatched provider version 0x%08x (size %zd)"
+				" core 0x%08x (size %zd)\n", version, provider->size,
 				ACM_PROV_VERSION, sizeof(struct acm_provider));
 			dlclose(handle);
 			continue;
@@ -2863,7 +2864,7 @@ static void acmc_recv_mad(struct acmc_port *port)
 	}
 
 	hdr = &resp.sa_mad.mad_hdr;
-	acm_log(2, "bv %x cls %x cv %x mtd %x st %d tid %llx at %x atm %x\n",
+	acm_log(2, "bv %x cls %x cv %x mtd %x st %d tid %" PRIx64 "x at %x atm %x\n",
 		hdr->base_version, hdr->mgmt_class, hdr->class_version,
 		hdr->method, hdr->status, hdr->tid, hdr->attr_id, hdr->attr_mod);
 	found = 0;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 7/8] Enable -Wformat=2
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
                     ` (5 preceding siblings ...)
  2016-10-14 22:14   ` [PATCH rdma-core 6/8] acm: Fix format string usage with acm_log Jason Gunthorpe
@ 2016-10-14 22:14   ` Jason Gunthorpe
  2016-10-14 22:14   ` [PATCH rdma-core 8/8] Enable -Wshadow Jason Gunthorpe
  2016-10-15  9:46   ` [PATCH rdma-core 0/8] More warning fixing Leon Romanovsky
  8 siblings, 0 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

This is useful to detect functions that are handling format strings but
not marked with __attribute__(format), as well as other sorts
for format related mistakes.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd58a7039618..8f21ba384c12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,7 @@ RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WARNINGS
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_PROTOTYPES "-Wmissing-prototypes")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarations")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WFORMAT_2 "-Wformat=2")
 
 # At some point around 5.4 gcc fixed missing-field-initializers to ignore this
 # common idiom we use extensively. Since this is a useful warning for
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH rdma-core 8/8] Enable -Wshadow
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
                     ` (6 preceding siblings ...)
  2016-10-14 22:14   ` [PATCH rdma-core 7/8] Enable -Wformat=2 Jason Gunthorpe
@ 2016-10-14 22:14   ` Jason Gunthorpe
       [not found]     ` <1476483257-16308-9-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2016-10-15  9:46   ` [PATCH rdma-core 0/8] More warning fixing Leon Romanovsky
  8 siblings, 1 reply; 14+ messages in thread
From: Jason Gunthorpe @ 2016-10-14 22:14 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Christoph Hellwig, Sean Hefty

Having multiple objects with the same name in the same scope is
almost always confusing. Make some trivial changes to avoid those
few cases.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 CMakeLists.txt                      | 17 +++++++++++
 ibacm/prov/acmp/src/acmp.c          | 10 +++----
 libibverbs/examples/srq_pingpong.c  |  1 -
 libibverbs/examples/xsrq_pingpong.c |  6 ++--
 libibverbs/verbs.h                  |  6 ++--
 librdmacm/examples/riostream.c      | 34 ++++++++++-----------
 librdmacm/examples/rstream.c        | 50 +++++++++++++++----------------
 librdmacm/examples/udpong.c         | 60 ++++++++++++++++++-------------------
 providers/mthca/cq.c                |  2 +-
 9 files changed, 101 insertions(+), 85 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8f21ba384c12..375859d04914 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,6 +115,20 @@ RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WMISSING_DECLARATIONS "-Wmissing-declarati
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WWRITE_STRINGS "-Wwrite-strings")
 RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WFORMAT_2 "-Wformat=2")
 
+# At some point after 4.4 gcc fixed shadow to ignore function vs variable
+# conflicts
+set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+  set(CMAKE_REQUIRED_FLAGS "-Wshadow")
+CHECK_C_SOURCE_COMPILES("
+ #include <unistd.h>
+ int main(int argc,const char *argv[]) { int access = 1; return access; }"
+  HAVE_C_WORKING_SHADOW
+  FAIL_REGEX "warning")
+if (HAVE_C_WORKING_SHADOW)
+  RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WORKING_SHADOW "-Wshadow")
+endif()
+set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
+
 # At some point around 5.4 gcc fixed missing-field-initializers to ignore this
 # common idiom we use extensively. Since this is a useful warning for
 # developers try and leave it on if the compiler supports it.
@@ -372,6 +386,9 @@ endif()
 if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
   message(STATUS " -Wmissing-field-initializers does NOT work")
 endif()
+if (NOT HAVE_C_WORKING_SHADOW)
+  message(STATUS " -Wshadow does NOT work")
+endif()
 if (NOT HAVE_C_WREDUNDANT_DECLS)
   message(STATUS " -Wredundant-decls does NOT work")
 endif()
diff --git a/ibacm/prov/acmp/src/acmp.c b/ibacm/prov/acmp/src/acmp.c
index fd579dff9d4e..806320ffffd5 100644
--- a/ibacm/prov/acmp/src/acmp.c
+++ b/ibacm/prov/acmp/src/acmp.c
@@ -252,7 +252,7 @@ static struct acm_provider def_prov = {
 static DLIST_ENTRY acmp_dev_list;
 static lock_t acmp_dev_lock;
 
-static atomic_t tid;
+static atomic_t g_tid;
 static DLIST_ENTRY timeout_list;
 static event_t timeout_event;
 static atomic_t wait_cnt;
@@ -787,7 +787,7 @@ static void acmp_init_path_query(struct ib_sa_mad *mad)
 	mad->mgmt_class = IB_MGMT_CLASS_SA;
 	mad->class_version = 2;
 	mad->method = IB_METHOD_GET;
-	mad->tid = htonll((uint64_t) atomic_inc(&tid));
+	mad->tid = htonll((uint64_t) atomic_inc(&g_tid));
 	mad->attr_id = IB_SA_ATTR_PATH_REC;
 }
 
@@ -1378,7 +1378,7 @@ static void acmp_init_join(struct ib_sa_mad *mad, union ibv_gid *port_gid,
 	mad->mgmt_class = IB_MGMT_CLASS_SA;
 	mad->class_version = 2;
 	mad->method = IB_METHOD_SET;
-	mad->tid = htonll((uint64_t) atomic_inc(&tid));
+	mad->tid = htonll((uint64_t) atomic_inc(&g_tid));
 	mad->attr_id = IB_SA_ATTR_MC_MEMBER_REC;
 	mad->comp_mask =
 		IB_COMP_MASK_MC_MGID | IB_COMP_MASK_MC_PORT_GID |
@@ -1703,7 +1703,7 @@ acmp_send_resolve(struct acmp_ep *ep, struct acmp_dest *dest,
 	mad->class_version = 1;
 	mad->method = IB_METHOD_GET;
 	mad->control = ACM_CTRL_RESOLVE;
-	mad->tid = htonll((uint64_t) atomic_inc(&tid));
+	mad->tid = htonll((uint64_t) atomic_inc(&g_tid));
 
 	rec = (struct acm_resolve_rec *) mad->data;
 	rec->src_type = (uint8_t) saddr->type;
@@ -2948,7 +2948,7 @@ static void __attribute__((constructor)) acmp_init(void)
 
 	acmp_log_options();
 
-	atomic_init(&tid);
+	atomic_init(&g_tid);
 	atomic_init(&wait_cnt);
 	DListInit(&acmp_dev_list);
 	lock_init(&acmp_dev_lock);
diff --git a/libibverbs/examples/srq_pingpong.c b/libibverbs/examples/srq_pingpong.c
index e2993bfdacbf..30d81f0e4f31 100644
--- a/libibverbs/examples/srq_pingpong.c
+++ b/libibverbs/examples/srq_pingpong.c
@@ -770,7 +770,6 @@ int main(int argc, char *argv[])
 			return 1;
 		}
 	} else {
-		int i;
 		for (i = 0; dev_list[i]; ++i)
 			if (!strcmp(ibv_get_device_name(dev_list[i]), ib_devname))
 				break;
diff --git a/libibverbs/examples/xsrq_pingpong.c b/libibverbs/examples/xsrq_pingpong.c
index b90f0eb7e27f..5fb8827579dd 100644
--- a/libibverbs/examples/xsrq_pingpong.c
+++ b/libibverbs/examples/xsrq_pingpong.c
@@ -456,13 +456,13 @@ static int recv_remote_dest(int sockfd, int index)
 	return 0;
 }
 
-static void set_ah_attr(struct ibv_ah_attr *attr, struct pingpong_context *ctx,
+static void set_ah_attr(struct ibv_ah_attr *attr, struct pingpong_context *myctx,
 			int index)
 {
 	attr->is_global = 1;
 	attr->grh.hop_limit = 5;
-	attr->grh.dgid = ctx->rem_dest[index].gid;
-	attr->grh.sgid_index = ctx->gidx;
+	attr->grh.dgid = myctx->rem_dest[index].gid;
+	attr->grh.sgid_index = myctx->gidx;
 }
 
 static int connect_qps(int index)
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index e994c21c267f..a2ccaaf141ab 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1459,9 +1459,9 @@ static inline struct verbs_context *verbs_get_ctx(struct ibv_context *ctx)
 }
 
 #define verbs_get_ctx_op(ctx, op) ({ \
-	struct verbs_context *vctx = verbs_get_ctx(ctx); \
-	(!vctx || (vctx->sz < sizeof(*vctx) - offsetof(struct verbs_context, op)) || \
-	 !vctx->op) ? NULL : vctx; })
+	struct verbs_context *__vctx = verbs_get_ctx(ctx); \
+	(!__vctx || (__vctx->sz < sizeof(*__vctx) - offsetof(struct verbs_context, op)) || \
+	 !__vctx->op) ? NULL : __vctx; })
 
 #define verbs_set_ctx_op(_vctx, op, ptr) ({ \
 	struct verbs_context *vctx = _vctx; \
diff --git a/librdmacm/examples/riostream.c b/librdmacm/examples/riostream.c
index bd8c60cdcb1d..d9e5fd6eb0a6 100644
--- a/librdmacm/examples/riostream.c
+++ b/librdmacm/examples/riostream.c
@@ -317,35 +317,35 @@ out:
 	return ret;
 }
 
-static void set_options(int rs)
+static void set_options(int fd)
 {
 	int val;
 
 	if (buffer_size) {
-		rsetsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
+		rsetsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
 			    sizeof buffer_size);
-		rsetsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
+		rsetsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
 			    sizeof buffer_size);
 	} else {
 		val = 1 << 19;
-		rsetsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
-		rsetsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
+		rsetsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
+		rsetsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
 	}
 
 	val = 1;
-	rsetsockopt(rs, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
-	rsetsockopt(rs, SOL_RDMA, RDMA_IOMAPSIZE, (void *) &val, sizeof val);
+	rsetsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
+	rsetsockopt(fd, SOL_RDMA, RDMA_IOMAPSIZE, (void *) &val, sizeof val);
 
 	if (flags & MSG_DONTWAIT)
-		rfcntl(rs, F_SETFL, O_NONBLOCK);
+		rfcntl(fd, F_SETFL, O_NONBLOCK);
 
 	/* Inline size based on experimental data */
 	if (optimization == opt_latency) {
-		rsetsockopt(rs, SOL_RDMA, RDMA_INLINE, &inline_size,
+		rsetsockopt(fd, 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);
+		rsetsockopt(fd, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
 	}
 }
 
@@ -555,10 +555,10 @@ free:
 	return ret;
 }
 
-static int set_test_opt(char *optarg)
+static int set_test_opt(const char *arg)
 {
-	if (strlen(optarg) == 1) {
-		switch (optarg[0]) {
+	if (strlen(arg) == 1) {
+		switch (arg[0]) {
 		case 'a':
 			use_async = 1;
 			break;
@@ -575,13 +575,13 @@ static int set_test_opt(char *optarg)
 			return -1;
 		}
 	} else {
-		if (!strncasecmp("async", optarg, 5)) {
+		if (!strncasecmp("async", arg, 5)) {
 			use_async = 1;
-		} else if (!strncasecmp("block", optarg, 5)) {
+		} else if (!strncasecmp("block", arg, 5)) {
 			flags = (flags & ~MSG_DONTWAIT) | MSG_WAITALL;
-		} else if (!strncasecmp("nonblock", optarg, 8)) {
+		} else if (!strncasecmp("nonblock", arg, 8)) {
 			flags |= MSG_DONTWAIT;
-		} else if (!strncasecmp("verify", optarg, 6)) {
+		} else if (!strncasecmp("verify", arg, 6)) {
 			verify = 1;
 		} else {
 			return -1;
diff --git a/librdmacm/examples/rstream.c b/librdmacm/examples/rstream.c
index 59a0d4351ef5..14799c997128 100644
--- a/librdmacm/examples/rstream.c
+++ b/librdmacm/examples/rstream.c
@@ -255,62 +255,62 @@ out:
 	return ret;
 }
 
-static void set_keepalive(int rs)
+static void set_keepalive(int fd)
 {
 	int optval;
 	socklen_t optlen = sizeof(optlen);
 
 	optval = 1;
-	if (rs_setsockopt(rs, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen)) {
+	if (rs_setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen)) {
 		perror("rsetsockopt SO_KEEPALIVE");
 		return;
 	}
 
 	optval = keepalive;
-	if (rs_setsockopt(rs, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen))
+	if (rs_setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen))
 		perror("rsetsockopt TCP_KEEPIDLE");
 
-	if (!(rs_getsockopt(rs, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen)))
+	if (!(rs_getsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen)))
 		printf("Keepalive: %s\n", (optval ? "ON" : "OFF"));
 
-	if (!(rs_getsockopt(rs, IPPROTO_TCP, TCP_KEEPIDLE, &optval, &optlen)))
+	if (!(rs_getsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &optval, &optlen)))
 		printf("  time: %i\n", optval);
 }
 
-static void set_options(int rs)
+static void set_options(int fd)
 {
 	int val;
 
 	if (buffer_size) {
-		rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
+		rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
 			      sizeof buffer_size);
-		rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
+		rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
 			      sizeof buffer_size);
 	} else {
 		val = 1 << 19;
-		rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
-		rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
+		rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
+		rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
 	}
 
 	val = 1;
-	rs_setsockopt(rs, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
+	rs_setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void *) &val, sizeof(val));
 
 	if (flags & MSG_DONTWAIT)
-		rs_fcntl(rs, F_SETFL, O_NONBLOCK);
+		rs_fcntl(fd, F_SETFL, O_NONBLOCK);
 
 	if (use_rs) {
 		/* Inline size based on experimental data */
 		if (optimization == opt_latency) {
-			rs_setsockopt(rs, SOL_RDMA, RDMA_INLINE, &inline_size,
+			rs_setsockopt(fd, 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);
+			rs_setsockopt(fd, SOL_RDMA, RDMA_INLINE, &val, sizeof val);
 		}
 	}
 
 	if (keepalive)
-		set_keepalive(rs);
+		set_keepalive(fd);
 }
 
 static int server_listen(void)
@@ -564,10 +564,10 @@ free:
 	return ret;
 }
 
-static int set_test_opt(char *optarg)
+static int set_test_opt(const char *arg)
 {
-	if (strlen(optarg) == 1) {
-		switch (optarg[0]) {
+	if (strlen(arg) == 1) {
+		switch (arg[0]) {
 		case 's':
 			use_rs = 0;
 			break;
@@ -594,19 +594,19 @@ static int set_test_opt(char *optarg)
 			return -1;
 		}
 	} else {
-		if (!strncasecmp("socket", optarg, 6)) {
+		if (!strncasecmp("socket", arg, 6)) {
 			use_rs = 0;
-		} else if (!strncasecmp("async", optarg, 5)) {
+		} else if (!strncasecmp("async", arg, 5)) {
 			use_async = 1;
-		} else if (!strncasecmp("block", optarg, 5)) {
+		} else if (!strncasecmp("block", arg, 5)) {
 			flags = (flags & ~MSG_DONTWAIT) | MSG_WAITALL;
-		} else if (!strncasecmp("nonblock", optarg, 8)) {
+		} else if (!strncasecmp("nonblock", arg, 8)) {
 			flags |= MSG_DONTWAIT;
-		} else if (!strncasecmp("resolve", optarg, 7)) {
+		} else if (!strncasecmp("resolve", arg, 7)) {
 			use_rgai = 1;
-		} else if (!strncasecmp("verify", optarg, 6)) {
+		} else if (!strncasecmp("verify", arg, 6)) {
 			verify = 1;
-		} else if (!strncasecmp("fork", optarg, 4)) {
+		} else if (!strncasecmp("fork", arg, 4)) {
 			use_fork = 1;
 			use_rs = 0;
 		} else {
diff --git a/librdmacm/examples/udpong.c b/librdmacm/examples/udpong.c
index f8d56073012a..71528f226769 100644
--- a/librdmacm/examples/udpong.c
+++ b/librdmacm/examples/udpong.c
@@ -96,10 +96,10 @@ static char test_name[10] = "custom";
 static const char *port = "7174";
 static char *dst_addr;
 static char *src_addr;
-static union socket_addr addr;
-static socklen_t addrlen;
+static union socket_addr g_addr;
+static socklen_t g_addrlen;
 static struct timeval start, end;
-static struct message msg;
+static struct message g_msg;
 
 static void show_perf(void)
 {
@@ -109,7 +109,7 @@ static void show_perf(void)
 	int transfers;
 
 	usec = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_usec - start.tv_usec);
-	transfers = echo ? transfer_count * 2 : ntohl(msg.data);
+	transfers = echo ? transfer_count * 2 : ntohl(g_msg.data);
 	bytes = (long long) transfers * transfer_size;
 
 	/* name size transfers bytes seconds Gb/sec usec/xfer */
@@ -147,23 +147,23 @@ static void init_bandwidth_test(int size)
 	echo = 0;
 }
 
-static void set_options(int rs)
+static void set_options(int fd)
 {
 	int val;
 
 	if (buffer_size) {
-		rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
+		rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &buffer_size,
 			      sizeof buffer_size);
-		rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
+		rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &buffer_size,
 			      sizeof buffer_size);
 	} else {
 		val = 1 << 19;
-		rs_setsockopt(rs, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
-		rs_setsockopt(rs, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
+		rs_setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void *) &val, sizeof val);
+		rs_setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void *) &val, sizeof val);
 	}
 
 	if (flags & MSG_DONTWAIT)
-		rs_fcntl(rs, F_SETFL, O_NONBLOCK);
+		rs_fcntl(fd, F_SETFL, O_NONBLOCK);
 }
 
 static ssize_t svr_send(struct message *msg, size_t size,
@@ -296,12 +296,12 @@ static int svr_run(void)
 
 	ret = svr_bind();
 	while (!ret) {
-		addrlen = sizeof addr;
-		len = svr_recv(&msg, sizeof msg, &addr, &addrlen);
+		g_addrlen = sizeof g_addr;
+		len = svr_recv(&g_msg, sizeof g_msg, &g_addr, &g_addrlen);
 		if (len < 0)
 			return len;
 
-		ret = svr_process(&msg, len, &addr, addrlen);
+		ret = svr_process(&g_msg, len, &g_addr, g_addrlen);
 	}
 	return ret;
 }
@@ -375,22 +375,22 @@ static int run_test(void)
 {
 	int ret, i;
 
-	msg.op = msg_op_start;
-	ret = client_send_recv(&msg, CTRL_MSG_SIZE, 1000);
+	g_msg.op = msg_op_start;
+	ret = client_send_recv(&g_msg, CTRL_MSG_SIZE, 1000);
 	if (ret != CTRL_MSG_SIZE)
 		goto out;
 
-	msg.op = echo ? msg_op_echo : msg_op_data;
+	g_msg.op = echo ? msg_op_echo : msg_op_data;
 	gettimeofday(&start, NULL);
 	for (i = 0; i < transfer_count; i++) {
-		ret = echo ? client_send_recv(&msg, transfer_size, 1) :
-			     client_send(&msg, transfer_size);
+		ret = echo ? client_send_recv(&g_msg, transfer_size, 1) :
+			     client_send(&g_msg, transfer_size);
 		if (ret != transfer_size)
 			goto out;
 	}
 
-	msg.op = msg_op_end;
-	ret = client_send_recv(&msg, CTRL_MSG_SIZE, 1);
+	g_msg.op = msg_op_end;
+	ret = client_send_recv(&g_msg, CTRL_MSG_SIZE, 1);
 	if (ret != CTRL_MSG_SIZE)
 		goto out;
 
@@ -430,8 +430,8 @@ static int client_connect(void)
 		goto out;
 	}
 
-	msg.op = msg_op_login;
-	ret = client_send_recv(&msg, CTRL_MSG_SIZE, 1000);
+	g_msg.op = msg_op_login;
+	ret = client_send_recv(&g_msg, CTRL_MSG_SIZE, 1000);
 	if (ret == CTRL_MSG_SIZE)
 		ret = 0;
 
@@ -468,10 +468,10 @@ static int client_run(void)
 	return ret;
 }
 
-static int set_test_opt(char *optarg)
+static int set_test_opt(const char *arg)
 {
-	if (strlen(optarg) == 1) {
-		switch (optarg[0]) {
+	if (strlen(arg) == 1) {
+		switch (arg[0]) {
 		case 's':
 			use_rs = 0;
 			break;
@@ -491,15 +491,15 @@ static int set_test_opt(char *optarg)
 			return -1;
 		}
 	} else {
-		if (!strncasecmp("socket", optarg, 6)) {
+		if (!strncasecmp("socket", arg, 6)) {
 			use_rs = 0;
-		} else if (!strncasecmp("async", optarg, 5)) {
+		} else if (!strncasecmp("async", arg, 5)) {
 			use_async = 1;
-		} else if (!strncasecmp("block", optarg, 5)) {
+		} else if (!strncasecmp("block", arg, 5)) {
 			flags = 0;
-		} else if (!strncasecmp("nonblock", optarg, 8)) {
+		} else if (!strncasecmp("nonblock", arg, 8)) {
 			flags = MSG_DONTWAIT;
-		} else if (!strncasecmp("echo", optarg, 4)) {
+		} else if (!strncasecmp("echo", arg, 4)) {
 			echo = 1;
 		} else {
 			return -1;
diff --git a/providers/mthca/cq.c b/providers/mthca/cq.c
index d71d430c6e28..aa08e065f275 100644
--- a/providers/mthca/cq.c
+++ b/providers/mthca/cq.c
@@ -294,7 +294,6 @@ static inline int mthca_poll_one(struct mthca_cq *cq,
 	struct mthca_cqe *cqe;
 	struct mthca_srq *srq;
 	uint32_t qpn;
-	uint32_t wqe;
 	int wqe_index;
 	int is_error;
 	int is_send;
@@ -339,6 +338,7 @@ static inline int mthca_poll_one(struct mthca_cq *cq,
 		wqe_index = ((ntohl(cqe->wqe) - (*cur_qp)->send_wqe_offset) >> wq->wqe_shift);
 		wc->wr_id = (*cur_qp)->wrid[wqe_index + (*cur_qp)->rq.max];
 	} else if ((*cur_qp)->ibv_qp.srq) {
+		uint32_t wqe;
 		srq = to_msrq((*cur_qp)->ibv_qp.srq);
 		wqe = htonl(cqe->wqe);
 		wq = NULL;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* RE: [PATCH rdma-core 1/8] rdmacm: constify rdma_getaddrinfo public function
       [not found]     ` <1476483257-16308-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-10-14 22:18       ` Hefty, Sean
  0 siblings, 0 replies; 14+ messages in thread
From: Hefty, Sean @ 2016-10-14 22:18 UTC (permalink / raw)
  To: Jason Gunthorpe, Doug Ledford,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Christoph Hellwig

> Like getaddrinfo most of the arguments should be const.
> 
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error
       [not found]     ` <1476483257-16308-6-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-10-14 22:18       ` Hefty, Sean
  0 siblings, 0 replies; 14+ messages in thread
From: Hefty, Sean @ 2016-10-14 22:18 UTC (permalink / raw)
  To: Jason Gunthorpe, Doug Ledford,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Christoph Hellwig

> The arguments were swapped, and totally crash-when-run wrong.
> 
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
> ---

Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH rdma-core 8/8] Enable -Wshadow
       [not found]     ` <1476483257-16308-9-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-10-14 22:50       ` Hefty, Sean
  0 siblings, 0 replies; 14+ messages in thread
From: Hefty, Sean @ 2016-10-14 22:50 UTC (permalink / raw)
  To: Jason Gunthorpe, Doug Ledford,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: Christoph Hellwig

> Having multiple objects with the same name in the same scope is
> almost always confusing. Make some trivial changes to avoid those
> few cases.
> 
> Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Acked-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH rdma-core 0/8] More warning fixing
       [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
                     ` (7 preceding siblings ...)
  2016-10-14 22:14   ` [PATCH rdma-core 8/8] Enable -Wshadow Jason Gunthorpe
@ 2016-10-15  9:46   ` Leon Romanovsky
  8 siblings, 0 replies; 14+ messages in thread
From: Leon Romanovsky @ 2016-10-15  9:46 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Christoph Hellwig, Sean Hefty

[-- Attachment #1: Type: text/plain, Size: 2990 bytes --]

On Fri, Oct 14, 2016 at 04:14:09PM -0600, Jason Gunthorpe wrote:
> This batch is on top of the series from Christoph Hellwig, it turns on a few
> more useful gcc warnings and fixes the fall out.
>
> Whole batch is here now: https://github.com/linux-rdma/rdma-core/pull/19

Thanks, applied whole batch.

>
> Jason Gunthorpe (8):
>   rdmacm: constify rdma_getaddrinfo public function
>   Enable -Wwrite-strings
>   verbs: Use cmake to detect if net/if.h vs netling/route/link.h is
>     broken
>   Enable -Wredundant-decls
>   acm: Fix wrong format attributes for error
>   acm: Fix format string usage with acm_log
>   Enable -Wformat=2
>   Enable -Wshadow
>
>  CMakeLists.txt                      | 55 ++++++++++++++++++++++++++++++++
>  buildlib/config.h.in                |  2 ++
>  ibacm/include/infiniband/acm_prov.h |  7 +++--
>  ibacm/prov/acmp/src/acmp.c          | 38 ++++++++++++-----------
>  ibacm/src/acm.c                     | 25 ++++++++-------
>  ibacm/src/acm_util.h                |  6 ++--
>  ibacm/src/acme.c                    |  8 ++---
>  ibacm/src/parse.c                   |  2 +-
>  iwpmd/iwarp_pm.h                    |  2 +-
>  iwpmd/iwarp_pm_common.c             |  7 +++--
>  libibverbs/examples/srq_pingpong.c  |  1 -
>  libibverbs/examples/xsrq_pingpong.c |  6 ++--
>  libibverbs/neigh.c                  |  8 ++---
>  libibverbs/sysfs.c                  | 13 ++++----
>  libibverbs/verbs.h                  |  6 ++--
>  librdmacm/acm.c                     |  3 +-
>  librdmacm/addrinfo.c                | 14 +++++----
>  librdmacm/cma.h                     |  3 +-
>  librdmacm/examples/cmatose.c        |  2 +-
>  librdmacm/examples/cmtime.c         |  4 +--
>  librdmacm/examples/common.c         |  2 +-
>  librdmacm/examples/common.h         |  2 +-
>  librdmacm/examples/rcopy.c          |  2 +-
>  librdmacm/examples/rdma_client.c    |  4 +--
>  librdmacm/examples/rdma_server.c    |  2 +-
>  librdmacm/examples/rdma_xclient.c   |  2 +-
>  librdmacm/examples/rdma_xserver.c   |  2 +-
>  librdmacm/examples/riostream.c      | 36 ++++++++++-----------
>  librdmacm/examples/rping.c          |  2 +-
>  librdmacm/examples/rstream.c        | 52 +++++++++++++++----------------
>  librdmacm/examples/udaddy.c         |  2 +-
>  librdmacm/examples/udpong.c         | 62 ++++++++++++++++++-------------------
>  librdmacm/man/rdma_getaddrinfo.3    |  6 ++--
>  librdmacm/preload.c                 |  2 --
>  librdmacm/rdma_cma.h                |  4 +--
>  providers/mlx4/mlx4.h               |  6 ----
>  providers/mthca/cq.c                |  2 +-
>  srp_daemon/srp_daemon.c             | 29 ++++++++++-------
>  srp_daemon/srp_daemon.h             |  2 +-
>  39 files changed, 247 insertions(+), 186 deletions(-)
>
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [PATCH rdma-core 3/8] verbs: Use cmake to detect if net/if.h vs netling/route/link.h is broken
       [not found]     ` <1476483257-16308-4-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-10-17 14:48       ` Steve Wise
  0 siblings, 0 replies; 14+ messages in thread
From: Steve Wise @ 2016-10-17 14:48 UTC (permalink / raw)
  To: 'Jason Gunthorpe', 'Doug Ledford',
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: 'Christoph Hellwig', 'Sean Hefty'

> Subject: [PATCH rdma-core 3/8] verbs: Use cmake to detect if net/if.h vs
> netling/route/link.h is broken

nit: netling -> netlink



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-10-17 14:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-14 22:14 [PATCH rdma-core 0/8] More warning fixing Jason Gunthorpe
     [not found] ` <1476483257-16308-1-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-14 22:14   ` [PATCH rdma-core 1/8] rdmacm: constify rdma_getaddrinfo public function Jason Gunthorpe
     [not found]     ` <1476483257-16308-2-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-14 22:18       ` Hefty, Sean
2016-10-14 22:14   ` [PATCH rdma-core 2/8] Enable -Wwrite-strings Jason Gunthorpe
2016-10-14 22:14   ` [PATCH rdma-core 3/8] verbs: Use cmake to detect if net/if.h vs netling/route/link.h is broken Jason Gunthorpe
     [not found]     ` <1476483257-16308-4-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-17 14:48       ` Steve Wise
2016-10-14 22:14   ` [PATCH rdma-core 4/8] Enable -Wredundant-decls Jason Gunthorpe
2016-10-14 22:14   ` [PATCH rdma-core 5/8] acm: Fix wrong format attributes for error Jason Gunthorpe
     [not found]     ` <1476483257-16308-6-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-14 22:18       ` Hefty, Sean
2016-10-14 22:14   ` [PATCH rdma-core 6/8] acm: Fix format string usage with acm_log Jason Gunthorpe
2016-10-14 22:14   ` [PATCH rdma-core 7/8] Enable -Wformat=2 Jason Gunthorpe
2016-10-14 22:14   ` [PATCH rdma-core 8/8] Enable -Wshadow Jason Gunthorpe
     [not found]     ` <1476483257-16308-9-git-send-email-jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-10-14 22:50       ` Hefty, Sean
2016-10-15  9:46   ` [PATCH rdma-core 0/8] More warning fixing Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).