[openib-general] [PATCH TRIVIAL] management/libib*: strip trailing whitespaces

Sasha Khapyorsky sashak at voltaire.com
Thu Nov 2 05:01:44 PST 2006


Strip trailing whitespaces for libibcommon, libibumad, libibmad.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 libibcommon/include/infiniband/common.h |    2 +-
 libibcommon/src/hash.c                  |    6 +++---
 libibmad/include/infiniband/mad.h       |    4 ++--
 libibmad/src/dump.c                     |   12 ++++++------
 libibmad/src/fields.c                   |    4 ++--
 libibmad/src/gs.c                       |    6 +++---
 libibmad/src/register.c                 |    2 +-
 libibmad/src/resolve.c                  |    4 ++--
 libibmad/src/rpc.c                      |    2 +-
 libibmad/src/sa.c                       |    2 +-
 libibmad/src/serv.c                     |    2 +-
 libibmad/src/smp.c                      |    4 ++--
 libibumad/include/infiniband/umad.h     |    4 ++--
 libibumad/src/umad.c                    |   26 +++++++++++++-------------
 14 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/libibcommon/include/infiniband/common.h b/libibcommon/include/infiniband/common.h
index 3537bdf..83c0679 100644
--- a/libibcommon/include/infiniband/common.h
+++ b/libibcommon/include/infiniband/common.h
@@ -152,7 +152,7 @@ __attribute__((unused)) static char _bui
 #endif
 
 __attribute__((unused)) static inline char*
-get_build_version(void) 
+get_build_version(void)
 {
 	return _build_version;
 }
diff --git a/libibcommon/src/hash.c b/libibcommon/src/hash.c
index 8f216a1..d05d221 100644
--- a/libibcommon/src/hash.c
+++ b/libibcommon/src/hash.c
@@ -57,16 +57,16 @@ For every delta with one or two bits set
   have at least 1/4 probability of changing.
 * If mix() is run forward, every bit of c will change between 1/3 and
   2/3 of the time.  (Well, 22/100 and 78/100 for some 2-bit deltas.)
-mix() was built out of 36 single-cycle latency instructions in a 
+mix() was built out of 36 single-cycle latency instructions in a
   structure that could supported 2x parallelism, like so:
-      a -= b; 
+      a -= b;
       a -= c; x = (c>>13);
       b -= c; a ^= x;
       b -= a; x = (a<<8);
       c -= a; b ^= x;
       c -= b; x = (b>>13);
       ...
-  Unfortunately, superscalar Pentiums and Sparcs can't take advantage 
+  Unfortunately, superscalar Pentiums and Sparcs can't take advantage
   of that parallelism.  They've also turned some of those single-cycle
   latency instructions into multi-cycle latency instructions.  Still,
   this is the fastest good hash I could find.  There were about 2^^68
