Hi,

In the file opensm/osm_state_mgr.c, function __osm_state_mgr_get_remote_port_info(), we have the following code:

mad_context.pi_context.port_guid = cl_hton64(osm_physp_get_port_num(p_physp));

The port_guid's type is ib_net64_t, which is OK w.r.t cl_hton64 type cast.

However, the osm_physp_get_port_num() function in include/opensm/osm_port.h is implemented as follows:

static inline uint8_t
osm_physp_get_port_num(IN const osm_physp_t * const p_physp)
{
  CL_ASSERT(p_physp);
  CL_ASSERT(osm_physp_is_valid(p_physp));
  return (p_physp->port_num);
}

And the port_num field in the osm_physp_t is declared as an uint8_t.

Am I right in saying that feeding a port number into mad_context.pi_context.port_guid is incorrect ? If so, the cl_hton64 type cast is hiding the compiler warning ;-)

Thanks,

Vincent
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to