/* Returns a ib_mad_port_private structure or NULL for a device/port Assumes ib_mad_port_list_lock is being held  */
static struct ib_mad_port_private* __ib_get_mad_port(struct ib_device *device, int port_num)
/* Returns a ib_mad_port_private structure or NULL for a device/port Assumes ib_mad_port_list_lock is being held  */
static struct ib_mad_port_private* __ib_get_mad_port(struct ib_device *device, int port_num)
{
	struct ib_mad_port_private *entry;
	list_for_each_entry(entry, &ib_mad_port_list, port_list) {
		if (entry->device == device && entry->port_num == port_num)
			return entry;
	}
	return NULL;
}