diff --git a/libibmad/include/infiniband/mad.h b/libibmad/include/infiniband/mad.h
index 523f630..b6bbcbc 100644
--- a/libibmad/include/infiniband/mad.h
+++ b/libibmad/include/infiniband/mad.h
@@ -257,7 +257,7 @@ enum MAD_FIELDS {
 	IB_SM_DATA_F,
 
 	/* bytes 64 - 256 */
-	IB_GS_DATA_F, 
+	IB_GS_DATA_F,
 
 	/* bytes 128 - 191 */
 	IB_DRSMP_PATH_F,
@@ -602,7 +602,7 @@ enum {
 	IB_NODE_ROUTER,
 	NODE_RNIC,
 
-	IB_NODE_MAX = NODE_RNIC 
+	IB_NODE_MAX = NODE_RNIC
 };
 
 /******************************************************************************/
diff --git a/libibmad/src/dump.c b/libibmad/src/dump.c
index 1042ab1..eab3a8e 100644
--- a/libibmad/src/dump.c
+++ b/libibmad/src/dump.c
@@ -247,7 +247,7 @@ mad_dump_linkwidthsup(char *buf, int buf
 		break;
 	case 15:
 		snprintf(buf, bufsz, "1X or 4X or 8X or 12X");
-		break;	
+		break;
 	default:
 		IBWARN("bad width %d", width);
 		buf[0] = 0;
@@ -637,7 +637,7 @@ ib_slvl_get_i(ib_slvl_table_t *tbl, int
 }
 
 typedef struct _ib_vl_arb_element {
-	uint8_t res_vl; 
+	uint8_t res_vl;
 	uint8_t weight;
 } __attribute__((packed)) ib_vl_arb_element_t;
 
@@ -806,7 +806,7 @@ _mad_dump_field(ib_field_t *f, char *nam
 		dots[32 - l] = 0;
 	}
 
-	n = snprintf(buf, bufsz, "%s:%s", name, dots); 
+	n = snprintf(buf, bufsz, "%s:%s", name, dots);
 	_mad_dump_val(f, buf + n, bufsz - n, val);
 	buf[bufsz - 1] = 0;
 
@@ -816,13 +816,13 @@ _mad_dump_field(ib_field_t *f, char *nam
 int
 _mad_dump(ib_mad_dump_fn *fn, char *name, void *val, int valsz)
 {
-	ib_field_t f = { .def_dump_fn = fn, .bitlen = valsz * 8}; 
+	ib_field_t f = { .def_dump_fn = fn, .bitlen = valsz * 8};
 	char buf[512];
 
-	return printf("%s\n", _mad_dump_field(&f, name, buf, sizeof buf, val)); 
+	return printf("%s\n", _mad_dump_field(&f, name, buf, sizeof buf, val));
 }
 
-int 
+int
 _mad_print_field(ib_field_t *f, char *name, void *val, int valsz)
 {
 	return _mad_dump(f->def_dump_fn, name ? name : f->name, val, valsz ? valsz : ALIGN(f->bitlen, 8) / 8);
diff --git a/libibmad/src/fields.c b/libibmad/src/fields.c
index 3f0ed44..d100713 100644
--- a/libibmad/src/fields.c
+++ b/libibmad/src/fields.c
@@ -323,7 +323,7 @@ ib_field_t ib_mad_f [] = {
 	[IB_ATS_SM_MAGIC_KEY_F]		{BITSOFFS(16*8, 16), "ATSMagicKey", mad_dump_hex},
 	[IB_ATS_SM_NODE_TYPE_F]		{BITSOFFS(18*8, 16), "ATSNodeType", mad_dump_hex},
 	[IB_ATS_SM_NODE_NAME_F]		{32*8, 32*8, "ATSNodeName", mad_dump_string},
-	
+
 	/*
 	 * SLTOVL MAPPING TABLE
 	 */
@@ -348,7 +348,7 @@ ib_field_t ib_mad_f [] = {
 	[IB_PC_EXT_XMT_BYTES_F]		{64, 64, "PortXmitData", mad_dump_uint},
 	[IB_PC_EXT_RCV_BYTES_F]		{128, 64, "PortRcvData", mad_dump_uint},
 	[IB_PC_EXT_XMT_PKTS_F]		{192, 64, "PortXmitPkts", mad_dump_uint},
-	[IB_PC_EXT_RCV_PKTS_F]		{256, 64, "PortRcvPkts", mad_dump_uint}, 
+	[IB_PC_EXT_RCV_PKTS_F]		{256, 64, "PortRcvPkts", mad_dump_uint},
 	[IB_PC_EXT_XMT_UPKTS_F]		{320, 64, "PortUnicastXmitPkts", mad_dump_uint},
 	[IB_PC_EXT_RCV_UPKTS_F]		{384, 64, "PortUnicastRcvPkts", mad_dump_uint},
 	[IB_PC_EXT_XMT_MPKTS_F]		{448, 64, "PortMulticastXmitPkts", mad_dump_uint},
diff --git a/libibmad/src/gs.c b/libibmad/src/gs.c
index 8a4bd6d..d45dc9f 100644
--- a/libibmad/src/gs.c
+++ b/libibmad/src/gs.c
@@ -78,7 +78,7 @@ pma_query(void *rcvbuf, ib_portid_t *des
 	if (!dest->qkey)
 		dest->qkey = IB_DEFAULT_QP1_QKEY;
 
-	return madrpc(&rpc, dest, rcvbuf, rcvbuf); 
+	return madrpc(&rpc, dest, rcvbuf, rcvbuf);
 }
 
 uint8_t *
@@ -109,7 +109,7 @@ performance_reset(void *rcvbuf, ib_porti
 
 	if (!mask)
 		mask = ~0;
-	
+
 	rpc.mgtclass = IB_PERFORMANCE_CLASS;
 	rpc.method = IB_MAD_METHOD_SET;
 	rpc.attr.id = id;
@@ -127,7 +127,7 @@ performance_reset(void *rcvbuf, ib_porti
 	if (!dest->qkey)
 		dest->qkey = IB_DEFAULT_QP1_QKEY;
 
-	return madrpc(&rpc, dest, rcvbuf, rcvbuf); 
+	return madrpc(&rpc, dest, rcvbuf, rcvbuf);
 }
 
 uint8_t *
diff --git a/libibmad/src/register.c b/libibmad/src/register.c
index 52d6989..602b997 100644
--- a/libibmad/src/register.c
+++ b/libibmad/src/register.c
@@ -67,7 +67,7 @@ register_agent(int agent, int mclass)
 		memset(class_agent, 0xff, sizeof class_agent);
 		memset(agent_class, 0xff, sizeof agent_class);
 	}
-	
+
 	if (mclass < 0 || mclass >= MAX_CLASS ||
 	    agent < 0 || agent >= MAX_AGENTS) {
 		DEBUG("bad mgmt class %d or agent %d", mclass, agent);
diff --git a/libibmad/src/resolve.c b/libibmad/src/resolve.c
index 93ddb43..da505d2 100644
--- a/libibmad/src/resolve.c
+++ b/libibmad/src/resolve.c
@@ -87,7 +87,7 @@ ib_resolve_guid(ib_portid_t *portid, uin
 
 	return 0;
 }
-	
+
 int
 ib_resolve_portid_str(ib_portid_t *portid, char *addr_str, int dest_type, ib_portid_t *sm_id)
 {
@@ -144,7 +144,7 @@ ib_resolve_self(ib_portid_t *portid, int
 	uint8_t portinfo[64];
 	uint8_t nodeinfo[64];
 	uint64_t guid, prefix;
-	
+
 	if (!smp_query(nodeinfo, &self, IB_ATTR_NODE_INFO, 0, 0))
 		return -1;
 
diff --git a/libibmad/src/rpc.c b/libibmad/src/rpc.c
index e90920b..142f8d8 100644
--- a/libibmad/src/rpc.c
+++ b/libibmad/src/rpc.c
@@ -111,7 +111,7 @@ madrpc_portid(void)
 	return mad_portid;
 }
 
-static int 
+static int
 _do_madrpc(int port_id, void *sndbuf, void *rcvbuf, int agentid, int len,
 	   int timeout)
 {
diff --git a/libibmad/src/sa.c b/libibmad/src/sa.c
index 8de49e5..7b4b8a0 100644
--- a/libibmad/src/sa.c
+++ b/libibmad/src/sa.c
@@ -111,7 +111,7 @@ sa_rpc_call(void *ibmad_port, void *rcvb
 #define IB_PR_DEF_MASK (IB_PR_COMPMASK_DGID |\
 			IB_PR_COMPMASK_SGID |\
 			IB_PR_COMPMASK_NUMBPATH)
-			
+
 int
 ib_path_query(ib_gid_t srcgid, ib_gid_t destgid, ib_portid_t *sm_id, void *buf)
 {
diff --git a/libibmad/src/serv.c b/libibmad/src/serv.c
index 3b100c8..63be97c 100644
--- a/libibmad/src/serv.c
+++ b/libibmad/src/serv.c
@@ -142,7 +142,7 @@ mad_respond(void *umad, ib_portid_t *por
 	if (mad_build_pkt(umad, &rpc, portid, 0, 0) < 0)
 		return -1;
 
-	if (ibdebug > 1) 
+	if (ibdebug > 1)
 		xdump(stderr, "mad respond pkt\n", mad, IB_MAD_SIZE);
 
 	if (umad_send(madrpc_portid(), mad_class_agent(rpc.mgtclass), umad,
diff --git a/libibmad/src/smp.c b/libibmad/src/smp.c
index ff55997..f6477a1 100644
--- a/libibmad/src/smp.c
+++ b/libibmad/src/smp.c
@@ -72,7 +72,7 @@ smp_set(void *data, ib_portid_t *portid,
 	portid->sl = 0;
 	portid->qp = 0;
 
-	return madrpc(&rpc, portid, data, data); 
+	return madrpc(&rpc, portid, data, data);
 }
 
 uint8_t *
@@ -99,5 +99,5 @@ smp_query(void *rcvbuf, ib_portid_t *por
 	portid->sl = 0;
 	portid->qp = 0;
 
-	return madrpc(&rpc, portid, 0, rcvbuf); 
+	return madrpc(&rpc, portid, 0, rcvbuf);
 }
diff --git a/libibumad/include/infiniband/umad.h b/libibumad/include/infiniband/umad.h
index 6026a86..8058263 100644
--- a/libibumad/include/infiniband/umad.h
+++ b/libibumad/include/infiniband/umad.h
@@ -178,7 +178,7 @@ int	umad_get_fd(int portid);
 
 int	umad_register(int portid, int mgmt_class, int mgmt_version,
 		      uint8_t rmpp_version, uint32_t method_mask[4]);
-int	umad_register_oui(int portid, int mgmt_class, uint8_t rmpp_version, 
+int	umad_register_oui(int portid, int mgmt_class, uint8_t rmpp_version,
 			  uint8_t oui[3], uint32_t method_mask[4]);
 int	umad_unregister(int portid, int agentid);
 
@@ -191,7 +191,7 @@ void	umad_dump(void *umad);
 static inline void *
 umad_alloc(int num, size_t size)	/* alloc array of umad buffers */
 {
-	return calloc(num, size); 
+	return calloc(num, size);
 }
 
 static inline void
diff --git a/libibumad/src/umad.c b/libibumad/src/umad.c
index 860dbef..71b6833 100644
--- a/libibumad/src/umad.c
+++ b/libibumad/src/umad.c
@@ -292,7 +292,7 @@ resolve_ca_name(char *ca_name, int *best
 			return 0;
 		return ca_name;
 	}
-		
+
 	/* Get the list of CA names */
 	if ((n = umad_get_cas_names((void *)names, UMAD_CA_NAME_LEN)) < 0)
 		return 0;
@@ -300,7 +300,7 @@ resolve_ca_name(char *ca_name, int *best
 	/* Find the first existing CA with an active port */
 	for (caidx = 0; caidx < n; caidx++) {
 		TRACE("checking ca '%s'", names[caidx]);
-	
+
 		port = *best_port;
 		if ((port_type = resolve_ca_port(names[caidx], &port)) < 0)
 			continue;
@@ -345,7 +345,7 @@ get_ca(char *ca_name, umad_ca_t *ca)
 	int portnum;
 
 	strncpy(ca->ca_name, ca_name, sizeof ca->ca_name);
-	 
+
 	snprintf(dir_name, sizeof dir_name - 1, "%s/%s", SYS_INFINIBAND,
 		 ca->ca_name);
 	dir_name[sizeof dir_name - 1] = 0;
@@ -506,9 +506,9 @@ umad_get_cas_names(char cas[][UMAD_CA_NA
 	n = scandir(SYS_INFINIBAND, &namelist, 0, alphasort);
 	if (n > 0) {
 		for (i = 0; i < n; i++) {
-			if (!strcmp(namelist[i]->d_name, ".") || 
+			if (!strcmp(namelist[i]->d_name, ".") ||
 			    !strcmp(namelist[i]->d_name, "..")) {
-			} else 
+			} else
 				strncpy(cas[j++], namelist[i]->d_name,
 					UMAD_CA_NAME_LEN);
 			free(namelist[i]);
@@ -615,7 +615,7 @@ umad_release_ca(umad_ca_t *ca)
 		return r;
 
 	DEBUG("releasing %s", ca->ca_name);
-	return 0;	
+	return 0;
 }
 
 int
@@ -647,7 +647,7 @@ umad_release_port(umad_port_t *port)
 		return r;
 
 	DEBUG("releasing %s:%d", port->ca_name, port->portnum);
-	return 0;	
+	return 0;
 }
 
 int
@@ -660,7 +660,7 @@ umad_close_port(int portid)
 		return -EINVAL;
 
 	close(port->dev_fd);
-	
+
 	port_free(port);
 
 	DEBUG("closed %s fd %d", port->dev_file, port->dev_fd);
@@ -892,10 +892,10 @@ umad_register_oui(int portid, int mgmt_c
 			portid, req.id, req.qpn, oui);
 		return req.id; 		/* return agentid */
 	}
-	
+
 	DEBUG("portid %d registering qp %d class 0x%x version %d oui 0x%x failed: %m",
 		portid, req.qpn, req.mgmt_class, req.mgmt_class_version, oui);
-	return -EPERM;	
+	return -EPERM;
 }
 
 int
@@ -923,17 +923,17 @@ umad_register(int portid, int mgmt_class
 	else
 		memset(req.method_mask, 0, sizeof req.method_mask);
 
-	memcpy(&req.oui, (char *)&oui + 1, sizeof req.oui); 
+	memcpy(&req.oui, (char *)&oui + 1, sizeof req.oui);
 
 	if (!ioctl(port->dev_fd, IB_USER_MAD_REGISTER_AGENT, (void *)&req)) {
 		DEBUG("portid %d registered to use agent %d qp %d",
 		      portid, req.id, qp);
 		return req.id; 		/* return agentid */
 	}
-	
+
 	DEBUG("portid %d registering qp %d class 0x%x version %d failed: %m",
 		portid, qp, mgmt_class, mgmt_version);
-	return -EPERM;	
+	return -EPERM;
 }
 
 int
-- 
1.4.3.3.g8387





More information about the general mailing list