[openib-general] [PATCH] ib_mad.c: Reimplement convert_mgmt_class function

Hal Rosenstock halr at voltaire.com
Fri Sep 10 15:29:07 PDT 2004


[PATCH] ib_mad.c: Reimplement convert_mgmt_class function

Index: ib_mad.c
===================================================================
--- ib_mad.c	(revision 771)
+++ ib_mad.c	(working copy)
@@ -105,6 +105,7 @@
 static void remove_mad_reg_req(struct ib_mad_agent_private *priv); 
 static int ib_mad_port_restart(struct ib_mad_port_private *priv);
 static int ib_mad_post_receive_mads(struct ib_mad_port_private *priv);
+static inline u8 convert_mgmt_class(struct ib_mad_reg_req
*mad_reg_req);
 
 
 /*
@@ -385,17 +386,11 @@
 }
 EXPORT_SYMBOL(ib_mad_post_send);
 
-static u8 convert_mgmt_class(struct ib_mad_reg_req *mad_reg_req)
+static inline u8 convert_mgmt_class(struct ib_mad_reg_req *mad_reg_req)
 {
-	u8 mgmt_class;
-
 	/* Alias IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE to 0 */
-	if (mad_reg_req->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
-		mgmt_class = 0;
-	} else {
-		mgmt_class = mad_reg_req->mgmt_class;
-	}
-	return mgmt_class;
+	return mad_reg_req->mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE ?
+		0 : mad_reg_req->mgmt_class;
 }
 
 static int is_method_in_use(struct ib_mad_mgmt_method_table **method,





More information about the general mailing list