[openib-general] [PATCH TRIVIAL] diags: strip trailing whitespaces
Sasha Khapyorsky
sashak at voltaire.com
Thu Nov 2 05:04:32 PST 2006
Strip trailing whitespaces in diags.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
diags/src/grouping.c | 60 ++++++++++++++++++++++----------------------
diags/src/ibaddr.c | 2 +-
diags/src/ibnetdiscover.c | 12 ++++----
diags/src/ibping.c | 2 +-
diags/src/ibportstate.c | 2 +-
diags/src/ibroute.c | 4 +-
diags/src/ibsysstat.c | 4 +-
diags/src/ibtracert.c | 24 +++++++++---------
diags/src/saquery.c | 2 +-
diags/src/smpdump.c | 6 ++--
diags/src/smpquery.c | 4 +-
11 files changed, 61 insertions(+), 61 deletions(-)
diff --git a/diags/src/grouping.c b/diags/src/grouping.c
index fbca4e0..09ac10a 100644
--- a/diags/src/grouping.c
+++ b/diags/src/grouping.c
@@ -77,7 +77,7 @@ char *get_chassis_slot(unsigned char cha
return ChassisSlotStr[chassisslot];
}
-static struct ChassisList *find_chassisnum(unsigned char chassisnum)
+static struct ChassisList *find_chassisnum(unsigned char chassisnum)
{
ChassisList *current;
@@ -192,7 +192,7 @@ int anafa_spine4_slot_2_slb[25] = { 0, 1
static void get_sfb_slot(Node *node, Port *lineport)
{
ChassisRecord *ch = node->chrecord;
-
+
ch->chassisslot = SPINE_CS;
if (is_spine_9096(node)) {
ch->chassistype = ISR9096_CT;
@@ -210,7 +210,7 @@ static void get_router_slot(Node *node,
ChassisRecord *ch = node->chrecord;
int guessnum = 0;
- if (!ch) {
+ if (!ch) {
if (!(node->chrecord = calloc(1, sizeof(ChassisRecord))))
IBPANIC("out of mem");
ch = node->chrecord;
@@ -229,7 +229,7 @@ static void get_router_slot(Node *node,
/* module 1 <--> remote anafa 3 */
/* module 2 <--> remote anafa 2 */
/* module 3 <--> remote anafa 1 */
- ch->anafanum = (guessnum == 3 ? 1 : (guessnum == 1 ? 3 : 2));
+ ch->anafanum = (guessnum == 3 ? 1 : (guessnum == 1 ? 3 : 2));
}
}
@@ -260,7 +260,7 @@ static void fill_chassis_record(Node *no
if (node->chrecord) /* somehow this node has already been passed */
return;
-
+
if (!(node->chrecord = calloc(1, sizeof(ChassisRecord))))
IBPANIC("out of mem");
@@ -285,7 +285,7 @@ static void fill_chassis_record(Node *no
/* we assume here that remoteport belongs to line */
get_sfb_slot(node, port->remoteport);
- /* we could break here, but need to find if more routers connected */
+ /* we could break here, but need to find if more routers connected */
}
} else if (is_line(node)) {
@@ -307,7 +307,7 @@ static int get_line_index(Node *node)
{
int retval = 3 * (node->chrecord->slotnum - 1) + node->chrecord->anafanum;
- if (retval > LINES_MAX_NUM || retval < 1)
+ if (retval > LINES_MAX_NUM || retval < 1)
IBPANIC("Grouping: Internal error");
return retval;
}
@@ -319,9 +319,9 @@ static int get_spine_index(Node *node)
if (is_spine_9288(node))
retval = 3 * (node->chrecord->slotnum - 1) + node->chrecord->anafanum;
else
- retval = node->chrecord->slotnum;
+ retval = node->chrecord->slotnum;
- if (retval > SPINES_MAX_NUM || retval < 1)
+ if (retval > SPINES_MAX_NUM || retval < 1)
IBPANIC("Grouping: Internal error");
return retval;
}
@@ -330,7 +330,7 @@ static void insert_line_router(Node *nod
{
int i = get_line_index(node);
- if (chassislist->linenode[i])
+ if (chassislist->linenode[i])
return; /* already filled slot */
chassislist->linenode[i] = node;
@@ -357,7 +357,7 @@ static void pass_on_lines_catch_spines(C
for (i = 1; i <= LINES_MAX_NUM; i++) {
node = chassislist->linenode[i];
- if (!(node && is_line(node)))
+ if (!(node && is_line(node)))
continue; /* empty slot or router */
for (port = node->ports; port; port = port->next) {
@@ -383,7 +383,7 @@ static void pass_on_spines_catch_lines(C
for (i = 1; i <= SPINES_MAX_NUM; i++) {
node = chassislist->spinenode[i];
- if (!node)
+ if (!node)
continue; /* empty slot */
for (port = node->ports; port; port = port->next) {
if (!port->remoteport)
@@ -399,34 +399,34 @@ static void pass_on_spines_catch_lines(C
/*
Stupid interpolation algorithm...
- But nothing to do - have to be compliant with VoltaireSM/NMS
+ But nothing to do - have to be compliant with VoltaireSM/NMS
*/
static void pass_on_spines_interpolate_chguid(ChassisList *chassislist)
{
Node *node;
int i;
-
+
for (i = 1; i <= SPINES_MAX_NUM; i++) {
node = chassislist->spinenode[i];
- if (!node)
+ if (!node)
continue; /* skip the empty slots */
/* take first guid less one: consistent with SM... */
chassislist->chassisguid = node->nodeguid - 1;
break;
}
-}
+}
/*
This function fills chassislist structure with all nodes
- in that chassis
+ in that chassis
chassislist structure = structure of one standalone chassis
*/
static void build_chassis(Node *node, ChassisList *chassislist)
{
Node *remnode = 0;
Port *port = 0;
-
+
/* we get here with node = chassis_spine */
chassislist->chassistype = node->chrecord->chassistype;
insert_spine(node, chassislist);
@@ -442,12 +442,12 @@ static void build_chassis(Node *node, Ch
insert_line_router(remnode, chassislist);
}
-
+
pass_on_lines_catch_spines(chassislist);
/* this pass needed for to catch routers, since routers connected only */
/* to spines in slot 1 or 4 and we could miss them first time */
pass_on_spines_catch_lines(chassislist);
-
+
/* additional 2 passes needed for to overcome a problem of pure "in-chassis" */
/* connectivity - extra pass to ensure that all related chips/modules */
/* inserted into the chassislist */
@@ -465,8 +465,8 @@ Description : On ISR9288/9096 external p
is not matching the internal ( anafa ) port
indexes. Use this MAP to translate the data you get from
the OpenIB diagnostics (smpquery, ibroute, ibtracert, etc.)
-
-
+
+
Module : sLB-24
anafa 1 anafa 2
ext port | 13 14 15 16 17 18 | 19 20 21 22 23 24
@@ -474,14 +474,14 @@ int port | 22 23 24 18 17 16 | 22 23 24
ext port | 1 2 3 4 5 6 | 7 8 9 10 11 12
int port | 19 20 21 15 14 13 | 19 20 21 15 14 13
------------------------------------------------
-
+
Module : sLB-8
anafa 1 anafa 2
ext port | 13 14 15 16 17 18 | 19 20 21 22 23 24
int port | 24 23 22 18 17 16 | 24 23 22 18 17 16
ext port | 1 2 3 4 5 6 | 7 8 9 10 11 12
int port | 21 20 19 15 14 13 | 21 20 19 15 14 13
-
+
----------->
anafa 1 anafa 2
ext port | - - 5 - - 6 | - - 7 - - 8
@@ -492,7 +492,7 @@ int port | 21 20 19 15 14 13 | 21 20 19
*/
-int int2ext_map_slb24[2][25] = {
+int int2ext_map_slb24[2][25] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 5, 4, 18, 17, 16, 1, 2, 3, 13, 14, 15 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 11, 10, 24, 23, 22, 7, 8, 9, 19, 20, 21 }
};
@@ -504,7 +504,7 @@ int int2ext_map_slb8[2][25] = {
/*
This function relevant only for line modules/chips
- Returns string with external port index
+ Returns string with external port index
*/
char *portmapstring(Port *port)
{
@@ -522,11 +522,11 @@ char *portmapstring(Port *port)
return NULL;
memset(mapping, 0, sizeof(mapping));
-
+
chipnum = ch->anafanum - 1;
if (is_line_24(node))
- pindex = int2ext_map_slb24[chipnum][portnum];
+ pindex = int2ext_map_slb24[chipnum][portnum];
else
pindex = int2ext_map_slb8[chipnum][portnum];
@@ -550,7 +550,7 @@ static void add_chassislist()
}
}
-/*
+/*
Main grouping function
Algorithm:
1. pass on every Voltaire node
@@ -571,7 +571,7 @@ void group_nodes()
mylist.current = NULL;
mylist.last = NULL;
- /* first pass on switches and build for every Voltaire node */
+ /* first pass on switches and build for every Voltaire node */
/* an appropriate chassis record (slotnum and position) */
/* according to internal connectivity */
/* not very efficient but clear code so... */
diff --git a/diags/src/ibaddr.c b/diags/src/ibaddr.c
index 25f9229..66ef71a 100644
--- a/diags/src/ibaddr.c
+++ b/diags/src/ibaddr.c
@@ -80,7 +80,7 @@ ib_resolve_addr(ib_portid_t *portid, int
char buf1[64], buf2[64];
ib_gid_t gid;
int lmc;
-
+
if (!smp_query(nodeinfo, portid, IB_ATTR_NODE_INFO, 0, 0))
return -1;
diff --git a/diags/src/ibnetdiscover.c b/diags/src/ibnetdiscover.c
index dac17d5..c6e35e4 100644
--- a/diags/src/ibnetdiscover.c
+++ b/diags/src/ibnetdiscover.c
@@ -200,7 +200,7 @@ clean_nodedesc(char *nodedesc)
nodedesc[63] = '\0';
for (i = 0; i < 64; i++) {
if (iscntrl(nodedesc[i]) || nodedesc[i] == '\0') {
- nodedesc[i] = '\0';
+ nodedesc[i] = '\0';
break;
}
}
@@ -215,7 +215,7 @@ dump_endnode(ib_portid_t *path, char *pr
#if __WORDSIZE == 64
fprintf(f, "%s -> %s %s {%016lx} portnum %d lid %d-%d\"%s\"\n",
- portid2str(path), prompt,
+ portid2str(path), prompt,
(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
node->nodeguid, node->type == SWITCH_NODE ? 0 : port->portnum,
port->lid, port->lid + (1 << port->lmc) - 1,
@@ -418,10 +418,10 @@ discover(ib_portid_t *from)
for (i = 1; i <= node->numports; i++) {
if (i == node->localport)
continue;
-
+
if (!(port = calloc(1, sizeof(Port))))
IBERROR("out of memory");
-
+
if (get_port(port, i, path) < 0) {
IBWARN("can't reach node %s port %d", portid2str(path), i);
return 0;
@@ -696,7 +696,7 @@ dump_topology(int listtype, int group)
DEBUG("SWITCH: dist %d node %p", dist, node);
/* Now, skip chassis based switches */
if (node->chrecord)
- if (node->chrecord->chassisnum)
+ if (node->chrecord->chassisnum)
continue;
out_switch(node, group);
@@ -731,7 +731,7 @@ dump_topology(int listtype, int group)
void
usage(void)
-{
+{
fprintf(stderr, "Usage: %s [-d(ebug)] -e(rr_show) -v(erbose) -s(how) -l(ist) -g(rouping) -H(ca_list) -S(witch_list) -V(ersion) -C ca_name -P ca_port "
"-t(imeout) timeout_ms] [<topology-file>]\n",
argv0);
diff --git a/diags/src/ibping.c b/diags/src/ibping.c
index 6b1c8a3..98f9bef 100644
--- a/diags/src/ibping.c
+++ b/diags/src/ibping.c
@@ -323,7 +323,7 @@ main(int argc, char **argv)
if (!argc && !server)
usage();
-
+
madrpc_init(ca, ca_port, mgmt_classes, 3);
if (server) {
diff --git a/diags/src/ibportstate.c b/diags/src/ibportstate.c
index 1af87c7..b8f6f4d 100644
--- a/diags/src/ibportstate.c
+++ b/diags/src/ibportstate.c
@@ -119,7 +119,7 @@ get_port_info(ib_portid_t *dest, uint8_t
return 0;
}
-static int
+static int
set_port_info(ib_portid_t *dest, uint8_t *data, int portnum, int port_op)
{
char buf[2048];
diff --git a/diags/src/ibroute.c b/diags/src/ibroute.c
index 4fb334d..21be3f3 100644
--- a/diags/src/ibroute.c
+++ b/diags/src/ibroute.c
@@ -187,7 +187,7 @@ dump_multicast_tables(ib_portid_t *porti
IBWARN("illegal start mlid %x, set to %x", startlid, IB_MIN_MCAST_LID);
startlid = IB_MIN_MCAST_LID;
}
-
+
if (endlid > IB_MAX_MCAST_LID) {
IBWARN("illegal end mlid %x, truncate to %x", endlid, IB_MAX_MCAST_LID);
endlid = IB_MAX_MCAST_LID;
@@ -333,7 +333,7 @@ dump_unicast_tables(ib_portid_t *portid,
if (!endlid || endlid > top)
endlid = top;
-
+
if (endlid > IB_MAX_UCAST_LID) {
IBWARN("ilegal lft top %d, truncate to %d", endlid, IB_MAX_UCAST_LID);
endlid = IB_MAX_UCAST_LID;
diff --git a/diags/src/ibsysstat.c b/diags/src/ibsysstat.c
index f7ff994..489e0f9 100644
--- a/diags/src/ibsysstat.c
+++ b/diags/src/ibsysstat.c
@@ -174,7 +174,7 @@ match_attr(char *str)
return IB_CPUINFO_ATTR;
return -1;
}
-
+
static char *
ibsystat(ib_portid_t *portid, int attr)
{
@@ -361,7 +361,7 @@ main(int argc, char **argv)
if (mad_register_client(sysstat_class, 0) < 0)
IBERROR("can't register to sysstat class %d", sysstat_class);
-
+
if (ib_resolve_portid_str(&portid, argv[0], dest_type, sm_id) < 0)
IBERROR("can't resolve destination port %s", argv[0]);
diff --git a/diags/src/ibtracert.c b/diags/src/ibtracert.c
index 0400f34..64dbe00 100644
--- a/diags/src/ibtracert.c
+++ b/diags/src/ibtracert.c
@@ -368,15 +368,15 @@ find_route(ib_portid_t *from, ib_portid_
dump_endnode(dump, "To", node, port);
return 0;
-badport:
+badport:
IBWARN("Bad port state found: node \"%s\" port %d state %d",
node->nodedesc, portnum, port->state);
return -1;
-badoutport:
+badoutport:
IBWARN("Bad out port state found: node \"%s\" outport %d state %d",
node->nodedesc, outport, port->state);
return -1;
-badtbl:
+badtbl:
IBWARN("Bad forwarding table entry found at: node \"%s\" lid entry %d is %d (top %d)",
node->nodedesc, to, outport, sw.linearFDBtop);
return -1;
@@ -476,7 +476,7 @@ switch_mclookup(Node *node, ib_portid_t
int maxsets, block, i, set;
memset(map, 0, 256);
-
+
if (!smp_query(si, portid, IB_ATTR_SWITCH_INFO, 0, timeout))
return -1;
@@ -499,7 +499,7 @@ switch_mclookup(Node *node, ib_portid_t
uint16_t mask = ntohs(msets[mlid % 32]);
if (mask & (1 << i))
*map = 1;
- else
+ else
continue;
VERBOSE("Switch guid 0x%Lx: mlid 0x%x is forwarded to port %d",
node->nodeguid, mlid + 0xc000, i + set * 16);
@@ -583,19 +583,19 @@ find_mcpath(ib_portid_t *from, int mlid)
for (i = 1; i <= node->numports; i++) {
if (!map[i] || i == node->upport)
continue;
-
+
if (dist == 0 && leafport) {
if (from->drpath.cnt > 0)
path->drpath.cnt--;
} else {
if (!(port = calloc(1, sizeof(Port))))
IBERROR("out of memory");
-
+
if (get_port(port, i, path) < 0) {
IBWARN("can't reach node %s port %d", portid2str(path), i);
return 0;
}
-
+
if (port->physstate != 5) { /* LinkUP */
free(port);
continue;
@@ -608,13 +608,13 @@ find_mcpath(ib_portid_t *from, int mlid)
if (extend_dpath(&path->drpath, i) < 0)
return 0;
}
-
+
if (!(remotenode = calloc(1, sizeof(Node))))
IBERROR("out of memory");
if (!(remoteport = calloc(1, sizeof(Port))))
IBERROR("out of memory");
-
+
if (get_node(remotenode, remoteport, path) < 0) {
IBWARN("NodeInfo on %s port %d failed, skipping port",
portid2str(path), i);
@@ -623,7 +623,7 @@ find_mcpath(ib_portid_t *from, int mlid)
free(remoteport);
continue;
}
-
+
remotenode->upnode = node;
remotenode->upport = remoteport->portnum;
remoteport->remoteport = port;
@@ -724,7 +724,7 @@ dump_mcpath(Node *node, int dumplevel)
(node->type <= IB_NODE_MAX ? node_type_str[node->type] : "???"),
node->nodeguid, node->ports->portnum, node->ports->lid,
node->ports->lid + (1 << node->ports->lmc) - 1,
- node->nodedesc);
+ node->nodedesc);
#endif
}
diff --git a/diags/src/saquery.c b/diags/src/saquery.c
index 27daee2..e9b7469 100644
--- a/diags/src/saquery.c
+++ b/diags/src/saquery.c
@@ -110,7 +110,7 @@ print_node_record(ib_node_record_t *node
ib_node_info_t *p_ni = NULL;
p_ni = &(node_record->node_info);
-
+
switch (node_print_desc) {
case LID_ONLY:
case UNIQUE_LID_ONLY:
diff --git a/diags/src/smpdump.c b/diags/src/smpdump.c
index 7eb636b..418cebe 100644
--- a/diags/src/smpdump.c
+++ b/diags/src/smpdump.c
@@ -234,7 +234,7 @@ main(int argc, char *argv[])
int dump_char = 0, timeout_ms = 1000;
int dev_port = 0, mgmt_class = CLASS_SUBN_LID_ROUTE, dlid = 0;
char *dev_name = 0;
- void *umad;
+ void *umad;
struct drsmp *smp;
int i, portid, mod = 0, attr;
DRPath path;
@@ -299,14 +299,14 @@ main(int argc, char *argv[])
if (mgmt_class == CLASS_SUBN_DIRECTED_ROUTE &&
str2DRPath(strdupa(argv[0]), &path) < 0)
IBPANIC("bad path str '%s'", argv[0]);
-
+
if (mgmt_class == CLASS_SUBN_LID_ROUTE)
dlid = strtoul(argv[0], 0, 0);
attr = strtoul(argv[1], 0, 0);
if (argc > 2)
mod = strtoul(argv[2], 0, 0);
-
+
if (umad_init() < 0)
IBPANIC("can't init UMAD library");
diff --git a/diags/src/smpquery.c b/diags/src/smpquery.c
index 68f9258..2bd315c 100644
--- a/diags/src/smpquery.c
+++ b/diags/src/smpquery.c
@@ -204,7 +204,7 @@ pkey_table(ib_portid_t *dest, char **arg
if (i + 1 == (n + 31) / 32)
k = ((n + 7 - i * 32) / 8) * 8;
else
- k = 32;
+ k = 32;
p = (uint16_t *) data;
for (j = 0; j < k; j += 8, p += 8) {
printf("%4u: 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x 0x%04x\n",
@@ -485,7 +485,7 @@ main(int argc, char **argv)
memset(concat, 0, 64);
snprintf(concat, sizeof(concat), "%s %s", argv[1], argv[2]);
if (ib_resolve_portid_str(&portid, concat, dest_type, sm_id) < 0)
- IBERROR("can't resolve destination port %s", concat);
+ IBERROR("can't resolve destination port %s", concat);
if ((err = fn(&portid, argv+3, argc-3)))
IBERROR("operation %s: %s", argv[0], err);
}
--
1.4.3.3.g8387
More information about the general
mailing list