[ofa-general] ***SPAM*** [PATCH] ibsim: Eliminate unneeded argument in sim_client_init
hnrose at comcast.net
hnrose at comcast.net
Sat Feb 14 12:35:03 PST 2009
Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>
---
umad2sim/sim_client.c | 14 ++++++++------
umad2sim/sim_client.h | 2 +-
umad2sim/umad2sim.c | 3 +--
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/umad2sim/sim_client.c b/umad2sim/sim_client.c
index d86de7c..3fffd24 100644
--- a/umad2sim/sim_client.c
+++ b/umad2sim/sim_client.c
@@ -284,19 +284,21 @@ int sim_client_set_sm(struct sim_client *sc, unsigned issm)
return sim_ctl(sc, SIM_CTL_SET_ISSM, &issm, sizeof(int));
}
-int sim_client_init(struct sim_client *sc, char *nodeid)
+int sim_client_init(struct sim_client *sc)
{
- if (!nodeid)
- nodeid = getenv("SIM_HOST");
+ char *nodeid;
+
+ nodeid = getenv("SIM_HOST");
if (sim_init(sc, 0, nodeid) < 0)
return -1;
- if (sim_ctl(sc, SIM_CTL_GET_VENDOR, &sc->vendor, sizeof(sc->vendor)) <
- 0)
+ if (sim_ctl(sc, SIM_CTL_GET_VENDOR, &sc->vendor,
+ sizeof(sc->vendor)) < 0)
goto _exit;
if (sim_ctl(sc, SIM_CTL_GET_NODEINFO, sc->nodeinfo,
sizeof(sc->nodeinfo)) < 0)
goto _exit;
- sc->portinfo[0] = 0;
+
+ sc->portinfo[0] = 0; // portno requested
if (sim_ctl(sc, SIM_CTL_GET_PORTINFO, sc->portinfo,
sizeof(sc->portinfo)) < 0)
goto _exit;
diff --git a/umad2sim/sim_client.h b/umad2sim/sim_client.h
index 605b305..80ed442 100644
--- a/umad2sim/sim_client.h
+++ b/umad2sim/sim_client.h
@@ -47,7 +47,7 @@ struct sim_client {
};
extern int sim_client_set_sm(struct sim_client *sc, unsigned issm);
-extern int sim_client_init(struct sim_client *sc, char *nodeid);
+extern int sim_client_init(struct sim_client *sc);
extern void sim_client_exit(struct sim_client *sc);
#endif /* _SIM_CLIENT_H_ */
diff --git a/umad2sim/umad2sim.c b/umad2sim/umad2sim.c
index 1236b8f..8d83a24 100644
--- a/umad2sim/umad2sim.c
+++ b/umad2sim/umad2sim.c
@@ -53,7 +53,6 @@
#include <infiniband/umad.h>
#include <infiniband/mad.h>
-#include <ibsim.h>
#include <sim_client.h>
#ifdef UMAD2SIM_NOISY_DEBUG
@@ -562,7 +561,7 @@ static struct umad2sim_dev *umad2sim_dev_create(unsigned num, const char *name)
dev->num = num;
strncpy(dev->name, name, sizeof(dev->name) - 1);
- if (sim_client_init(&dev->sim_client, NULL) < 0)
+ if (sim_client_init(&dev->sim_client) < 0)
goto _error;
dev->port = mad_get_field(&dev->sim_client.portinfo, 0,
--
1.5.6.4
More information about the general
mailing list