From patchwork Thu Oct 1 19:25:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 51009 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n91JO7WG024153 for ; Thu, 1 Oct 2009 19:24:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752976AbZJATYB (ORCPT ); Thu, 1 Oct 2009 15:24:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754466AbZJATYB (ORCPT ); Thu, 1 Oct 2009 15:24:01 -0400 Received: from mail-ew0-f227.google.com ([209.85.219.227]:53522 "EHLO mail-ew0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752976AbZJATYA (ORCPT ); Thu, 1 Oct 2009 15:24:00 -0400 Received: by ewy27 with SMTP id 27so596681ewy.40 for ; Thu, 01 Oct 2009 12:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:mime-version:content-type:content-disposition :user-agent; bh=RZnWQuLj5uVndV8p5G5dlxQtw1+p9ljfRtSMFiXtO4I=; b=iOePAiScZn5nm5AhfClZwvuqkN+/jD3iOpNnjtlVVX7sT8CLmXszbP3s28jgZ8uJMJ uvEl85k3yZCpe3JZFWaDxw+CcLcdd1+I1HecSgDXCr1X84/N84Hyc4PIHBaWWIOiu3u/ 72U7cC8DvHRGZhUtQJ40VhsFkFYWiOlx/VJwA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=bk1YcIOeEJWRqTT4sH+WBL4QNNPeLWYut3mTEDxMWxKu+eQcEbjJpVYGOxEq/e7bzl J11MTFiiwcKAq0dBw2e2B8aXXBP3u0F+xTR7RHrnn9KmhAchPsLdYKesC79wTDOswFL/ 21l0yBlczKwxI1C28WsC6UYxx03UcamqKbcrU= Received: by 10.211.160.11 with SMTP id m11mr1878171ebo.79.1254425043195; Thu, 01 Oct 2009 12:24:03 -0700 (PDT) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id 24sm143619eyx.17.2009.10.01.12.23.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Oct 2009 12:24:00 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 659CB429E0; Thu, 1 Oct 2009 21:25:36 +0200 (IST) Date: Thu, 1 Oct 2009 21:25:36 +0200 From: Sasha Khapyorsky To: linux-rdma Cc: "Stan C. Smith" Subject: [PATCH] opensm: fix some obvious -Wsign-compare warnings Message-ID: <20091001192536.GY17846@me> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/opensm/main.c b/opensm/opensm/main.c index 36a0cc6..2e28c83 100644 --- a/opensm/opensm/main.c +++ b/opensm/opensm/main.c @@ -541,7 +541,7 @@ int main(int argc, char *argv[]) uint32_t temp, dbg_lvl; boolean_t run_once_flag = FALSE; int32_t vendor_debug = 0; - uint32_t next_option; + int next_option; char *conf_template = NULL, *config_file = NULL; uint32_t val; const char *const short_option = diff --git a/opensm/opensm/osm_console.c b/opensm/opensm/osm_console.c index d351261..db9a49d 100644 --- a/opensm/opensm/osm_console.c +++ b/opensm/opensm/osm_console.c @@ -492,7 +492,7 @@ static void logflush_parse(char **p_last, osm_opensm_t * p_osm, FILE * out) static void querylid_parse(char **p_last, osm_opensm_t * p_osm, FILE * out) { - int p = 0; + unsigned int p = 0; uint16_t lid = 0; osm_port_t *p_port = NULL; char *p_cmd = next_token(p_last); @@ -528,7 +528,7 @@ static void querylid_parse(char **p_last, osm_opensm_t * p_osm, FILE * out) p = 1; for ( /* see above */ ; p < p_port->p_node->physp_tbl_size; p++) { fprintf(out, - " Port %d health : %s\n", + " Port %u health : %s\n", p, p_port->p_node->physp_table[p]. healthy ? "OK" : "ERROR"); diff --git a/opensm/opensm/osm_helper.c b/opensm/opensm/osm_helper.c index ea9e21f..6b1f55f 100644 --- a/opensm/opensm/osm_helper.c +++ b/opensm/opensm/osm_helper.c @@ -442,7 +442,8 @@ static const char *__ib_sa_attr_str[] = { static int sprint_uint8_arr(char *buf, size_t size, const uint8_t * arr, size_t len) { - int i, n; + int n; + unsigned int i; for (i = 0, n = 0; i < len; i++) { n += snprintf(buf + n, size - n, "%s%u", i == 0 ? "" : ",", arr[i]); diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c index 6f51404..aaab91a 100644 --- a/opensm/opensm/osm_mcast_mgr.c +++ b/opensm/opensm/osm_mcast_mgr.c @@ -1004,7 +1004,7 @@ static int mcast_mgr_set_mftables(osm_sm_t * sm) osm_switch_t *p_sw; osm_mcast_tbl_t *p_tbl; int block_notdone, ret = 0; - int16_t block_num, max_block = -1; + uint16_t block_num, max_block = -1; p_sw = (osm_switch_t *) cl_qmap_head(p_sw_tbl); while (p_sw != (osm_switch_t *) cl_qmap_end(p_sw_tbl)) { diff --git a/opensm/opensm/osm_qos_parser_y.y b/opensm/opensm/osm_qos_parser_y.y index 571082b..7a2ce13 100644 --- a/opensm/opensm/osm_qos_parser_y.y +++ b/opensm/opensm/osm_qos_parser_y.y @@ -2394,7 +2394,7 @@ static void yyerror(const char *format, ...) static char * __parser_strip_white(char * str) { - int i; + unsigned int i; for (i = (strlen(str)-1); i >= 0; i--) { if (isspace(str[i])) diff --git a/opensm/opensm/osm_switch.c b/opensm/opensm/osm_switch.c index ce1ca63..8a83523 100644 --- a/opensm/opensm/osm_switch.c +++ b/opensm/opensm/osm_switch.c @@ -193,7 +193,7 @@ osm_switch_find_guid_common(IN const osm_switch_t * const p_sw, osm_node_t *p_rem_node; uint64_t sys_guid; uint64_t node_guid; - int i; + unsigned int i; CL_ASSERT(p_sw); @@ -406,7 +406,7 @@ osm_switch_recommend_path(IN const osm_switch_t * const p_sw, if (routing_for_lmc) { struct osm_remote_guids_count *r = p_port->priv; uint8_t rem_port = osm_physp_get_port_num(p_rem_physp); - int j; + unsigned int j; for (j = 0; j < r->count; j++) { p_remote_guid = &r->guids[j]; diff --git a/opensm/opensm/osm_ucast_ftree.c b/opensm/opensm/osm_ucast_ftree.c index 0ec0341..1defd95 100644 --- a/opensm/opensm/osm_ucast_ftree.c +++ b/opensm/opensm/osm_ucast_ftree.c @@ -2710,8 +2710,7 @@ static void fabric_route_to_cns(IN ftree_fabric_t * p_ftree) ftree_port_group_t *p_leaf_port_group; ftree_port_group_t *p_hca_port_group; ftree_port_t *p_port; - uint32_t i; - uint32_t j; + unsigned int i, j; uint16_t hca_lid; unsigned routed_targets_on_leaf; @@ -2788,10 +2787,9 @@ static void fabric_route_to_cns(IN ftree_fabric_t * p_ftree) "Routing %u dummy CAs\n", p_ftree->max_cn_per_leaf - p_sw->down_port_groups_num); - for (j = 0; - ((int)j) < - (p_ftree->max_cn_per_leaf - - routed_targets_on_leaf); j++) { + for (j = 0; j < + p_ftree->max_cn_per_leaf - routed_targets_on_leaf; + j++) { /* assign downgoing ports by stepping up */ fabric_route_downgoing_by_going_up(p_ftree, p_sw, /* local switch - used as a route-downgoing alg. start point */ NULL, /* prev. position switch */ diff --git a/opensm/opensm/osm_ucast_lash.c b/opensm/opensm/osm_ucast_lash.c index 63300b5..8b0a190 100644 --- a/opensm/opensm/osm_ucast_lash.c +++ b/opensm/opensm/osm_ucast_lash.c @@ -70,7 +70,7 @@ static void connect_switches(lash_t * p_lash, int sw1, int sw2, int phy_port_1) mesh_node_t *node = s1->node; switch_t *s2; link_t *l; - int i; + unsigned int i; /* * if doing mesh analysis: