diff mbox

[1/3] opensm/osm_torus.c: Consolidate some parsing with parse_unsigned

Message ID 50EB26FF.5080507@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock Jan. 7, 2013, 7:50 p.m. UTC
Signed-off-by: Jim Schutt <jaschut@sandia.gov>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Alex Netes Jan. 30, 2013, 5:46 p.m. UTC | #1
Hi Hal,

On 14:50 Mon 07 Jan     , Hal Rosenstock wrote:
> 
> Signed-off-by: Jim Schutt <jaschut@sandia.gov>
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---

Applied the series. Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c
index 1d847b3..ff83edb 100644
--- a/opensm/osm_torus.c
+++ b/opensm/osm_torus.c
@@ -853,14 +853,14 @@  out:
 }
 
 static
-bool parse_port(unsigned *pnum, const char *parse_sep)
+bool parse_unsigned(unsigned *result, const char *parse_sep)
 {
 	char *val, *nextchar;
 
 	val = strtok(NULL, parse_sep);
 	if (!val)
 		return false;
-	*pnum = strtoul(val, &nextchar, 0);
+	*result = strtoul(val, &nextchar, 0);
 	return true;
 }
 
@@ -870,7 +870,7 @@  bool parse_port_order(struct torus *t, unsigned port_order[], const char *parse_
 	unsigned i, j, k, n;
 
 	for (i = 0; i < ARRAY_SIZE(port_order); i++) {
-		if (!parse_port(&(port_order[i]), parse_sep))
+		if (!parse_unsigned(&(port_order[i]), parse_sep))
 			break;
 
 		for (j = 0; j < i; j++) {
@@ -898,18 +898,6 @@  bool parse_port_order(struct torus *t, unsigned port_order[], const char *parse_
 }
 
 static
-bool parse_pg_max_ports(struct torus *t, const char *parse_sep)
-{
-	char *val, *nextchar;
-
-	val = strtok(NULL, parse_sep);
-	if (!val)
-		return false;
-	t->portgrp_sz = strtoul(val, &nextchar, 0);
-	return true;
-}
-
-static
 bool parse_guid(struct torus *t, guid_t *guid, const char *parse_sep)
 {
 	char *val;
@@ -1094,7 +1082,7 @@  next_line:
 		kw_success = grow_seed_array(t, 1);
 		t->seed_cnt++;
 	} else if (strcmp("portgroup_max_ports", keyword) == 0) {
-		kw_success = parse_pg_max_ports(t, parse_sep);
+		kw_success = parse_unsigned(&t->portgrp_sz, parse_sep);
 	} else if (strcmp("xp_link", keyword) == 0) {
 		if (!t->seed_cnt)
 			t->seed_cnt++;