Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2015 10:13:57 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r276815 - head/contrib/ofed/management/opensm/opensm
Message-ID:  <201501081013.t08ADvB6083611@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Jan  8 10:13:56 2015
New Revision: 276815
URL: https://svnweb.freebsd.org/changeset/base/276815

Log:
  Fix for compilation issue. Don't use the "abs()" function for unsigned
  computations.
  
  MFC after:	3 days
  PR:		196597
  Sponsored by:	Mellanox Technologies

Modified:
  head/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c

Modified: head/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c
==============================================================================
--- head/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c	Thu Jan  8 07:47:39 2015	(r276814)
+++ head/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c	Thu Jan  8 10:13:56 2015	(r276815)
@@ -2917,6 +2917,10 @@ Exit:
 
 /***************************************************
  ***************************************************/
+static boolean_t __osm_invalid_link_rank_diff(const uint32_t val)
+{
+	return (val != 1U && val != -1U);
+}
 
 static int __osm_ftree_fabric_construct_sw_ports(IN ftree_fabric_t * p_ftree,
 						 IN ftree_sw_t * p_sw)
@@ -2993,7 +2997,7 @@ static int __osm_ftree_fabric_construct_
 
 			p_remote_hca_or_sw = (void *)p_remote_sw;
 
-			if (abs(p_sw->rank - p_remote_sw->rank) != 1) {
+			if (__osm_invalid_link_rank_diff(p_sw->rank - p_remote_sw->rank)) {
 				OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_ERROR,
 					"ERR AB16: "
 					"Illegal link between switches with ranks %u and %u:\n"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501081013.t08ADvB6083611>