[openib-general] [PATCH][1/3] Make convert_mgmt_class() really inline

Roland Dreier roland at topspin.com
Sun Oct 24 21:27:40 PDT 2004


Because the first declaration of convert_mgmt_class() had no body, gcc
doesn't actually inline the function.  Fix that by moving the body
before the first use of the function.

Index: linux-kernel/infiniband/core/ib_mad.c
===================================================================
--- linux-kernel.orig/infiniband/core/ib_mad.c	2004-10-24 20:04:11.000000000 -0700
+++ linux-kernel/infiniband/core/ib_mad.c	2004-10-24 20:31:30.000000000 -0700
@@ -84,7 +84,6 @@
 static int ib_mad_post_receive_mad(struct ib_mad_port_private *port_priv,
 				   struct ib_qp *qp);
 static int ib_mad_post_receive_mads(struct ib_mad_port_private *priv);
-static inline u8 convert_mgmt_class(u8 mgmt_class);
 static void cancel_mads(struct ib_mad_agent_private *mad_agent_priv);
 static void ib_mad_complete_send_wr(struct ib_mad_send_wr_private *mad_send_wr,
 				    struct ib_mad_send_wc *mad_send_wc);
@@ -123,6 +122,14 @@
 
 	return entry;
 }
+
+static inline u8 convert_mgmt_class(u8 mgmt_class)
+{
+	/* Alias IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE to 0 */
+	return mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE ?
+		0 : mgmt_class;
+}
+
 /*
  * ib_register_mad_agent - Register to send/receive MADs
  */
@@ -497,13 +504,6 @@
 }
 EXPORT_SYMBOL(ib_process_mad_wc);
 
-static inline u8 convert_mgmt_class(u8 mgmt_class)
-{
-	/* Alias IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE to 0 */
-	return mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE ?
-		0 : mgmt_class;
-}
-
 static int method_in_use(struct ib_mad_mgmt_method_table **method,
 			 struct ib_mad_reg_req *mad_reg_req)
 {




More information about the general mailing list