linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] librdmacm compiler warning fixes
@ 2013-07-28  9:17 Bart Van Assche
       [not found] ` <51F4E1B2.7070203-HInyCGIudOg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2013-07-28  9:17 UTC (permalink / raw)
  To: Sean Hefty, linux-rdma

This is a small series of four patches addressing issues I noticed while 
analyzing the warnings reported by a recent gcc version. These patches 
do not change the behavior of librdmacm.
--
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] 6+ messages in thread

* [PATCH 1/4] acm: Remove the unused variable 'pri_path'
       [not found] ` <51F4E1B2.7070203-HInyCGIudOg@public.gmane.org>
@ 2013-07-28  9:18   ` Bart Van Assche
  2013-07-28  9:19   ` [PATCH 2/4] cma: Remove the unused variable 'id_priv' Bart Van Assche
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2013-07-28  9:18 UTC (permalink / raw)
  Cc: Sean Hefty, linux-rdma

The variable 'pri_path' is assigned a value but is never used.
This triggers the following compiler warning:

src/acm.c:301:26: warning: variable 'pri_path' set but not used [-Wunused-but-set-variable]

Hence remove this variable.

Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
---
 src/acm.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/acm.c b/src/acm.c
index 04cddee..49bda48 100644
--- a/src/acm.c
+++ b/src/acm.c
@@ -297,7 +297,6 @@ static void ucma_ib_save_resp(struct rdma_addrinfo *rai, struct acm_msg *msg)
 {
 	struct acm_ep_addr_data *ep_data;
 	struct ibv_path_data *path_data = NULL;
-	struct ibv_path_record *pri_path = NULL;
 	struct sockaddr_in *sin;
 	struct sockaddr_in6 *sin6;
 	int i, cnt, path_cnt = 0;
@@ -311,9 +310,6 @@ static void ucma_ib_save_resp(struct rdma_addrinfo *rai, struct acm_msg *msg)
 			if (!path_data)
 				path_data = (struct ibv_path_data *) ep_data;
 			path_cnt++;
-			if (ep_data->flags |
-			    (IBV_PATH_FLAG_PRIMARY | IBV_PATH_FLAG_OUTBOUND))
-				pri_path = &path_data[i].path;
 			break;
 		case ACM_EP_INFO_ADDRESS_IP:
 			if (!(ep_data->flags & ACM_EP_FLAG_SOURCE) || rai->ai_src_len)
-- 
1.7.10.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] 6+ messages in thread

* [PATCH 2/4] cma: Remove the unused variable 'id_priv'
       [not found] ` <51F4E1B2.7070203-HInyCGIudOg@public.gmane.org>
  2013-07-28  9:18   ` [PATCH 1/4] acm: Remove the unused variable 'pri_path' Bart Van Assche
@ 2013-07-28  9:19   ` Bart Van Assche
  2013-07-28  9:19   ` [PATCH 3/4] rsocket: Remove the unused variable 'ret' Bart Van Assche
  2013-07-28  9:20   ` [PATCH 4/4] Declare 'server_port' as an unsigned variable Bart Van Assche
  3 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2013-07-28  9:19 UTC (permalink / raw)
  To: Sean Hefty; +Cc: linux-rdma

The variable 'id_priv' is assigned a value but is never used.
This triggers the following compiler warning:

src/cma.c:1178:25: warning: variable 'id_priv' set but not used [-Wunused-but-set-variable]

Hence remove this variable.

Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
---
 src/cma.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/src/cma.c b/src/cma.c
index baebecd..374844c 100644
--- a/src/cma.c
+++ b/src/cma.c
@@ -1175,11 +1175,9 @@ err:
 int rdma_create_srq(struct rdma_cm_id *id, struct ibv_pd *pd,
 		    struct ibv_srq_init_attr *attr)
 {
-	struct cma_id_private *id_priv;
 	struct ibv_srq *srq;
 	int ret;
 
-	id_priv = container_of(id, struct cma_id_private, id);
 	if (!pd)
 		pd = id->pd;
 
-- 
1.7.10.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] 6+ messages in thread

* [PATCH 3/4] rsocket: Remove the unused variable 'ret'
       [not found] ` <51F4E1B2.7070203-HInyCGIudOg@public.gmane.org>
  2013-07-28  9:18   ` [PATCH 1/4] acm: Remove the unused variable 'pri_path' Bart Van Assche
  2013-07-28  9:19   ` [PATCH 2/4] cma: Remove the unused variable 'id_priv' Bart Van Assche
