From owner-svn-src-stable-10@FreeBSD.ORG Sun Jan 11 14:36:27 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C501CD8C; Sun, 11 Jan 2015 14:36:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFA2B9D2; Sun, 11 Jan 2015 14:36:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0BEaRhu059742; Sun, 11 Jan 2015 14:36:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0BEaRDL059741; Sun, 11 Jan 2015 14:36:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201501111436.t0BEaRDL059741@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 11 Jan 2015 14:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276979 - stable/10/contrib/ofed/management/opensm/opensm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2015 14:36:27 -0000 Author: hselasky Date: Sun Jan 11 14:36:26 2015 New Revision: 276979 URL: https://svnweb.freebsd.org/changeset/base/276979 Log: MFC r276815: Fix for compilation issue. Don't use the "abs()" function for unsigned computations. PR: 196597 Sponsored by: Mellanox Technologies Modified: stable/10/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c ============================================================================== --- stable/10/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c Sun Jan 11 14:33:16 2015 (r276978) +++ stable/10/contrib/ofed/management/opensm/opensm/osm_ucast_ftree.c Sun Jan 11 14:36:26 2015 (r276979) @@ -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"