diff options
author | hselasky <hselasky@FreeBSD.org> | 2015-01-11 14:36:26 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2015-01-11 14:36:26 +0000 |
commit | a1a2ff06ed1553abade4ff3177c6472983b79ba6 (patch) | |
tree | a933423f09cef9a3043bf429550d75c590d7b9c9 /contrib | |
parent | 490d9ace1ccb7218cb51040995c3ebb60e1de3e1 (diff) | |
download | FreeBSD-src-a1a2ff06ed1553abade4ff3177c6472983b79ba6.zip FreeBSD-src-a1a2ff06ed1553abade4ff3177c6472983b79ba6.tar.gz |
MFC r276815:
Fix for compilation issue. Don't use the "abs()" function for unsigned
computations.
PR: 196597
Sponsored by: Mellanox Technologies
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c b/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c index aa51d23..88a8c7b 100644 --- a/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c +++ b/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c @@ -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_sw_ports(IN ftree_fabric_t * p_ftree, 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" |