@ 2013-07-28  9:19   ` Bart Van Assche
  2013-07-28  9:20   ` [PATCH 4/4] Declare 'server_port' as an unsigned variable Bart Van Assche
  3 siblings, 0 replies; 6+ messages in thread
From: Bart Van Assche @ 2013-07-28  9:19 UTC (permalink / raw)
  To: Sean Hefty; +Cc: linux-rdma

The variable 'ret' is assigned a value but that value is never used.
This triggers the following compiler warning:

src/rsocket.c:3720:9: warning: variable 'ret' set but not used [-Wunused-but-set-variable]

Hence remove this variable.

Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
---
 src/rsocket.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/rsocket.c b/src/rsocket.c
index abdd392..ef24dfb 100644
--- a/src/rsocket.c
+++ b/src/rsocket.c
@@ -3717,11 +3717,11 @@ static void rs_svc_process_sock(void)
 static uint8_t rs_svc_sgid_index(struct ds_dest *dest, union ibv_gid *sgid)
 {
 	union ibv_gid gid;
-	int i, ret;
+	int i;
 
 	for (i = 0; i < 16; i++) {
-		ret = ibv_query_gid(dest->qp->cm_id->verbs, dest->qp->cm_id->port_num,
-				    i, &gid);
+		ibv_query_gid(dest->qp->cm_id->verbs, dest->qp->cm_id->port_num,
+			      i, &gid);
 		if (!memcmp(sgid, &gid, sizeof gid))
 			return i;
 	}
-- 
1.7.10.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] 6+ messages in thread

* [PATCH 4/4] Declare 'server_port' as an unsigned variable
       [not found] ` <51F4E1B2.7070203-HInyCGIudOg@public.gmane.org>
                     ` (2 preceding siblings ...)
  2013-07-28  9:19   ` [PATCH 3/4] rsocket: Remove the unused variable 'ret' Bart Van Assche
@ 2013-07-28  9:20   ` Bart Van Assche
       [not found]     ` <51F4E276.2090800-HInyCGIudOg@public.gmane.org>
  3 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2013-07-28  9:20 UTC (permalink / raw)
  To: Sean Hefty; +Cc: linux-rdma

Change the data type of the 'server_port' variable from signed to
unsigned such that the cast in the fscanf() call can be removed.

Signed-off-by: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
---
 src/acm.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/acm.c b/src/acm.c
index 49bda48..33379cf 100644
--- a/src/acm.c
+++ b/src/acm.c
@@ -35,6 +35,7 @@
 #endif /* HAVE_CONFIG_H */
 
 #include <stdio.h>
+#include <inttypes.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
@@ -113,7 +114,7 @@ struct acm_msg {
 
 static pthread_mutex_t acm_lock = PTHREAD_MUTEX_INITIALIZER;
 static int sock = -1;
-static short server_port;
+static uint16_t server_port;
 
 struct ib_connect_hdr {
 	uint8_t  cma_version;
@@ -132,7 +133,7 @@ static int ucma_set_server_port(void)
 	FILE *f;
 
 	if ((f = fopen("/var/run/ibacm.port", "r" STREAM_CLOEXEC))) {
-		fscanf(f, "%hu", (unsigned short *) &server_port);
+		fscanf(f, "%" SCNu16, &server_port);
 		fclose(f);
 	}
 	return server_port;
-- 
1.7.10.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] 6+ messages in thread

* RE: [PATCH 4/4] Declare 'server_port' as an unsigned variable
       [not found]     ` <51F4E276.2090800-HInyCGIudOg@public.gmane.org>
@ 2013-07-31  1:24       ` Hefty, Sean
  0 siblings, 0 replies; 6+ messages in thread
From: Hefty, Sean @ 2013-07-31  1:24 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-rdma

thanks - applied all 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] 6+ messages in thread

end of thread, other threads:[~2013-07-31  1:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-28  9:17 [PATCH 0/4] librdmacm compiler warning fixes Bart Van Assche
     [not found] ` <51F4E1B2.7070203-HInyCGIudOg@public.gmane.org>
2013-07-28  9:18   ` [PATCH 1/4] acm: Remove the unused variable 'pri_path' Bart Van Assche
2013-07-28  9:19   ` [PATCH 2/4] cma: Remove the unused variable 'id_priv' Bart Van Assche
2013-07-28  9:19   ` [PATCH 3/4] rsocket: Remove the unused variable 'ret' Bart Van Assche
2013-07-28  9:20   ` [PATCH 4/4] Declare 'server_port' as an unsigned variable Bart Van Assche
     [not found]     ` <51F4E276.2090800-HInyCGIudOg@public.gmane.org>
2013-07-31  1:24       ` Hefty, Sean

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).