[ofa-general] [PATCH 1/2] [uDAPL v1] fix provider-specific compiler warnings

Patrick Marchand Latifi patrick.latifi at qlogic.com
Fri Mar 14 14:30:15 PDT 2008


Initialize ds_array_start_p otherwise the compiler would claim
that this variable could be used with an uninitialized value.

Makes the uDAPL providers now build successfully when using make
VERBS=<provider> (the -Werror flag was causing the build failure)

Signed-off-by: Patrick Marchand Latifi <patrick.latifi at qlogic.com>
---

 dapl/openib/dapl_ib_dto.h     |    8 ++++----
 dapl/openib_cma/dapl_ib_dto.h |    8 ++++----
 dapl/openib_scm/dapl_ib_dto.h |    8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dapl/openib/dapl_ib_dto.h b/dapl/openib/dapl_ib_dto.h
index 8b0e8fe..d4e40c3 100644
--- a/dapl/openib/dapl_ib_dto.h
+++ b/dapl/openib/dapl_ib_dto.h
@@ -67,7 +67,7 @@ dapls_ib_post_recv (
 	IN  DAT_LMR_TRIPLET	*local_iov )
 {
 	ib_data_segment_t	ds_array[DEFAULT_DS_ENTRIES];
-	ib_data_segment_t	*ds_array_p, *ds_array_start_p;
+	ib_data_segment_t	*ds_array_p, *ds_array_start_p = NULL;
 	struct ibv_recv_wr	wr;
 	struct ibv_recv_wr	*bad_wr;
 	DAT_COUNT		i, total_len;
@@ -116,7 +116,7 @@ dapls_ib_post_recv (
 
 	ret = ibv_post_recv(ep_ptr->qp_handle, &wr, &bad_wr);
 	
-	if (segments > DEFAULT_DS_ENTRIES)
+	if (ds_array_start_p != NULL)
 		dapl_os_free(ds_array_start_p, segments * sizeof(ib_data_segment_t));
 
 	if (ret)
@@ -147,7 +147,7 @@ dapls_ib_post_send (
 		      remote_iov, completion_flags);
 
 	ib_data_segment_t	ds_array[DEFAULT_DS_ENTRIES];
-	ib_data_segment_t	*ds_array_p, *ds_array_start_p;
+	ib_data_segment_t	*ds_array_p, *ds_array_start_p = NULL;
 	struct ibv_send_wr	wr;
 	struct ibv_send_wr	*bad_wr;
 	ib_hca_transport_t	*ibt_ptr = &ep_ptr->header.owner_ia->hca_ptr->ib_trans;
@@ -224,7 +224,7 @@ dapls_ib_post_send (
 
 	ret = ibv_post_send(ep_ptr->qp_handle, &wr, &bad_wr);
 	
-	if (segments > DEFAULT_DS_ENTRIES)
+	if (ds_array_start_p != NULL)
 		dapl_os_free(ds_array_start_p, segments * sizeof(ib_data_segment_t));
 
 	if (ret)
diff --git a/dapl/openib_cma/dapl_ib_dto.h b/dapl/openib_cma/dapl_ib_dto.h
index 4f077de..2bdd5e0 100644
--- a/dapl/openib_cma/dapl_ib_dto.h
+++ b/dapl/openib_cma/dapl_ib_dto.h
@@ -67,7 +67,7 @@ dapls_ib_post_recv (
 	IN  DAT_LMR_TRIPLET	*local_iov )
 {
 	ib_data_segment_t ds_array[DEFAULT_DS_ENTRIES];
-	ib_data_segment_t *ds_array_p, *ds_array_start_p;
+	ib_data_segment_t *ds_array_p, *ds_array_start_p = NULL;
 	struct ibv_recv_wr wr;
 	struct ibv_recv_wr *bad_wr;
 	DAT_COUNT i, total_len;
@@ -116,7 +116,7 @@ dapls_ib_post_recv (
 
 	ret = ibv_post_recv(ep_ptr->qp_handle->cm_id->qp, &wr, &bad_wr);
 	
-	if (segments > DEFAULT_DS_ENTRIES)
+	if (ds_array_start_p != NULL)
 	    dapl_os_free(ds_array_start_p, segments * sizeof(ib_data_segment_t));
 
 	if (ret)
@@ -148,7 +148,7 @@ dapls_ib_post_send (
 		     remote_iov, completion_flags);
 
 	ib_data_segment_t ds_array[DEFAULT_DS_ENTRIES];
-	ib_data_segment_t *ds_array_p, *ds_array_start_p;
+	ib_data_segment_t *ds_array_p, *ds_array_start_p = NULL;
 	struct ibv_send_wr wr;
 	struct ibv_send_wr *bad_wr;
 	ib_hca_transport_t *ibt_ptr = 
@@ -226,7 +226,7 @@ dapls_ib_post_send (
 
 	ret = ibv_post_send(ep_ptr->qp_handle->cm_id->qp, &wr, &bad_wr);
 
-	if (segments > DEFAULT_DS_ENTRIES)
+	if (ds_array_start_p != NULL)
 	    dapl_os_free(ds_array_start_p, segments * sizeof(ib_data_segment_t));
 
 	if (ret)
diff --git a/dapl/openib_scm/dapl_ib_dto.h b/dapl/openib_scm/dapl_ib_dto.h
index cede876..bea3e4d 100644
--- a/dapl/openib_scm/dapl_ib_dto.h
+++ b/dapl/openib_scm/dapl_ib_dto.h
@@ -67,7 +67,7 @@ dapls_ib_post_recv (
 	IN  DAT_LMR_TRIPLET	*local_iov )
 {
 	ib_data_segment_t	ds_array[DEFAULT_DS_ENTRIES];
-	ib_data_segment_t	*ds_array_p, *ds_array_start_p;
+	ib_data_segment_t	*ds_array_p, *ds_array_start_p = NULL;
 	struct ibv_recv_wr	wr;
 	struct ibv_recv_wr	*bad_wr;
 	DAT_COUNT		i, total_len;
@@ -116,7 +116,7 @@ dapls_ib_post_recv (
 
 	ret = ibv_post_recv(ep_ptr->qp_handle, &wr, &bad_wr);
 	
-	if (segments > DEFAULT_DS_ENTRIES)
+	if (ds_array_start_p != NULL)
 		dapl_os_free(ds_array_start_p, segments * sizeof(ib_data_segment_t));
 
 	if (ret)
@@ -147,7 +147,7 @@ dapls_ib_post_send (
 		      remote_iov, completion_flags);
 
 	ib_data_segment_t	ds_array[DEFAULT_DS_ENTRIES];
-	ib_data_segment_t	*ds_array_p, *ds_array_start_p;
+	ib_data_segment_t	*ds_array_p, *ds_array_start_p = NULL;
 	struct ibv_send_wr	wr;
 	struct ibv_send_wr	*bad_wr;
 	ib_hca_transport_t	*ibt_ptr = &ep_ptr->header.owner_ia->hca_ptr->ib_trans;
@@ -224,7 +224,7 @@ dapls_ib_post_send (
 
 	ret = ibv_post_send(ep_ptr->qp_handle, &wr, &bad_wr);
 	
-	if (segments > DEFAULT_DS_ENTRIES)
+	if (ds_array_start_p != NULL)
 		dapl_os_free(ds_array_start_p, segments * sizeof(ib_data_segment_t));
 
 	if (ret)




More information about the general mailing list