[openib-general] [PATCH] minor optimization to solicited_mad check
Sean Hefty
mshefty at ichips.intel.com
Fri Sep 24 10:40:20 PDT 2004
Minor patch to remove a branch, jump, and stack variable.
Index: ib_mad.c
===================================================================
--- ib_mad.c (revision 880)
+++ ib_mad.c (working copy)
@@ -584,30 +584,22 @@
static int response_mad(struct ib_mad *mad)
{
/* Trap represses are responses although response bit is reset */
- if ((mad->mad_hdr.method == IB_MGMT_METHOD_TRAP_REPRESS) ||
- (mad->mad_hdr.method & IB_MGMT_METHOD_RESP)) {
- return 1;
- }
- return 0;
+ return ((mad->mad_hdr.method == IB_MGMT_METHOD_TRAP_REPRESS) ||
+ (mad->mad_hdr.method & IB_MGMT_METHOD_RESP));
}
static int solicited_mad(struct ib_mad *mad)
{
- int solicited = 0;
-
/* CM MADs are never solicited */
if (mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_CM) {
- goto ret;
+ return 0;
}
/* Determine whether MAD is using RMPP !!! */
/* Not using RMPP */
/* Is this MAD a response to a previous MAD ? */
- solicited = response_mad(mad);
-
-ret:
- return solicited;
+ return response_mad(mad);
}
static struct ib_mad_agent_private *find_mad_agent(struct ib_mad_port_private *port_priv,
--
More information about the general
mailing list