diff mbox series

[v3,2/13] linux-gen: _fdserver return code cleanup

Message ID 1507557617-32018-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,1/13] linux-gen: drop unused _odp_packet_cmp_data() function | expand

Commit Message

Github ODP bot Oct. 9, 2017, 2 p.m. UTC
From: Maxim Uvarov <maxim.uvarov@linaro.org>


somewhere we have return (-1) somewhere -1, let's
make it common.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

---
/** Email created from pull request 188 (WonderfulVoid:master)
 ** https://github.com/Linaro/odp/pull/188
 ** Patch: https://github.com/Linaro/odp/pull/188.patch
 ** Base sha: c16af6486eea240609f334b1bdc81a11404275de
 ** Merge commit sha: 4ad1d0615a4dcd74d4e9703090149eec1a58d7d2
 **/
 platform/linux-generic/_fdserver.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/_fdserver.c b/platform/linux-generic/_fdserver.c
index d15ddbec6..60bb91393 100644
--- a/platform/linux-generic/_fdserver.c
+++ b/platform/linux-generic/_fdserver.c
@@ -160,7 +160,7 @@  static int send_fdserver_msg(int sock, int command,
 	res = sendmsg(sock, &socket_message, 0);
 	if (res < 0) {
 		ODP_ERR("send_fdserver_msg: %s\n", strerror(errno));
-		return(-1);
+		return -1;
 	}
 
 	return 0;
@@ -206,7 +206,7 @@  static int recv_fdserver_msg(int sock, int *command,
 	/* receive the message */
 	if (recvmsg(sock, &socket_message, MSG_CMSG_CLOEXEC) < 0) {
 		ODP_ERR("recv_fdserver_msg: %s\n", strerror(errno));
-		return(-1);
+		return -1;
 	}
 
 	*command = msg.command;
@@ -251,7 +251,7 @@  static int get_socket(void)
 	s_sock = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (s_sock == -1) {
 		ODP_ERR("cannot connect to server: %s\n", strerror(errno));
-		return(-1);
+		return -1;
 	}
 
 	remote.sun_family = AF_UNIX;
@@ -260,7 +260,7 @@  static int get_socket(void)
 	if (connect(s_sock, (struct sockaddr *)&remote, len) == -1) {
 		ODP_ERR("cannot connect to server: %s\n", strerror(errno));
 		close(s_sock);
-		return(-1);
+		return -1;
 	}
 
 	return s_sock;
@@ -286,7 +286,7 @@  int _odp_fdserver_register_fd(fd_server_context_e context, uint64_t key,
 	s_sock = get_socket();
 	if (s_sock < 0) {
 		odp_spinlock_unlock(client_lock);
-		return(-1);
+		return -1;
 	}
 
 	res =  send_fdserver_msg(s_sock, FD_REGISTER_REQ, context, key,
@@ -332,7 +332,7 @@  int _odp_fdserver_deregister_fd(fd_server_context_e context, uint64_t key)
 	s_sock = get_socket();
 	if (s_sock < 0) {
 		odp_spinlock_unlock(client_lock);
-		return(-1);
+		return -1;
 	}
 
 	res =  send_fdserver_msg(s_sock, FD_DEREGISTER_REQ, context, key, -1);
@@ -375,7 +375,7 @@  int _odp_fdserver_lookup_fd(fd_server_context_e context, uint64_t key)
 	s_sock = get_socket();
 	if (s_sock < 0) {
 		odp_spinlock_unlock(client_lock);
-		return(-1);
+		return -1;
 	}
 
 	res =  send_fdserver_msg(s_sock, FD_LOOKUP_REQ, context, key, -1);
@@ -418,7 +418,7 @@  static int stop_server(void)
 	s_sock = get_socket();
 	if (s_sock < 0) {
 		odp_spinlock_unlock(client_lock);
-		return(-1);
+		return -1;
 	}
 
 	res =  send_fdserver_msg(s_sock, FD_SERVERSTOP_REQ, 0, 0, -1);
@@ -604,7 +604,7 @@  int _odp_fdserver_init_global(void)
 	sock = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (sock == -1) {
 		ODP_ERR("_odp_fdserver_init_global: %s\n", strerror(errno));
-		return(-1);
+		return -1;
 	}
 
 	/* remove previous named socket if it already exists: */
@@ -617,14 +617,14 @@  int _odp_fdserver_init_global(void)
 	if (res == -1) {
 		ODP_ERR("_odp_fdserver_init_global: %s\n", strerror(errno));
 		close(sock);
-		return(-1);
+		return -1;
 	}
 
 	/* listen for incoming conections: */
 	if (listen(sock, FDSERVER_BACKLOG) == -1) {
 		ODP_ERR("_odp_fdserver_init_global: %s\n", strerror(errno));
 		close(sock);
-		return(-1);
+		return -1;
 	}
 
 	/* fork a server process: */
@@ -632,7 +632,7 @@  int _odp_fdserver_init_global(void)
 	if (server_pid == -1) {
 		ODP_ERR("Could not fork!\n");
 		close(sock);
-		return(-1);
+		return -1;
 	}
 
 	if (server_pid == 0) { /*child */