[openib-general] [PATCH] [TRIVIAL] osm_req.c: Move assert before variable used

Hal Rosenstock halr at voltaire.com
Wed Nov 30 06:28:58 PST 2005


osm_req.c: Move assert before variable used
Also, added additional assert into osm_req_construct

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: osm_req.c
===================================================================
--- osm_req.c	(revision 4237)
+++ osm_req.c	(working copy)
@@ -74,6 +74,8 @@ void
 osm_req_construct(
   IN osm_req_t* const p_req )
 {
+  CL_ASSERT( p_req );
+
   cl_memclr( p_req, sizeof(*p_req) );
 }
 
@@ -129,9 +131,10 @@ osm_req_get(
   ib_api_status_t status = IB_SUCCESS;
   ib_net64_t tid;
 
+  CL_ASSERT( p_req );
+
   OSM_LOG_ENTER( p_req->p_log, osm_req_get );
 
-  CL_ASSERT( p_req );
   CL_ASSERT( p_path );
   CL_ASSERT( attr_id );
 
@@ -219,9 +222,10 @@ osm_req_set(
   ib_api_status_t status = IB_SUCCESS;
   ib_net64_t tid;
 
+  CL_ASSERT( p_req );
+
   OSM_LOG_ENTER( p_req->p_log, osm_req_set );
 
-  CL_ASSERT( p_req );
   CL_ASSERT( p_path );
   CL_ASSERT( attr_id );
   CL_ASSERT( p_payload );
@@ -295,7 +299,3 @@ osm_req_set(
   return( status );
 }
 
-
-
-
-






More information about the general mailing list