[ofa-general] [PATCH] libibverbs: fix coding style typos according to checkpatch.pl

Dotan Barak dotanba at gmail.com
Fri May 23 13:32:07 PDT 2008


Fixed coding style typos according to checkpatch.pl
(without harming code readability).

Signed-off-by: Dotan Barak <dotanba at gmail.com>

---

diff --git a/examples/devinfo.c b/examples/devinfo.c
index 1fadc80..86ad7da 100644
--- a/examples/devinfo.c
+++ b/examples/devinfo.c
@@ -48,7 +48,7 @@
 #include <infiniband/driver.h>
 #include <infiniband/arch.h>
 
-static int verbose = 0;
+static int verbose;
 
 static int null_gid(union ibv_gid *gid)
 {
@@ -231,9 +231,8 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
 		       device_attr.max_total_mcast_qp_attach);
 		printf("\tmax_ah:\t\t\t\t%d\n", device_attr.max_ah);
 		printf("\tmax_fmr:\t\t\t%d\n", device_attr.max_fmr);
-		if (device_attr.max_fmr) {
+		if (device_attr.max_fmr)
 			printf("\tmax_map_per_fmr:\t\t%d\n", device_attr.max_map_per_fmr);
-		}
 		printf("\tmax_srq:\t\t\t%d\n", device_attr.max_srq);
 		if (device_attr.max_srq) {
 			printf("\tmax_srq_wr:\t\t\t%d\n", device_attr.max_srq_wr);
diff --git a/examples/srq_pingpong.c b/examples/srq_pingpong.c
index 95bebf4..e47bae6 100644
--- a/examples/srq_pingpong.c
+++ b/examples/srq_pingpong.c
@@ -143,7 +143,7 @@ static struct pingpong_dest *pp_client_exch_dest(const char *servername, int por
 		.ai_socktype = SOCK_STREAM
 	};
 	char *service;
-	char msg[ sizeof "0000:000000:000000"];
+	char msg[sizeof "0000:000000:000000"];
 	int n;
 	int r;
 	int i;
@@ -227,7 +227,7 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
 		.ai_socktype = SOCK_STREAM
 	};
 	char *service;
-	char msg[ sizeof "0000:000000:000000"];
+	char msg[sizeof "0000:000000:000000"];
 	int n;
 	int r;
 	int i;
@@ -275,7 +275,7 @@ static struct pingpong_dest *pp_server_exch_dest(struct pingpong_context *ctx,
 		return NULL;
 	}
 
-	rem_dest = malloc(MAX_QP *sizeof *rem_dest);
+	rem_dest = malloc(MAX_QP * sizeof *rem_dest);
 	if (!rem_dest)
 		goto out;
 
diff --git a/src/cmd.c b/src/cmd.c
index 9db8aa6..66d7134 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -851,7 +851,7 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr,
 			tmp->wr.ud.remote_qpn  = i->wr.ud.remote_qpn;
 			tmp->wr.ud.remote_qkey = i->wr.ud.remote_qkey;
 		} else {
-			switch(i->opcode) {
+			switch (i->opcode) {
 			case IBV_WR_RDMA_WRITE:
 			case IBV_WR_RDMA_WRITE_WITH_IMM:
 			case IBV_WR_RDMA_READ:
diff --git a/src/ibverbs.h b/src/ibverbs.h
index b1d2c2b..6a6e3c8 100644
--- a/src/ibverbs.h
+++ b/src/ibverbs.h
@@ -49,7 +49,7 @@
 #endif /* HAVE_VALGRIND_MEMCHECK_H */
 
 #ifndef VALGRIND_MAKE_MEM_DEFINED
-#  define VALGRIND_MAKE_MEM_DEFINED(addr,len)
+#  define VALGRIND_MAKE_MEM_DEFINED(addr, len)
 #endif
 
 #define HIDDEN		__attribute__((visibility ("hidden")))
diff --git a/src/init.c b/src/init.c
index 07ab855..82dfae4 100644
--- a/src/init.c
+++ b/src/init.c
@@ -321,7 +321,7 @@ static void read_config(void)
 			goto next;
 
 		read_config_file(path);
-	next:
+next:
 		free(path);
 	}
 



More information about the general mailing list