[ofa-general] [PATCH] opensm/osm_lin_fwd_tbl.c: Minor change to __osm_lin_tbl_compute_obj_size

Hal Rosenstock hrosenstock at xsigo.com
Wed Jun 11 08:55:39 PDT 2008


opensm/osm_lin_fwd_tbl.c: Minor change to __osm_lin_tbl_compute_obj_size

Change input parameter to be uint16_t r.t. uint32_6
Also, input parameter is really num_lids and not num_ports

Based on comments from Vincent Ficet <jean-vincent.ficet at bull.net>

Signed-off-by: Hal Rosenstock <hal at xsigo.com>

diff --git a/opensm/opensm/osm_lin_fwd_tbl.c b/opensm/opensm/osm_lin_fwd_tbl.c
index 5c969c7..7d1eeff 100644
--- a/opensm/opensm/osm_lin_fwd_tbl.c
+++ b/opensm/opensm/osm_lin_fwd_tbl.c
@@ -50,9 +50,9 @@
 #include <iba/ib_types.h>
 #include <opensm/osm_lin_fwd_tbl.h>
 
-static inline size_t __osm_lin_tbl_compute_obj_size(IN const uint32_t num_ports)
+static inline size_t __osm_lin_tbl_compute_obj_size(IN const uint16_t num_lids)
 {
-	return (sizeof(osm_lin_fwd_tbl_t) + (num_ports - 1));
+	return (sizeof(osm_lin_fwd_tbl_t) + (num_lids - 1));
 }
 
 /**********************************************************************
@@ -74,7 +74,7 @@ osm_lin_fwd_tbl_t *osm_lin_tbl_new(IN uint16_t const size)
 	 */
 	if (p_tbl != NULL) {
 		memset(p_tbl, OSM_NO_PATH, __osm_lin_tbl_compute_obj_size(size));
-		p_tbl->size = (uint16_t) size;
+		p_tbl->size = size;
 	}
 	return (p_tbl);
 }





More information about the general mailing list