[openib-general] [PATCH] OpenSM: osm_sminfo_rcv.c: Eliminate some redundant checks

Hal Rosenstock halr at voltaire.com
Fri Jun 3 10:46:29 PDT 2005


osm_sminfo_rcv.c: Eliminate some redundant checks

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

Index: osm_sminfo_rcv.c
===================================================================
--- osm_sminfo_rcv.c	(revision 2538)
+++ osm_sminfo_rcv.c	(working copy)
@@ -160,14 +160,7 @@
 
   p_smp = osm_madw_get_smp_ptr( p_madw );
 
-  if( p_smp->method != IB_MAD_METHOD_GET )
-  {
-    osm_log( p_rcv->p_log, OSM_LOG_ERROR,
-             "__osm_sminfo_rcv_process_get_request: ERR 2F01: "
-             "Unsupported method 0x%X.\n",
-             p_smp->method );
-    goto Exit;
-  }
+  CL_ASSERT( p_smp->method == IB_MAD_METHOD_GET );
 
   p_smi->guid = p_rcv->p_subn->sm_port_guid;
   p_smi->act_count = cl_hton32( p_rcv->p_stats->qp0_mads_sent );
@@ -272,21 +265,13 @@
   */
   cl_memclr( payload, sizeof( payload ) );
 
-  /*  get the lock */
+  /* get the lock */
   CL_PLOCK_EXCL_ACQUIRE( p_rcv->p_lock );
 
   p_smp = osm_madw_get_smp_ptr( p_madw );
   p_rcv_smi = ib_smp_get_payload_ptr( p_smp );
 
-  if( p_smp->method != IB_MAD_METHOD_SET )
-  {
-    osm_log( p_rcv->p_log, OSM_LOG_ERROR,
-             "__osm_sminfo_rcv_process_set_request: ERR 2F03: "
-             "Unsupported method 0x%X.\n",
-             p_smp->method );
-    CL_PLOCK_RELEASE( p_rcv->p_lock );
-    goto Exit;
-  }
+  CL_ASSERT( p_smp->method == IB_MAD_METHOD_SET );
 
   p_smi->guid = p_rcv->p_subn->sm_port_guid;
   p_smi->act_count = cl_hton32( p_rcv->p_stats->qp0_mads_sent );






More information about the general mailing list