From patchwork Mon Oct 9 14:00:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 115244 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2596294qgn; Mon, 9 Oct 2017 07:05:17 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCOreYhmjfapiFosKpt45NsANVsWK09h2sHjnzyGkVfeSQ7ozmqC8QMxJI+LmR0bH4VOMdH X-Received: by 10.36.206.65 with SMTP id v62mr13872627itg.104.1507557917384; Mon, 09 Oct 2017 07:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507557917; cv=none; d=google.com; s=arc-20160816; b=LHJnLzwNoUhMu6bCXYZnCQHd4xwWptqpRyPcHc0Olf5H22mzzAqEqVC/7oRBiQEwdl dMccAzPfn7HLBtJtiTmpTROYoYcOlYq9PEcfAArmElCbePQ8ya/Oy3NAFFeA92hudP+Z OobOjpYN3aJ75rBKxu+EZ+tj5Te1OTbpVYAnqJxVANM1WzezlAjG7/0f1SByQRI6hM5l AV23Km9GY6aUwCqBuUrv3pCib4tRVfcf18ekuazVE0Tm7untCGZMcYzeGNKV7xLg8ESz VzXZeB9cue5mgg+zJHGS8JWYQMZaCsi51jP99JvbGF5K0PesTwu3C4XcKV+9PTTnhfje Lifg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=unseQzG7mbMA1/J6BqLGdbcFGqjDzq52cYLxv1p31/o=; b=OPThNcU9TQ6ghzT7na6YDWMjAqKfgBdVr0YfT+iyyDwVQ7Mr+dk7RpftrJdMs+oqJN r9bFAbQ7tm0n7SySWxIGYuZR8bIPWPocKvdf0MNVkmBp3pDIbSNXBttUzIWnleW9GLgQ nA7xetQIYAQeP36n3QYpDwqWjh9C9RxmdvYlLztIVnlnJZVTCGvbyX9i9lbvRj5dKaq7 PJc9RnDLG+jRra2JhYUqW+xgrGdzHQy2grcX5CX5pXqgIZdoE00S/T1IsbBNCYWJaviW CmV//QUhxWZ3RKN2bh1ooUqfiecb78sReX7ALVcJVfopjheOdI0HaHuq/V18doPFBnaJ 0jBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 140si6490149ioz.244.2017.10.09.07.05.17; Mon, 09 Oct 2017 07:05:17 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id DDB4360C2D; Mon, 9 Oct 2017 14:05:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id BC31760C03; Mon, 9 Oct 2017 14:01:17 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 7BAA060BDC; Mon, 9 Oct 2017 14:00:57 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id 36A7C6080D for ; Mon, 9 Oct 2017 14:00:45 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 7957B1241D44 for ; Mon, 9 Oct 2017 17:00:42 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NSALJhVUTH-0giqIi6w; Mon, 09 Oct 2017 17:00:42 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id wSTIYzb9Br-0fdiNepw; Mon, 09 Oct 2017 17:00:41 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Mon, 9 Oct 2017 17:00:06 +0300 Message-Id: <1507557617-32018-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507557617-32018-1-git-send-email-odpbot@yandex.ru> References: <1507557617-32018-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 188 Subject: [lng-odp] [PATCH v3 2/13] linux-gen: _fdserver return code cleanup X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Maxim Uvarov somewhere we have return (-1) somewhere -1, let's make it common. Signed-off-by: Maxim Uvarov Reviewed-by: Bill Fischofer --- /** 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 --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 */